MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 1 | SYNOPSIS |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 2 | #include <inherit_list.h> |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 3 | |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 4 | string * inherit_list() |
Zesstra | 5481d49 | 2021-04-08 20:07:06 +0200 | [diff] [blame] | 5 | string * inherit_list(object|lwobject ob) |
| 6 | string * inherit_list(object|lwobject ob, int flags) |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 7 | |
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 | DESCRIPTION |
| 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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 13 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 14 | <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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 18 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 19 | <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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 27 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 28 | <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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 40 | |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 41 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 42 | EXAMPLES |
| 43 | Given this inheritance structure: |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 44 | |
| 45 | / c - d |
| 46 | a |
| 47 | \ b |
| 48 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 49 | the efun will give the following results: |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 50 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 51 | inherit_list(a) -> ({ "a", "c", "b", "d" }) |
| 52 | inherit_list(c) -> ({ "c", "d" }) |
| 53 | inherit_list(a, 1) -> ({ "a", ({ "c", "d" }), "b" }) |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 54 | |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 55 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 56 | HISTORY |
| 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 | |
| 62 | SEE ALSO |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 63 | debug_info(E), include_list(E) |