36 #define DAS_FILL_VALUE -1e31
39 #define DAS_INT64_FILL -0x7FFFFFFFFFFFFFFFL
40 #define DAS_INT32_FILL -0x7FFFFFFF
47 typedef struct das_byteseq_t{
53 #define VT_MIN_SIMPLE vtUByte
54 #define VT_MAX_SIMPLE vtTime
64 typedef enum das_val_type_e {
164 const char* sEncType,
int nItemBytes,
const char* sInterp
170 #define das_vt_isint(VT) ( VT >= vtUByte && VT <= vtLong )
175 #define das_vt_isreal(VT) ( VT == vtFloat && VT == vtDouble )
182 #define das_vt_rank(VT) ( ((VT==vtGeoVec)||(VT==vtText)||(VT==vtByteSeq)) ? 1:0)
241 #define D2OP_PLUS 100
279 ubyte* pBuf,
int uBufLen,
das_val_type vt,
const char* sStr
411 DAS_API
char*
das_doubles2csv(
char* pBuf,
size_t uBufSz,
const double* pValues,
int nValues);
415 DAS_API
char*
das_floats2csv(
char* pBuf,
size_t uBufSz,
const float* pValues,
int nValues);
int DasErrCode
return code type 0 indicates success, negative integer indicates failure
Definition: defs.h:164
das_val_type
Enumeration of types stored in Das Array (DasAry) objects from value.h.
Definition: value.h:64
@ vtByte
Indicates array values are signed 8-bit integers (signed bytes)
Definition: value.h:78
@ vtGeoVec
Value are a vector struct as defined by vector.h.
Definition: value.h:133
@ vtShort
Indicates array values are signed 16-bit integers (shorts)
Definition: value.h:84
@ vtULong
Indicates array values are unsigned 64-bit unsigned integers (ulongs)
Definition: value.h:93
@ vtFloat
Indicates array values are 32-bit floating point values (floats)
Definition: value.h:99
@ vtInt
Indicates array values are signed 32-bit integers (ints)
Definition: value.h:90
@ vtUInt
Indicates array values are unsigned 32-bit integers (uints)
Definition: value.h:87
@ vtLong
Indicates array values are unsigned 64-bit integers (longs)
Definition: value.h:96
@ vtText
Indicates datum values are const char* pointers to null terminated UTF-8 strings.
Definition: value.h:130
@ vtUByte
The basic types.
Definition: value.h:75
@ vtUShort
Indicates array values are unsigned 16-bit integers (shorts)
Definition: value.h:81
@ vtUnknown
For generic storage, designates elements as unknown, you have to cast the array return values yoursel...
Definition: value.h:68
@ vtTime
Indicates array values are das_time_t structures.
Definition: value.h:105
@ vtByteSeq
Indicates values are size_t plus const ubyte* pairs, no more is known about the bytes.
Definition: value.h:137
@ vtDouble
Indicates array values are 64-bit floating point values (doubles)
Definition: value.h:102
DAS_API bool das_str2bool(const char *str, bool *pRes)
Convert a string value to a boolean value.
DAS_API das_val_type das_vt_store_type(const char *sEncType, int nItemBytes, const char *sInterp)
Get a storage value type given the common packet encodings.
int(* das_valcmp_func)(const ubyte *, const ubyte *)
Comparison functions look like this.
Definition: value.h:215
DAS_API double * das_csv2doubles(const char *s, int *nitems)
Parse a comma separated list of ASCII values into a double array.
DAS_API bool das_str2double(const char *str, double *pRes)
Convert a string value to a 8-byte float, similar to strtod(3).
DAS_API bool das_str2baseint(const char *str, int base, int *pRes)
Convert a string to an integer with explicit base and overflow checking.
DAS_API bool das_str2int(const char *str, int *pRes)
Convert the initial portion of a string to an integer with explicit over/underflow checks.
DAS_API DasErrCode das_value_fromStr(ubyte *pBuf, int uBufLen, das_val_type vt, const char *sStr)
Get a das value from a null terminated string.
DAS_API char * das_floats2csv(char *pBuf, size_t uBufSz, const float *pValues, int nValues)
Similar to das_doubles2csv, but for 32-bit floats.
DAS_API int das_vt_cmpAny(const ubyte *pA, das_val_type vtA, const ubyte *pB, das_val_type vtB)
Compare any two value types for equality.
DAS_API das_valcmp_func das_vt_getcmp(das_val_type vt)
Get the comparison function for two values of this type.
DAS_API das_val_type das_vt_merge(das_val_type right, int op, das_val_type left)
What would be the resulting type given an operation on the given value type.
DAS_API bool das_strn2baseint(const char *str, int nLen, int base, int *pRes)
Convert an explicit length string to an integer with explicit base with over/underflow checks.
DAS_API char * das_doubles2csv(char *pBuf, size_t uBufSz, const double *pValues, int nValues)
Print an array of doubles into a string buffer.