# add\_struc

define a new structure type index - index of new structure type If another structure has the specified index, then index of that structure and all other structures will be increment freeing the specified index. If index is == -1, then the biggest index number will be used. See [get\_first\_struc\_idx](https://docs.hex-rays.com/8.4/developer-guide/idc/idc-api-reference/alphabetical-list-of-idc-functions/371)() for the explanation of structure indices and IDs.

```
     name     - name of the new structure type.

     is_union - 0: structure
                1: union
```

returns: -1 if can't define structure type because of bad structure name: the name is ill-formed or is already used in the program. otherwise returns ID of the new structure type

long add\_struc(long index, string name, long is\_union);
