Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 1 | NAME |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 2 | #include <functionlist.h> |
| 3 | #include <lpctypes.h> |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 4 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 5 | mixed * variable_list(object ob|lwobject, int flags) |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 6 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 7 | DESCRIPTION |
| 8 | Return an array with information about <ob>s variables. For |
| 9 | every variable, 1 to 3 values (depending on <flags>) are |
| 10 | stored in the result array conveying in this order: |
| 11 | - the name of the variable |
| 12 | - the variable flags (see below) |
| 13 | - the return type (listed in <lpctypes.h>) |
| 14 | - the value of the variable |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 15 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 16 | <ob> may be given as true object or as a filename. In the latter |
| 17 | case, the efun does not try to load the object before proceeding. |
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 | If <ob> is not the current object and the value of the variable is |
| 20 | requested, a privilege_violation ("variable_list", <ob>) occurs. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 21 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 22 | <flags> determines both which information is returned for every |
| 23 | variable, and which variables should be considered at all. |
| 24 | Its value is created by bin-or'ing together following flags from |
| 25 | <functionlist.h>: |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 26 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 27 | Control of returned information: |
| 28 | RETURN_FUNCTION_NAME include the variable name |
| 29 | RETURN_FUNCTION_FLAGS include the variable flags |
| 30 | RETURN_FUNCTION_TYPE include the variable type as an integer |
| 31 | RETURN_FUNCTION_LPCTYPE include the variable type as an lpctype |
| 32 | RETURN_VARIABLE_VALUE include the variable value |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 33 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 34 | Control of listed variables: |
| 35 | NAME_INHERITED don't list if defined by inheritance |
| 36 | TYPE_MOD_STATIC == |
| 37 | TYPE_MOD_NOSAVE don't list if nosave ('static') variable |
| 38 | TYPE_MOD_PRIVATE don't list if private |
| 39 | TYPE_MOD_PROTECTED don't list if protected |
| 40 | NAME_HIDDEN don't list if not visible through inheritance |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 41 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 42 | The 'flags' information consists of the bin-or of the list control |
| 43 | flags given above, plus the following: |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 44 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 45 | TYPE_MOD_VIRTUAL variable is inherited virtually |
| 46 | TYPE_MOD_NO_MASK variable is nomask |
| 47 | TYPE_MOD_PUBLIC variable is public |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 48 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 49 | All these flags are defined in <functionlist.h>, the |
| 50 | return types are defined in <lpctypes.h>. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 51 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 52 | HISTORY |
| 53 | Introduced in LDMud 3.2.10. |
| 54 | LDMud 3.6.7 introduced RETURN_FUNCTION_LPCTYPE. |
| 55 | |
| 56 | SEE ALSO |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 57 | inherit_list(E), functionlist(E), variable_exists(E) |