libdas2
das2 core C utilities
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Typedefs | Enumerations | Functions
value.h File Reference

A generic value type for use in arrays, datums and variables. More...

Detailed Description

A generic value type for use in arrays, datums and variables.

#include <stdint.h>

Go to the source code of this file.

Macros

#define DAS_FILL_VALUE   -1e31
 Canonical fill value (.
 
#define DAS_INT64_FILL   -0x7FFFFFFFFFFFFFFFL
 Conversion fill value for integer time intervals (-9.223e+18)
 

Typedefs

typedef int(* das_valcmp_func )(const void *, const void *)
 Comparison functions look like this.
 

Enumerations

enum  das_val_type {
  vtUnknown = 0 , vtByte, vtUShort, vtShort,
  vtInt, vtLong, vtFloat, vtDouble,
  vtTime, vtText, vtByteSeq
}
 Enumeration of types stored in Das Array (DasAry) objects Not that any kind of value may be stored in a Das Array, but most of these types have runtime type safty checks. More...
 

Functions

const void * das_vt_fill (das_val_type vt)
 Get the default fill value for a given element type. More...
 
size_t das_vt_size (das_val_type vt)
 Get the size in bytes for a given element type.
 
const char * das_vt_toStr (das_val_type vt)
 Get a text string representation of an element type.
 
das_valcmp_func das_vt_getcmp (das_val_type vt)
 Get the comparison function for two values of this type.
 
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. More...
 
bool das_str2double (const char *str, double *pRes)
 Convert a string value to a 8-byte float, similar to strtod(3). More...
 
bool das_str2int (const char *str, int *pRes)
 Convert the initial portion of a string to an integer with explicit over/underflow checks. More...
 
bool das_str2bool (const char *str, bool *pRes)
 Convert a string value to a boolean value. More...
 
bool das_str2baseint (const char *str, int base, int *pRes)
 Convert a string to an integer with explicit base and overflow checking. More...
 
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. More...
 
double * das_csv2doubles (const char *s, int *nitems)
 Parse a comma separated list of ASCII values into a double array. More...
 
char * das_doubles2csv (char *buf, const double *value, int nitems)
 Print an array of doubles into a string buffer. More...