blob: 82c6093e48961dd956f6552cda65c6312658df27 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
2 #include <struct_info.h>
3 #include <lpctypes.h>
4
Zesstra715ec202025-07-09 22:18:31 +02005 mixed * struct_info(struct st, int what)
MG Mud User88f12472016-06-24 23:31:02 +02006
7DESCRIPTION
8 Return information about the structure of struct <st> in an array.
9 If <st> has a base struct, <what> determines how the information
10 is returned:
11
12 <what> == SINFO_FLAT:
13 All members of <st>, including those inherited from the base
14 struct, are returned on the top level of the result.
15 The base struct is signified by just its name.
16
17 <what> == SINFO_NESTED:
18 Only the members defined in <st> itself are returned on
19 the top level of the result. The information for the base
20 struct is a array by itself, as it would be returned
21 by a call to struct_info() for a base struct instance.
22
23 The elements in the resulting array are:
24
25 string [SI_NAME]: the name of the struct
26 string [SI_PROG_NAME]: the name of program defining the struct
27 string [SI_PROG_ID]: the id of the program defining the struct
28 mixed [SI_BASE]: 0, or the base struct information
Zesstra715ec202025-07-09 22:18:31 +020029 mixed *[SI_MEMBER+0]: the first member information
30 mixed *[SI_MEMBER+n]: the last member information
MG Mud User88f12472016-06-24 23:31:02 +020031
32 The member information entries are arrays themselves with
33 these elements:
34
35 string [SIM_NAME]: name of the member
36 int [SIM_TYPE]: the type of the member (compile-time value)
37 string [SIM_EXTRA]: 0, or if the member is a struct, the
38 struct name
39
40HISTORY
41 Introduced in LDMud 3.3.344.
42 LDMud 3.3.417 introduced SI_PROG_NAME and SI_PROG_ID in exchange
43 for SI_UNIQUE_NAME.
44
45SEE ALSO
46 structs(LPC)