OBJECT
/lib/getproperties.c
AUTHOR
Sique
LAST UPDATE
1-25-1993
SYNOPSIS
<inherit list>
...
inherit "/lib/getproperties";
...
mixed *alist;
alist = get_properties();
Or:
mixed *alist;
alist = (mixed *)call_other("/lib/getproperties","get_properties");
(equivalent to
alist = (mixed *)"/lib/getproperties"->get_properties()
)
DESCRIPTION
The function get_properties() parses the file "/sys/properties.h"
and returns an alist of all found #defines of properties.
EXAMPLES
inherit "/lib/getproperties";
...
if(assoc("P_FOO",get_properties()[0]) == -1) {
write("There is no property P_FOO predefined!\n");
}
string prop;
prop = assoc("P_FOO",get_properties());
if(function_exists("Set" + prop, testobject)) {
write("The property P_FOO is builtin in " +
object_name(testobject) + "!\n" +
"You can use Set" + prop +
"(arg) instead of SetProp(P_FOO,arg)!\n");
}
SEE ALSO
/doc/concepts/properties