blob: 0991f9cad1c2de44dc63311705ef8f84d9f8d34c [file] [log] [blame]
Zesstra715ec202025-07-09 22:18:31 +02001NAME
Zesstrad59c3892019-11-28 20:53:39 +01002 #include <functionlist.h>
3 #include <lpctypes.h>
MG Mud User88f12472016-06-24 23:31:02 +02004
Zesstra715ec202025-07-09 22:18:31 +02005 mixed * variable_list(object ob|lwobject, int flags)
MG Mud User88f12472016-06-24 23:31:02 +02006
Zesstra715ec202025-07-09 22:18:31 +02007DESCRIPTION
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 User88f12472016-06-24 23:31:02 +020015
Zesstra715ec202025-07-09 22:18:31 +020016 <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 User88f12472016-06-24 23:31:02 +020018
Zesstra715ec202025-07-09 22:18:31 +020019 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 User88f12472016-06-24 23:31:02 +020021
Zesstra715ec202025-07-09 22:18:31 +020022 <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 User88f12472016-06-24 23:31:02 +020026
Zesstra715ec202025-07-09 22:18:31 +020027 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 User88f12472016-06-24 23:31:02 +020033
Zesstra715ec202025-07-09 22:18:31 +020034 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 User88f12472016-06-24 23:31:02 +020041
Zesstra715ec202025-07-09 22:18:31 +020042 The 'flags' information consists of the bin-or of the list control
43 flags given above, plus the following:
MG Mud User88f12472016-06-24 23:31:02 +020044
Zesstra715ec202025-07-09 22:18:31 +020045 TYPE_MOD_VIRTUAL variable is inherited virtually
46 TYPE_MOD_NO_MASK variable is nomask
47 TYPE_MOD_PUBLIC variable is public
MG Mud User88f12472016-06-24 23:31:02 +020048
Zesstra715ec202025-07-09 22:18:31 +020049 All these flags are defined in <functionlist.h>, the
50 return types are defined in <lpctypes.h>.
MG Mud User88f12472016-06-24 23:31:02 +020051
Zesstra715ec202025-07-09 22:18:31 +020052HISTORY
53 Introduced in LDMud 3.2.10.
54 LDMud 3.6.7 introduced RETURN_FUNCTION_LPCTYPE.
55
56SEE ALSO
MG Mud User88f12472016-06-24 23:31:02 +020057 inherit_list(E), functionlist(E), variable_exists(E)