Open SCAP Library
|
Define mapping between symbolic constant and its string representation.
It is supposed to define array of these structures, ending with element with the string member set to NULL. Value of such member also defines the default value for strings not defined elsewhere.
#include <util.h>
Public Member Functions | |
int | oscap_string_to_enum (const struct oscap_string_map *map, const char *str) |
Convert a string to an enumeration constant. More... | |
const char * | oscap_enum_to_string (const struct oscap_string_map *map, int val) |
Convert an enumeration constant to its corresponding string representation. More... | |
Data Fields | |
const int | value |
const char * | string |
const char * oscap_enum_to_string | ( | const struct oscap_string_map * | map, |
int | val | ||
) |
Convert an enumeration constant to its corresponding string representation.
map | An array of oscap_string_map structures that defines mapping between constants and strings. |
val | value to be converted |
int oscap_string_to_enum | ( | const struct oscap_string_map * | map, |
const char * | str | ||
) |
Convert a string to an enumeration constant.
map | An array of oscap_string_map structures that defines mapping between constants and strings. |
str | string to be converted |