MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 1 | SYNOPSIS |
| 2 | string program_name() |
Zesstra | 5481d49 | 2021-04-08 20:07:06 +0200 | [diff] [blame] | 3 | string program_name(object|lwobject obj) |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 4 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 5 | DESCRIPTION |
| 6 | Returns the name of the program of <obj>, resp. the name of the |
| 7 | program of the current object if <obj> is omitted. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 8 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 9 | The returned name is usually the name from which the blueprint |
| 10 | of <obj> was compiled (the 'load name'), but changes if an object |
| 11 | replaces its programs with the efun replace_program(). |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 12 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 13 | As a special case, if <ob> is passed as 0, the function will |
| 14 | return 0. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 15 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 16 | The name always ends in '.c'. It starts with a '/' unless the |
| 17 | driver is running in COMPAT mode. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 18 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 19 | CAVEAT: This efun swaps in the program if it is swapped out. |
| 20 | |
| 21 | EXAMPLES |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 22 | object o; |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 23 | o = clone_object("/std/thing"); |
| 24 | write(program_name(o)); --> writes "/std/thing.c" in !compat mode |
| 25 | and "std/thing.c" in compat mode |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 26 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 27 | HISTORY |
| 28 | Introduced in LDMud 3.2.6. |
| 29 | LDMud 3.2.9 allowed a 0 argument. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 30 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 31 | SEE ALSO |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 32 | clone_object(E), clonep(E), load_name(E), load_object(E), |
| 33 | object_name(E), replace_program(E) |