blob: bdd55d4f27c0299cb96ebfb78f17d6968656e4a9 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
2 string program_name()
Zesstra5481d492021-04-08 20:07:06 +02003 string program_name(object|lwobject obj)
MG Mud User88f12472016-06-24 23:31:02 +02004
Zesstra715ec202025-07-09 22:18:31 +02005DESCRIPTION
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 User88f12472016-06-24 23:31:02 +02008
Zesstra715ec202025-07-09 22:18:31 +02009 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 User88f12472016-06-24 23:31:02 +020012
Zesstra715ec202025-07-09 22:18:31 +020013 As a special case, if <ob> is passed as 0, the function will
14 return 0.
MG Mud User88f12472016-06-24 23:31:02 +020015
Zesstra715ec202025-07-09 22:18:31 +020016 The name always ends in '.c'. It starts with a '/' unless the
17 driver is running in COMPAT mode.
MG Mud User88f12472016-06-24 23:31:02 +020018
Zesstra715ec202025-07-09 22:18:31 +020019 CAVEAT: This efun swaps in the program if it is swapped out.
20
21EXAMPLES
MG Mud User88f12472016-06-24 23:31:02 +020022 object o;
Zesstra715ec202025-07-09 22:18:31 +020023 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 User88f12472016-06-24 23:31:02 +020026
Zesstra715ec202025-07-09 22:18:31 +020027HISTORY
28 Introduced in LDMud 3.2.6.
29 LDMud 3.2.9 allowed a 0 argument.
MG Mud User88f12472016-06-24 23:31:02 +020030
Zesstra715ec202025-07-09 22:18:31 +020031SEE ALSO
MG Mud User88f12472016-06-24 23:31:02 +020032 clone_object(E), clonep(E), load_name(E), load_object(E),
33 object_name(E), replace_program(E)