# 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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hex-rays.com/9.0sp1/developer-guide/idc/idc-api-reference/alphabetical-list-of-idc-functions/739.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
