XBinder  Version 2.9.x
Functions
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. More...
 
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. More...
 
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. More...
 
EXTERNRT OSINT32 rtxLookupEnumByValue (OSINT32 value, const OSEnumItem enumTable[], size_t enumTableSize)
 Lookup enum by integer value. More...
 
EXTERNRT OSINT32 rtxLookupEnumU32ByValue (OSUINT32 value, const OSEnumItemU32 enumTable[], size_t enumTableSize)
 Lookup enum by integer value (Unsiged 32-bit integer). More...
 
EXTERNRT OSINT32 rtxLookupBigEnumByValue (const char *value, const OSBigEnumItem enumTable[], size_t enumTableSize)
 Lookup enum by stringified version of value. More...
 
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. More...
 

Detailed Description

Enumeration utility function provide run-time functions for handling enumerations defined within a schema.

Function Documentation

◆ rtxLookupBigEnum()

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
strValueEnumerated identifier value
strValueSizeLength of enumerated identifier
enumTableTable containing the defined enumeration
enumTableSizeNumber of rows in the table
Returns
Index to enumerated item if found; otherwise, negative status code (RTERR_INVENUM).

◆ rtxLookupBigEnumByValue()

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
valueString version of the enumerated item.
enumTableTable containing the defined enumeration
enumTableSizeNumber of rows in the table
Returns
Index to enumerated item if found; otherwiae, negative status code (RTERR_INVENUM).

◆ rtxLookupEnum()

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
strValueEnumerated identifier value
strValueSizeLength of enumerated identifier
enumTableTable containing the defined enumeration
enumTableSizeNumber of rows in the table
Returns
Index to enumerated item if found; otherwise, negative status code (RTERR_INVENUM).

◆ rtxLookupEnumByValue()

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
valueInteger value of the enumerated item.
enumTableTable containing the defined enumeration
enumTableSizeNumber of rows in the table
Returns
Index to enumerated item if found; otherwiae, negative status code (RTERR_INVENUM).

◆ rtxLookupEnumU32()

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
strValueEnumerated identifier value
strValueSizeLength of enumerated identifier
enumTableTable containing the defined enumeration
enumTableSizeNumber of rows in the table
Returns
Index to enumerated item if found; otherwise, negative status code (RTERR_INVENUM).

◆ rtxLookupEnumU32ByValue()

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
valueUnsigned integer value of the enumerated item.
enumTableTable containing the defined enumeration
enumTableSizeNumber of rows in the table
Returns
Index to enumerated item if found; otherwiae, negative status code (RTERR_INVENUM).

◆ rtxTestNumericEnum()

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
ivalueNumeric enumerated value
enumTableTable containing the defined enumeration
enumTableSizeNumber of rows in the table
Returns
Zero (0) if item in table, RTERR_INVENUM if not