Nifty bio photo

Nifty

Nifty - NIF interface generator

Github

Nifty has now support for enums. Lets wrap the following code into the module my_module:

enum my_enum {
        A_VALUE,
        ANOTHER_VALUE = 100
};

void function_using_an_enum(enum my_enum parameter);

Now we can call the function using enums as following:

> my_module:function_using_an_enum(0).
ok
> nifty:enum_value(my_module, "ANOTHER_VALUE")
100
> my_module:function_using_an_enum(nifty:enum_value(my_module, "A_VALUE")).
ok