OC Updated for version 2.0
Functions
OCtype Management

Functions

size_t oc_typesize (OCtype etype)
const char * oc_typetostring (OCtype octype)
OCerror oc_typeprint (OCtype etype, void *value, size_t bufsize, char *buffer)

Function Documentation

OCerror oc_typeprint ( OCtype  etype,
void *  value,
size_t  bufsize,
char *  buffer 
)

Print a value of an atomic type instance. This is primarily for debugging and provides a simple way to convert a value to a printable string.

Parameters:
[in]etypeThe OCtype atomic type.
[in]valueA pointer to the value to be printed.
[in]bufsizeThe size of the buffer argument
[in]bufferThe buffer into which to store the printable value as a NULL terminated string.
Return values:
OC_NOERRif the procedure succeeded
OtherErrorif one of the arguments is illegal.

Definition at line 1356 of file oc.c.

size_t oc_typesize ( OCtype  etype)

Return the size of the C data structure corresponding to a given atomic type. For example, oc_typesize(OC_Int32) == sizeof(int), and oc_typesize(OC_String) == sizeof(char*). Non-atomic types (e.g. OC_Structure) return zero.

Parameters:
[in]etypeThe atomic type.
Returns:
The C size of the atomic type.

Definition at line 1316 of file oc.c.

const char* oc_typetostring ( OCtype  octype)

Return a string corresponding to the to a given OCtype. For example, oc_typetostring(OC_Int32) == "Int32" and oc_typesize(OC_Structure) == "Structure". The caller MUST NOT free the returned string.

Parameters:
[in]octypeThe OCtype value.
Returns:
The name, as a string, of that OCtype value.

Definition at line 1335 of file oc.c.