Open SCAP Library
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions | Data Fields
oscap_string_map Struct Reference

Detailed Description

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
 

Member Function Documentation

const char * oscap_enum_to_string ( const struct oscap_string_map map,
int  val 
)

Convert an enumeration constant to its corresponding string representation.

Parameters
mapAn array of oscap_string_map structures that defines mapping between constants and strings.
valvalue to be converted
int oscap_string_to_enum ( const struct oscap_string_map map,
const char *  str 
)

Convert a string to an enumeration constant.

Parameters
mapAn array of oscap_string_map structures that defines mapping between constants and strings.
strstring to be converted

The documentation for this struct was generated from the following file: