Data Structures | Typedefs | Enumerations | Functions | Variables
elem.h File Reference

Base type. More...

Data Structures

union  vtm_elem
 

Typedefs

typedef bool(* vtm_elem_cmp_fn )(union vtm_elem *e1, union vtm_elem *e2)
 

Enumerations

enum  vtm_elem_type {
  VTM_ELEM_NULL, VTM_ELEM_INT8, VTM_ELEM_UINT8, VTM_ELEM_INT16,
  VTM_ELEM_UINT16, VTM_ELEM_INT32, VTM_ELEM_UINT32, VTM_ELEM_INT64,
  VTM_ELEM_UINT64, VTM_ELEM_BOOL, VTM_ELEM_CHAR, VTM_ELEM_SCHAR,
  VTM_ELEM_UCHAR, VTM_ELEM_SHORT, VTM_ELEM_USHORT, VTM_ELEM_INT,
  VTM_ELEM_UINT, VTM_ELEM_LONG, VTM_ELEM_ULONG, VTM_ELEM_FLOAT,
  VTM_ELEM_DOUBLE, VTM_ELEM_STRING, VTM_ELEM_POINTER
}
 

Functions

VTM_API size_t vtm_elem_size (enum vtm_elem_type type)
 
VTM_API void vtm_elem_parse (enum vtm_elem_type type, union vtm_elem *dst, va_list *ap)
 
VTM_API int8_t vtm_elem_as_int8 (enum vtm_elem_type type, const union vtm_elem *src)
 
VTM_API uint8_t vtm_elem_as_uint8 (enum vtm_elem_type type, const union vtm_elem *src)
 
VTM_API int16_t vtm_elem_as_int16 (enum vtm_elem_type type, const union vtm_elem *src)
 
VTM_API uint16_t vtm_elem_as_uint16 (enum vtm_elem_type type, const union vtm_elem *src)
 
VTM_API int32_t vtm_elem_as_int32 (enum vtm_elem_type type, const union vtm_elem *src)
 
VTM_API uint32_t vtm_elem_as_uint32 (enum vtm_elem_type type, const union vtm_elem *src)
 
VTM_API int64_t vtm_elem_as_int64 (enum vtm_elem_type type, const union vtm_elem *src)
 
VTM_API uint64_t vtm_elem_as_uint64 (enum vtm_elem_type type, const union vtm_elem *src)
 
VTM_API bool vtm_elem_as_bool (enum vtm_elem_type type, const union vtm_elem *src)
 
VTM_API char vtm_elem_as_char (enum vtm_elem_type type, const union vtm_elem *src)
 
VTM_API signed char vtm_elem_as_schar (enum vtm_elem_type type, const union vtm_elem *src)
 
VTM_API unsigned char vtm_elem_as_uchar (enum vtm_elem_type type, const union vtm_elem *src)
 
VTM_API short vtm_elem_as_short (enum vtm_elem_type type, const union vtm_elem *src)
 
VTM_API unsigned short vtm_elem_as_ushort (enum vtm_elem_type type, const union vtm_elem *src)
 
VTM_API int vtm_elem_as_int (enum vtm_elem_type type, const union vtm_elem *src)
 
VTM_API unsigned int vtm_elem_as_uint (enum vtm_elem_type type, const union vtm_elem *src)
 
VTM_API long vtm_elem_as_long (enum vtm_elem_type type, const union vtm_elem *src)
 
VTM_API unsigned long vtm_elem_as_ulong (enum vtm_elem_type type, const union vtm_elem *src)
 
VTM_API float vtm_elem_as_float (enum vtm_elem_type type, const union vtm_elem *src)
 
VTM_API double vtm_elem_as_double (enum vtm_elem_type type, const union vtm_elem *src)
 
VTM_API char * vtm_elem_as_str (enum vtm_elem_type type, const union vtm_elem *src)
 
VTM_API void * vtm_elem_as_ptr (enum vtm_elem_type type, const union vtm_elem *src)
 
VTM_API vtm_elem_cmp_fn vtm_elem_get_cmp_fn (enum vtm_elem_type type)
 
VTM_API bool vtm_elem_cmp_int8 (union vtm_elem *e1, union vtm_elem *e2)
 
VTM_API bool vtm_elem_cmp_uint8 (union vtm_elem *e1, union vtm_elem *e2)
 
VTM_API bool vtm_elem_cmp_int16 (union vtm_elem *e1, union vtm_elem *e2)
 
VTM_API bool vtm_elem_cmp_uint16 (union vtm_elem *e1, union vtm_elem *e2)
 
VTM_API bool vtm_elem_cmp_int32 (union vtm_elem *e1, union vtm_elem *e2)
 
VTM_API bool vtm_elem_cmp_uint32 (union vtm_elem *e1, union vtm_elem *e2)
 
