Enumeration utility functions
Enumeration utility function provide run-time functions for handling enumerations defined within a schema. More...
Functions | |
EXTERNRT OSINT32 | rtxLookupEnum (const OSUTF8CHAR *strValue, size_t strValueSize, const OSEnumItem enumTable[], OSUINT16 enumTableSize) |
This function will return the numeric value for the given enumerated identifier string. | |
EXTERNRT OSINT32 | rtxLookupEnumU32 (const OSUTF8CHAR *strValue, size_t strValueSize, const OSEnumItemU32 enumTable[], OSUINT16 enumTableSize) |
This function will return the numeric value for the given enumerated identifier string. | |
EXTERNRT OSINT32 | rtxLookupBigEnum (const OSUTF8CHAR *strValue, size_t strValueSize, const OSBigEnumItem enumTable[], OSUINT16 enumTableSize) |
This function will return the numeric value for the given enumerated identifier string. | |
EXTERNRT OSINT32 | rtxLookupEnumByValue (OSINT32 value, const OSEnumItem enumTable[], size_t enumTableSize) |
Lookup enum by integer value. | |
EXTERNRT OSINT32 | rtxLookupEnumU32ByValue (OSUINT32 value, const OSEnumItemU32 enumTable[], size_t enumTableSize) |
Lookup enum by integer value (Unsiged 32-bit integer). | |
EXTERNRT OSINT32 | rtxLookupBigEnumByValue (const char *value, const OSBigEnumItem enumTable[], size_t enumTableSize) |
Lookup enum by stringified version of value. | |
EXTERNRT int | rtxTestNumericEnum (OSINT32 ivalue, const OSNumericEnumItem enumTable[], OSUINT16 enumTableSize) |
This function determines if the given numeric enumerated value is within the defined numeration set. |
Detailed Description
Enumeration utility function provide run-time functions for handling enumerations defined within a schema.
Function Documentation
EXTERNRT OSINT32 rtxLookupBigEnum | ( | const OSUTF8CHAR * | strValue, | |
size_t | strValueSize, | |||
const OSBigEnumItem | enumTable[], | |||
OSUINT16 | enumTableSize | |||
) |
This function will return the numeric value for the given enumerated identifier string.
- Parameters:
-
strValue Enumerated identifier value strValueSize Length of enumerated identifier enumTable Table containing the defined enumeration enumTableSize Number of rows in the table
- Returns:
- Index to enumerated item if found; otherwise, negative status code (RTERR_INVENUM).
EXTERNRT OSINT32 rtxLookupBigEnumByValue | ( | const char * | value, | |
const OSBigEnumItem | enumTable[], | |||
size_t | enumTableSize | |||
) |
Lookup enum by stringified version of value.
Required for ASN.1 because enumerated values do not need to be sequential.
- Parameters:
-
value String version of the enumerated item. enumTable Table containing the defined enumeration enumTableSize Number of rows in the table
- Returns:
- Index to enumerated item if found; otherwiae, negative status code (RTERR_INVENUM).
EXTERNRT OSINT32 rtxLookupEnum | ( | const OSUTF8CHAR * | strValue, | |
size_t | strValueSize, | |||
const OSEnumItem | enumTable[], | |||
OSUINT16 | enumTableSize | |||
) |
This function will return the numeric value for the given enumerated identifier string.
- Parameters:
-
strValue Enumerated identifier value strValueSize Length of enumerated identifier enumTable Table containing the defined enumeration enumTableSize Number of rows in the table
- Returns:
- Index to enumerated item if found; otherwise, negative status code (RTERR_INVENUM).
EXTERNRT OSINT32 rtxLookupEnumByValue | ( | OSINT32 | value, | |
const OSEnumItem | enumTable[], | |||
size_t | enumTableSize | |||
) |
Lookup enum by integer value.
Required for ASN.1 because enumerated values do not need to be sequential.
- Parameters:
-
value Integer value of the enumerated item. enumTable Table containing the defined enumeration enumTableSize Number of rows in the table
- Returns:
- Index to enumerated item if found; otherwiae, negative status code (RTERR_INVENUM).
EXTERNRT OSINT32 rtxLookupEnumU32 | ( | const OSUTF8CHAR * | strValue, | |
size_t | strValueSize, | |||
const OSEnumItemU32 | enumTable[], | |||
OSUINT16 | enumTableSize | |||
) |
This function will return the numeric value for the given enumerated identifier string.
- Parameters:
-
strValue Enumerated identifier value strValueSize Length of enumerated identifier enumTable Table containing the defined enumeration enumTableSize Number of rows in the table
- Returns:
- Index to enumerated item if found; otherwise, negative status code (RTERR_INVENUM).
EXTERNRT OSINT32 rtxLookupEnumU32ByValue | ( | OSUINT32 | value, | |
const OSEnumItemU32 | enumTable[], | |||
size_t | enumTableSize | |||
) |
Lookup enum by integer value (Unsiged 32-bit integer).
Required for ASN.1 because enumerated values do not need to be sequential.
- Parameters:
-
value Unsigned integer value of the enumerated item. enumTable Table containing the defined enumeration enumTableSize Number of rows in the table
- Returns:
- Index to enumerated item if found; otherwiae, negative status code (RTERR_INVENUM).
EXTERNRT int rtxTestNumericEnum | ( | OSINT32 | ivalue, | |
const OSNumericEnumItem | enumTable[], | |||
OSUINT16 | enumTableSize | |||
) |
This function determines if the given numeric enumerated value is within the defined numeration set.
- Parameters:
-
ivalue Numeric enumerated value enumTable Table containing the defined enumeration enumTableSize Number of rows in the table
- Returns:
- Zero (0) if item in table, RTERR_INVENUM if not