MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 1 | |
Zesstra | 953f997 | 2017-02-18 15:37:36 +0100 | [diff] [blame] | 2 | object_info() |
| 3 | ************* |
| 4 | |
| 5 | |
| 6 | DEPRECATED |
| 7 | ========== |
| 8 | |
| 9 | |
| 10 | SYNOPSIS |
| 11 | ======== |
| 12 | |
| 13 | #include <objectinfo.h> |
| 14 | |
| 15 | mixed * object_info(object ob, int what) |
| 16 | mixed * object_info(object ob, int what, int index) |
| 17 | |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 18 | |
| 19 | DESCRIPTION |
Zesstra | 953f997 | 2017-02-18 15:37:36 +0100 | [diff] [blame] | 20 | =========== |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 21 | |
Zesstra | 953f997 | 2017-02-18 15:37:36 +0100 | [diff] [blame] | 22 | Returns some internal information about object <ob>, collected |
| 23 | in an array. Argument <what> determines which information is |
| 24 | returned. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 25 | |
Zesstra | 953f997 | 2017-02-18 15:37:36 +0100 | [diff] [blame] | 26 | The result is usually an array. However, if <index> is specified, |
| 27 | the result is the value from position <index> of the array which |
| 28 | would have been returned normally. |
| 29 | |
| 30 | The possible values of <what>, and the indices of the returned |
| 31 | arrays are defined in the include file <objectinfo.h>, and may |
| 32 | change in future versions of the driver! |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 33 | |
| 34 | |
Zesstra | 953f997 | 2017-02-18 15:37:36 +0100 | [diff] [blame] | 35 | <what> == OINFO_BASIC: |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 36 | |
Zesstra | 953f997 | 2017-02-18 15:37:36 +0100 | [diff] [blame] | 37 | This call returns basic information about <ob>: |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 38 | |
Zesstra | 953f997 | 2017-02-18 15:37:36 +0100 | [diff] [blame] | 39 | int [OIB_HEART_BEAT]: 1 if <ob> has a heart_beat, 0 else. |
| 40 | int [OIB_IS_WIZARD]: 1 if <ob> has the wizard flag set, |
| 41 | 0 else. |
| 42 | This entry is always 0 when set_is_wizard() is not available. |
| 43 | int [OIB_ENABLE_COMMANDS]: 1 if <ob> can give commands, 0 else. |
| 44 | int [OIB_CLONE]: 1 if <ob> is a clone, 0 else. |
| 45 | int [OIB_DESTRUCTED]: 1 if <ob> is destructed, 0 else. |
| 46 | int [OIB_SWAPPED]: 1 if <ob> is swapped, 0 else. |
| 47 | int [OIB_ONCE_INTERACTIVE]: 1 if <ob> was once interactive, 0 else. |
| 48 | int [OIB_RESET_STATE]: 1 if <ob> is (still) reset, 0 else. |
| 49 | int [OIB_WILL_CLEAN_UP]: 1 if <ob> will call clean_up(), 0 else. |
| 50 | int [OIB_LAMBDA_REFERENCED]: 1 if <ob> has lambdas, 0 else. |
| 51 | int [OIB_SHADOW]: 1 if <ob> has a shadow structure tied |
| 52 | to it, 0 if not. |
| 53 | int [OIB_REPLACED]: 1 if the program for <ob> was replaced, |
| 54 | 0 else. |
| 55 | int [OIB_NEXT_RESET]: time of the next reset |
| 56 | int [OIB_TIME_OF_REF]: time of the last call to <ob> |
| 57 | int [OIB_NEXT_CLEANUP]: time of the next data cleanup |
| 58 | int [OIB_REF]: number of references to <ob> |
| 59 | int [OIB_GIGATICKS] and [OIB_TICKS]: together, these numbers |
| 60 | give the accumulated evaluation cost spend in <ob> |
| 61 | int [OIB_SWAP_NUM]: the swap number for <ob>s program, |
| 62 | or -1 if not swapped. |
| 63 | int [OIB_PROG_SWAPPED]: 1 if <ob>'s program is swapped, 0 else. |
| 64 | int [OIB_VAR_SWAPPED]: 1 if <ob>'s variables are swapped, 0 else. |
| 65 | int [OIB_NAME]: <ob>'s object name. |
| 66 | int [OIB_LOAD_NAME]: <ob>'s load name. |
| 67 | object [OIB_NEXT_ALL]: next object in the object list. |
| 68 | object [OIB_PREV_ALL]: previous object in the object list. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 69 | |
| 70 | |
Zesstra | 953f997 | 2017-02-18 15:37:36 +0100 | [diff] [blame] | 71 | <what> == OINFO_POSITION: |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 72 | |
Zesstra | 953f997 | 2017-02-18 15:37:36 +0100 | [diff] [blame] | 73 | This call returns information about <ob>'s position in the |
| 74 | global list of objects: |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 75 | |
Zesstra | 953f997 | 2017-02-18 15:37:36 +0100 | [diff] [blame] | 76 | object [OIP_NEXT]: next object in the object list. |
| 77 | object [OIP_PREV]: previous object in the object list. |
| 78 | int [OIP_POS]: position of <ob> in list, counting from 0 up. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 79 | |
Zesstra | 953f997 | 2017-02-18 15:37:36 +0100 | [diff] [blame] | 80 | This call can be expensive in computing time. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 81 | |
| 82 | |
Zesstra | 953f997 | 2017-02-18 15:37:36 +0100 | [diff] [blame] | 83 | <what> == OINFO_MEMORY: |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 84 | |
Zesstra | 953f997 | 2017-02-18 15:37:36 +0100 | [diff] [blame] | 85 | This call returns information about the program <ob> uses: |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 86 | |
Zesstra | 953f997 | 2017-02-18 15:37:36 +0100 | [diff] [blame] | 87 | int [OIM_REF]: number of references to the program. |
| 88 | string [OIM_NAME]: name of program. |
| 89 | int [OIM_PROG_SIZE]: size of the program. |
| 90 | int [OIM_NUM_FUNCTIONS]: number of functions in the program. |
| 91 | int [OIM_SIZE_FUNCTIONS]: size needed for the function structs. |
| 92 | int [OIM_NUM_VARIABLES]: number of variables in the program. |
| 93 | int [OIM_SIZE_VARIABLES]: size needed for the variable structs. |
| 94 | int [OIM_NUM_STRINGS]: number of strings in the program. |
| 95 | int [OIM_SIZE_STRINGS]: size needed for the string pointers. |
| 96 | int [OIM_SIZE_STRINGS_DATA]: size needed for the string data, |
| 97 | scaled down according to the extend of |
| 98 | data sharing. |
| 99 | int [OIM_SIZE_STRINGS_TOTAL]: unmodified size needed for the |
| 100 | string data. |
| 101 | int [OIM_NUM_INCLUDES]: number of included files in the program. |
| 102 | int [OIM_NUM_INHERITED]: number of inherited programs. |
| 103 | int [OIM_SIZE_INHERITED]: size needed for the inherit structs. |
| 104 | int [OIM_TOTAL_SIZE]: total size of the program. |
| 105 | int [OIM_DATA_SIZE]: total size of the values held in the |
| 106 | object's variables, scaled down |
| 107 | according to the extend of data |
| 108 | sharing. |
| 109 | int [OIM_DATA_SIZE_TOTAL]: unmodified total size of the values |
| 110 | held in the object's variables |
| 111 | int [OIM_NO_INHERIT]: 1 if the program can't be inherited. |
| 112 | int [OIM_NO_CLONE]: 1 if the program/blueprint can't be |
| 113 | cloned. |
| 114 | int [OIM_NO_SHADOW]: 1 if the program's functions can't be |
| 115 | shadowed. |
| 116 | int [OIM_SHARE_VARIABLES]: 1 if clones of this program share |
| 117 | their initial variable values with |
| 118 | the blueprint. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 119 | |
Zesstra | 953f997 | 2017-02-18 15:37:36 +0100 | [diff] [blame] | 120 | This call swaps in the program if necessary. |
| 121 | Note that the OIM_SIZE_xxx entries only give the size spent on |
| 122 | the structures and pointers, not the size of the variable data, |
| 123 | function code, and strings themselves. |
| 124 | |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 125 | |
| 126 | HISTORY |
Zesstra | 953f997 | 2017-02-18 15:37:36 +0100 | [diff] [blame] | 127 | ======= |
| 128 | |
| 129 | Introduced in LDMud 3.2.6. |
| 130 | Changes in LDMud 3.2.7: |
| 131 | - new basic result OIB_REPLACED. |
| 132 | - basic result OIB_IS_WIZARD is always 0 if set_is_wizard() |
| 133 | is not available. |
| 134 | - basic result OIB_APPROVED is gone. |
| 135 | LDMud 3.2.8 added OIM_DATA_SIZE to the result of OINFO_MEMORY. |
| 136 | LDMud 3.2.9 added the index mechanism, OIM_NUM_INCLUDES, |
| 137 | OIM_NO_INHERIT, OIM_NO_SHADOW, OIM_NO_CLONE, OIM_SIZE_STRINGS_DATA, |
| 138 | OIM_SIZE_STRINGS_TOTAL, and OIM_DATA_SIZE_TOTAL to the result |
| 139 | of OINFO_MEMORY. |
| 140 | LDMud 3.3.378 added the OIM_SHARE_VARIABLES to the result |
| 141 | of OINFO_MEMORY. |
| 142 | LDMud 3.3.654 added the OIB_NEXT_CLEANUP to the result of OINFO_BASIC. |
| 143 | |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 144 | |
| 145 | SEE ALSO |
Zesstra | 953f997 | 2017-02-18 15:37:36 +0100 | [diff] [blame] | 146 | ======== |
| 147 | |
| 148 | debug_info(E) |