VTM_API bool vtm_elem_cmp_int64 (union vtm_elem *e1, union vtm_elem *e2)
 
VTM_API bool vtm_elem_cmp_uint64 (union vtm_elem *e1, union vtm_elem *e2)
 
VTM_API bool vtm_elem_cmp_bool (union vtm_elem *e1, union vtm_elem *e2)
 
VTM_API bool vtm_elem_cmp_char (union vtm_elem *e1, union vtm_elem *e2)
 
VTM_API bool vtm_elem_cmp_schar (union vtm_elem *e1, union vtm_elem *e2)
 
VTM_API bool vtm_elem_cmp_uchar (union vtm_elem *e1, union vtm_elem *e2)
 
VTM_API bool vtm_elem_cmp_short (union vtm_elem *e1, union vtm_elem *e2)
 
VTM_API bool vtm_elem_cmp_ushort (union vtm_elem *e1, union vtm_elem *e2)
 
VTM_API bool vtm_elem_cmp_int (union vtm_elem *e1, union vtm_elem *e2)
 
VTM_API bool vtm_elem_cmp_uint (union vtm_elem *e1, union vtm_elem *e2)
 
VTM_API bool vtm_elem_cmp_long (union vtm_elem *e1, union vtm_elem *e2)
 
VTM_API bool vtm_elem_cmp_ulong (union vtm_elem *e1, union vtm_elem *e2)
 
VTM_API bool vtm_elem_cmp_float (union vtm_elem *e1, union vtm_elem *e2)
 
VTM_API bool vtm_elem_cmp_double (union vtm_elem *e1, union vtm_elem *e2)
 
VTM_API bool vtm_elem_cmp_str (union vtm_elem *e1, union vtm_elem *e2)
 
VTM_API bool vtm_elem_cmp_strcase (union vtm_elem *e1, union vtm_elem *e2)
 
VTM_API bool vtm_elem_cmp_ptr (union vtm_elem *e1, union vtm_elem *e2)
 

Variables

const char *const VTM_ELEM_BOOL_TRUE
 
const char *const VTM_ELEM_BOOL_FALSE
 

Typedef Documentation

typedef bool(* vtm_elem_cmp_fn)(union vtm_elem *e1, union vtm_elem *e2)

Checks if the given elements are equal.

Parameters
e1the first element
e2the second element
Returns
true if e1 is equal to e2
false otherwise

Enumeration Type Documentation

Enumerator
VTM_ELEM_NULL 

special NULL value

VTM_ELEM_INT8 

signed 8 bit integer

VTM_ELEM_UINT8 

unsigned 8 bit integer

VTM_ELEM_INT16 

signed 16 bit integer

VTM_ELEM_UINT16 

unsigned 16 bit integer

VTM_ELEM_INT32 

signed 32 bit integer

VTM_ELEM_UINT32 

unsigned 32 bit integer

VTM_ELEM_INT64 

signed 64 bit integer

VTM_ELEM_UINT64 

unsigned 64 bit integer

VTM_ELEM_BOOL 

boolean value

VTM_ELEM_CHAR 

char (signed or unsigned depends on platform)

VTM_ELEM_SCHAR 

signed char

VTM_ELEM_UCHAR 

unsigned char

VTM_ELEM_SHORT 

signed short (width depends on platform)

VTM_ELEM_USHORT 

unsigned short (width depends on platform)

VTM_ELEM_INT 

signed integer (width depends on platform)

VTM_ELEM_UINT 

unsigned integer (width depends on platform)

VTM_ELEM_LONG 

signed long integer (width depends on platform)

VTM_ELEM_ULONG 

unsigned long integer (width depends on platform)

VTM_ELEM_FLOAT 

float value

VTM_ELEM_DOUBLE 

double value

VTM_ELEM_STRING 

NUL-terminated string

VTM_ELEM_POINTER 

raw pointer

Function Documentation

VTM_API size_t vtm_elem_size ( enum vtm_elem_type  type)

Gets the size of an element type.

Parameters
typethe type of element whose size should be returned
Returns
size of type in bytes
VTM_API void vtm_elem_parse ( enum vtm_elem_type  type,
union vtm_elem dst,
va_list *  ap 
)

Parses an element from variadic argument list.

Parameters
typethe type of the element that should be parsed
[out]dstparsed value
apvariadic argument list
VTM_API vtm_elem_cmp_fn vtm_elem_get_cmp_fn ( enum vtm_elem_type  type)

Gets a function pointer to the appropriate element compare function.

Parameters
typethe element type
Returns
function pointer to element compare function

Variable Documentation

const char* const VTM_ELEM_BOOL_TRUE

TRUE as string representation

const char* const VTM_ELEM_BOOL_FALSE

FALSE as string representation