Tobias Brunner and Thomas Egerer
0de42047a9
enum: Add functions to add and remove mappings from enum names
...
Co-authored-by: Thomas Egerer <[email protected] >
2023-02-17 13:37:38 +01:00
Tobias Brunner
19ef2aec15
Update copyright headers after acquisition by secunet
2022-06-28 10:22:56 +02:00
Tobias Brunner
d23c0ea81e
enum: Fix compiler warning
...
Closes strongswan/strongswan#1025
2022-05-02 09:31:49 +02:00
Tobias Brunner
7137fd96c2
enum: Add helper to parse enum flags from strings
...
Individual flag names are separated by |.
2022-04-14 18:42:01 +02:00
Tobias Brunner
927103ece4
enum: Allow specifying the name used when none of the flags are set
2022-04-14 18:42:01 +02:00
Tobias Brunner
1b67166921
Unify format of HSR copyright statements
2018-05-23 16:32:53 +02:00
Martin Willi
de1c492a0f
enum-names: Fail gracefully when passing a NULL value as enum names
2015-04-15 14:38:43 +02:00
Thomas Egerer
4dc72f5e57
enum: Extend printf hook to print flags
...
Signed-off-by: Thomas Egerer <[email protected] >
2015-03-03 13:41:49 +01:00
Martin Willi
064fe9c963
enum: Return boolean result for enum_from_name() lookup
...
Handling the result for enum_from_name() is difficult, as checking for
negative return values requires a cast if the enum type is unsigned. The new
signature clearly differentiates lookup result from lookup value.
Further, this actually allows to convert real -1 enum values, which could not
be distinguished from "not-found" and the -1 return value.
This also fixes several clang warnings where enums are unsigned.
2014-05-16 15:42:07 +02:00
Martin Willi
9ee8b3b41f
enum: Don't directly include enum.h
...
To allow enum.h to depend on utils.h definitions, avoid its direct inclusion.
Instead include utils.h, which includes enum.h as well.
2014-05-16 15:42:07 +02:00
Tobias Brunner
9947a1f2f4
Gracefully handle NULL as argument for enum_from_name()
2013-06-11 11:03:13 +02:00
Tobias Brunner
d5c143e5be
Moved enum_name_t to utils folder
2012-10-24 16:00:50 +02:00