MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | SYNOPSIS |
| 2 | #include <object_info.h> |
| 3 | |
| 4 | mixed object_info(object ob, int what) |
| 5 | |
| 6 | DESCRIPTION |
| 7 | Returns some internal information about object <ob>. The |
| 8 | Argument <what> determines which information is returned. |
| 9 | |
| 10 | It can be either a configuration option as given to |
| 11 | configure_object() or one of the following options: |
| 12 | |
| 13 | |
| 14 | |
| 15 | Object Flags: |
| 16 | |
| 17 | <what> == OI_ONCE_INTERACTIVE: |
| 18 | 1 if <ob> was once (or still is) interactive, 0 else. |
| 19 | |
| 20 | <what> == OI_RESET_STATE: |
| 21 | 1 if <ob> is (still) reset, 0 else. |
| 22 | |
| 23 | <what> == OI_WILL_CLEAN_UP: |
| 24 | 1 if <ob>'s clean_up() will be called, 0 else. |
| 25 | |
| 26 | <what> == OI_LAMBDA_REFERENCED: |
| 27 | 1 if <ob> has lambdas (and there replace_program() |
| 28 | is not allowed anymore), 0 else. |
| 29 | |
| 30 | <what> == OI_REPLACED: |
| 31 | 1 if the program for <ob> was replaced, 0 else. |
| 32 | |
| 33 | |
| 34 | |
| 35 | Program Flags: |
| 36 | |
| 37 | <what> == OI_NO_INHERIT: |
| 38 | 1 if the program can't be inherited. |
| 39 | |
| 40 | <what> == OI_NO_CLONE: |
| 41 | 1 if the program/blueprint can't be cloned. |
| 42 | |
| 43 | <what> == OI_NO_SHADOW: |
| 44 | 1 if the program's functions can't be shadowed. |
| 45 | |
| 46 | <what> == OI_SHARE_VARIABLES: |
| 47 | 1 if clones of this program share their initial |
| 48 | variable values with the blueprint. |
| 49 | |
| 50 | |
| 51 | |
| 52 | Swapping Information: |
| 53 | |
| 54 | <what> == OI_SWAPPED: |
| 55 | 1 if <ob> is swapped, 0 else. |
| 56 | |
| 57 | <what> == OI_PROG_SWAPPED: |
| 58 | 1 if <ob>'s program is swapped, 0 else. |
| 59 | |
| 60 | <what> == OI_VAR_SWAPPED: |
| 61 | 1 if <ob>'s variables are swapped, 0 else. |
| 62 | |
| 63 | <what> == OI_SWAP_NUM: |
| 64 | The swap number for <ob>s program, or -1 if not swapped. |
| 65 | |
| 66 | |
| 67 | |
| 68 | Time Information: |
| 69 | |
| 70 | <what> == OI_NEXT_RESET_TIME: |
| 71 | Time of the next reset. |
| 72 | |
| 73 | <what> == OI_NEXT_CLEANUP_TIME: |
| 74 | Time of the next data cleanup. |
| 75 | |
| 76 | <what> == OI_LAST_REF_TIME: |
| 77 | Time of the last call to <ob>. |
| 78 | |
| 79 | |
| 80 | |
| 81 | Object List: |
| 82 | |
| 83 | <what> == OI_OBJECT_NEXT: |
| 84 | The next object in the global object list. |
| 85 | |
| 86 | <what> == OI_OBJECT_PREV: |
| 87 | The previous object in the global object list. |
| 88 | |
| 89 | <what> == OI_OBJECT_POS: |
| 90 | The position of <ob> in the global object list, |
| 91 | counting from 0 up. This can be expensive to compute. |
| 92 | |
| 93 | |
| 94 | |
| 95 | Shadows: |
| 96 | |
| 97 | <what> == OI_SHADOW_NEXT: |
| 98 | The next object in the shadow list, i.e. the object |
| 99 | that is shadowing <ob>, or 0 if <ob> is not shadowed. |
| 100 | |
| 101 | <what> == OI_SHADOW_PREV: |
| 102 | The previous object in the shadow list, i.e. the object |
| 103 | that <ob> is currently shadowing, or 0 if <ob> is not a shadow. |
| 104 | |
| 105 | <what> == OI_SHADOW_ALL: |
| 106 | Returns an array of all objects that are currently |
| 107 | shadowing <ob>, or an empty array if <ob> is not shadowed. |
| 108 | |
| 109 | |
| 110 | |
| 111 | Object Statistics: |
| 112 | |
| 113 | <what> == OI_OBJECT_REFS: |
| 114 | The number of references to <ob>. |
| 115 | |
| 116 | <what> == OI_TICKS: |
| 117 | The accumulated evaluation cost spend in <ob> modulo 1000000000. |
| 118 | |
| 119 | <what> == OI_GIGATICKS: |
| 120 | The accumulated evaluation cost spend in <ob> divided by 1000000000. |
| 121 | |
| 122 | <what> == OI_DATA_SIZE: |
| 123 | The total size of the values held in the object's variables, |
| 124 | scaled down according to the extend of data sharing. |
| 125 | |
| 126 | <what> == OI_DATA_SIZE_TOTAL: |
| 127 | The unmodified total size of the values held in the |
| 128 | object's variables |
| 129 | |
| 130 | |
| 131 | |
| 132 | Program Statistics: |
| 133 | |
| 134 | <what> == OI_PROG_REFS: |
| 135 | The number of references to <ob>'s program. |
| 136 | |
| 137 | <what> == OI_NUM_FUNCTIONS: |
| 138 | The number of functions in the program. |
| 139 | |
| 140 | <what> == OI_NUM_VARIABLES: |
| 141 | The number of variables in the program. |
| 142 | |
| 143 | <what> == OI_NUM_STRINGS: |
| 144 | The number of strings in the program. |
| 145 | |
| 146 | <what> == OI_NUM_INHERITED: |
| 147 | The number of explicitely inherited programs. |
| 148 | |
| 149 | <what> == OI_NUM_INCLUDED: |
| 150 | The number of included files in the program. |
| 151 | |
| 152 | <what> == OI_SIZE_FUNCTIONS: |
| 153 | The size needed for the function structures. |
| 154 | Note that this does not include size of the function code. |
| 155 | |
| 156 | <what> == OI_SIZE_VARIABLES: |
| 157 | The size needed for the variable structures. |
| 158 | Note that this does not include size of the variable data, |
| 159 | See OI_DATA_SIZE/OI_DATA_SIZE_TOTAL for that. |
| 160 | |
| 161 | <what> == OI_SIZE_STRINGS: |
| 162 | The size needed for the string pointers. |
| 163 | |
| 164 | <what> == OI_SIZE_STRINGS_DATA: |
| 165 | The size needed for the string values, |
| 166 | scaled down according to the extend of data sharing. |
| 167 | |
| 168 | <what> == OI_SIZE_STRINGS_DATA_TOTAL: |
| 169 | The unmodified size needed for the string values. |
| 170 | |
| 171 | <what> == OI_SIZE_INHERITED: |
| 172 | The size needed for the inherit structures. |
| 173 | |
| 174 | <what> == OI_SIZE_INCLUDED: |
| 175 | The size needed for the include structures. |
| 176 | |
| 177 | <what> == OI_PROG_SIZE: |
| 178 | The size of the program structure. |
| 179 | |
| 180 | <what> == OI_PROG_SIZE_TOTAL: |
| 181 | The total size of the program. |
| 182 | |
| 183 | |
| 184 | HISTORY |
| 185 | Introduced in LDMud 3.2.6. |
| 186 | Changes in LDMud 3.2.7: |
| 187 | - new basic result OIB_REPLACED. |
| 188 | - basic result OIB_IS_WIZARD is always 0 if set_is_wizard() |
| 189 | is not available. |
| 190 | - basic result OIB_APPROVED is gone. |
| 191 | LDMud 3.2.8 added OIM_DATA_SIZE to the result of OINFO_MEMORY. |
| 192 | LDMud 3.2.9 added the index mechanism, OIM_NUM_INCLUDES, |
| 193 | OIM_NO_INHERIT, OIM_NO_SHADOW, OIM_NO_CLONE, OIM_SIZE_STRINGS_DATA, |
| 194 | OIM_SIZE_STRINGS_TOTAL, and OIM_DATA_SIZE_TOTAL to the result |
| 195 | of OINFO_MEMORY. |
| 196 | LDMud 3.3.378 added the OIM_SHARE_VARIABLES to the result |
| 197 | of OINFO_MEMORY. |
| 198 | LDMud 3.3.654 added the OIB_NEXT_CLEANUP to the result of OINFO_BASIC. |
| 199 | LDMud 3.5.0 redesigned the whole efun. |
| 200 | |
| 201 | SEE ALSO |
| 202 | configure_object(E), interactive_info(E), driver_info(E) |