add_enum_member

add a member of enum - a symbolic constant
     enum_id - id of enum
     name    - name of symbolic constant. Must be unique
               in the program.
     value   - value of symbolic constant.
     bmask   - bitmask of the constant
               ordinary enums accept only -1 as a bitmask
               all bits set in value should be set in bmask too
returns: 0-ok, otherwise error code TERR_...

long add_enum_member(long enum_id, string name, long value, long bmask);

#define TERR_OK              0 // ok
#define TERR_BAD_NAME       -3 // name is not acceptable
#define TERR_BAD_TYPE       -6 // bad type
#define TERR_BAD_VALUE     -16 // value is not acceptable
#define TERR_BAD_BMASK     -18 // Bad enum member mask. The specified mask should not intersect with any existing mask in the enum. Zero masks are prohibited too
#define TERR_BAD_MSKVAL    -19 // bad bmask and value combination

Last updated