blob: 98d1cb462cee49be817131c0ed8997b72366d5a8 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
Zesstrad59c3892019-11-28 20:53:39 +01002 #include <inherit_list.h>
MG Mud User88f12472016-06-24 23:31:02 +02003
Zesstrad59c3892019-11-28 20:53:39 +01004 string * inherit_list()
Zesstra5481d492021-04-08 20:07:06 +02005 string * inherit_list(object|lwobject ob)
6 string * inherit_list(object|lwobject ob, int flags)
MG Mud User88f12472016-06-24 23:31:02 +02007
MG Mud User88f12472016-06-24 23:31:02 +02008
Zesstra715ec202025-07-09 22:18:31 +02009DESCRIPTION
10 Returns the names of all files inherited by <ob>, including
11 <ob>s own filename. If <ob> is omitted, it defaults to the current
12 object. The value of <flags> determines the structure of the output.
MG Mud User88f12472016-06-24 23:31:02 +020013
Zesstra715ec202025-07-09 22:18:31 +020014 <flag> = INHLIST_FLAT (0, default):
15 The result is an array of filenames, starting the with the filename
16 of <ob> itself, followed by the names of all inherited objects
17 in breadth order.
MG Mud User88f12472016-06-24 23:31:02 +020018
Zesstra715ec202025-07-09 22:18:31 +020019 <flag> = INHLIST_TREE (1):
20 The result is an array starting the with the filename
21 of <ob> itself, followed by the all directly inherited
22 objects. If one of the inherited objects has no inherits by itself,
23 then its name will be stored directly in the array. If one inherited
24 object has inherits by itself, a subvector will be created and
25 stored in the result vector. The subvector(s) have the same
26 structure as the main result vector.
MG Mud User88f12472016-06-24 23:31:02 +020027
Zesstra715ec202025-07-09 22:18:31 +020028 <flag> = INHLIST_TAG_VIRTUAL (2):
29 All names in the result are prefixed with a tag: " " (two spaces)
30 for normal inherits, "v " for virtual inherits.
31
32 All flags can be combined with binary-|, just _FLAT and _TREE are
33 mutually exclusive.
34
35 If objects, including <ob>, had been undergone a replace_program(),
36 the returned filenames will reflect the actual active program.
37
38 The returned names always begin with '/' (absolute path), except
39 when the parser runs in COMPAT mode.
MG Mud User88f12472016-06-24 23:31:02 +020040
Zesstrad59c3892019-11-28 20:53:39 +010041
Zesstra715ec202025-07-09 22:18:31 +020042EXAMPLES
43 Given this inheritance structure:
MG Mud User88f12472016-06-24 23:31:02 +020044
45 / c - d
46 a
47 \ b
48
Zesstra715ec202025-07-09 22:18:31 +020049 the efun will give the following results:
MG Mud User88f12472016-06-24 23:31:02 +020050
Zesstra715ec202025-07-09 22:18:31 +020051 inherit_list(a) -> ({ "a", "c", "b", "d" })
52 inherit_list(c) -> ({ "c", "d" })
53 inherit_list(a, 1) -> ({ "a", ({ "c", "d" }), "b" })
MG Mud User88f12472016-06-24 23:31:02 +020054
MG Mud User88f12472016-06-24 23:31:02 +020055
Zesstra715ec202025-07-09 22:18:31 +020056HISTORY
57 Before 3.2.8, the returned names never started with a '/'.
58 LDMud 3.2.9/3.3.111 added the tree representation.
59 LDMud 3.2.9/3.3.125 added the tagging of virtual inherits.
60
61
62SEE ALSO
MG Mud User88f12472016-06-24 23:31:02 +020063 debug_info(E), include_list(E)