functions to get data type as a character string
This commit is contained in:
@ -17,10 +17,10 @@
|
||||
#define OBIFloat_NA (NAN)
|
||||
#define OBIIdx_NA (SIZE_MAX)
|
||||
|
||||
|
||||
/**
|
||||
* @brief enum for the boolean OBIType.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
FALSE = 0,
|
||||
TRUE = 1,
|
||||
@ -31,7 +31,6 @@ typedef enum {
|
||||
/**
|
||||
* @brief enum OBITypes for the data type of the OBIDMS columns.
|
||||
*/
|
||||
|
||||
typedef enum OBIType {
|
||||
OBI_VOID = 0, /**< data type not specified */
|
||||
OBI_INT, /**< a signed integer value (C type : int32_t) */
|
||||
@ -40,11 +39,13 @@ typedef enum OBIType {
|
||||
OBI_IDX /**< an index in a data structure (C type : size_t) */
|
||||
} OBIType_t, *OBIType_p;
|
||||
|
||||
|
||||
typedef int32_t obiint_t;
|
||||
typedef double obifloat_t;
|
||||
typedef char obichar_t;
|
||||
typedef size_t obiidx_t;
|
||||
|
||||
|
||||
/**
|
||||
* @brief returns the memory size in bytes of an OBIType
|
||||
*
|
||||
@ -58,6 +59,7 @@ typedef size_t obiidx_t;
|
||||
*/
|
||||
size_t obi_sizeof(OBIType_t type);
|
||||
|
||||
|
||||
/**
|
||||
* @brief returns the size requested to store an array of OBIType
|
||||
*
|
||||
@ -75,4 +77,20 @@ size_t obi_sizeof(OBIType_t type);
|
||||
*/
|
||||
size_t obi_array_sizeof(OBIType_t type, size_t nbelements, size_t nb_elements_per_line);
|
||||
|
||||
|
||||
/**
|
||||
* @brief returns the name in the form of a character string of an OBIType
|
||||
*
|
||||
*
|
||||
* @param data_type the OBIType code used as query
|
||||
*
|
||||
* @return the name of the OBIType
|
||||
* @retval NULL on error (unknown type or error allocating the memory for the character string)
|
||||
*
|
||||
* @since August 2015
|
||||
* @author Celine Mercier (celine.mercier@metabarcoding.org)
|
||||
*/
|
||||
char* name_data_type(int data_type);
|
||||
|
||||
|
||||
#endif /* OBITYPES_H_ */
|
||||
|
Reference in New Issue
Block a user