Nifty has now support for enum
s. 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 enum
s 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