Macaw OS C reference

Function entityclassfield

#include <macawlevel.h>
int entityclassfield(
    int classes,
    const char *name,
    int k,
    char *fname,
    int fsize,
    char *type,
    int tsize,
    char *def,
    int dsize
);

Gives one of a class's fields: its name, its type and its default, each as text.

Parameters

classesint
A set of classes from entityclasses, or a level's number.
nameconst char *
The class's name.
kint
Which field, from 0.
fnamechar *
Where the field's name goes, a char array.
fsizeint
How many bytes fname holds.
typechar *
Where its type goes: "number", "text", "bool", "choice", "colour" or "angle".
tsizeint
How many bytes type holds.
defchar *
Where its default goes, as text (true or false as "true" or "false").
dsizeint
How many bytes def holds.

Returns int

1 if there's a k'th field, or 0 if not.

In Kinds of entity, with entityclasses, entityclasscount, entityclassname, entityclassinfo, entityclassfieldcount.