43 #if defined __linux || defined __APPLE__
47 #elif defined __APPLE__
48 #include <machine/endian.h>
51 #if __BYTE_ORDER == __LITTLE_ENDIAN
52 #define HOST_IS_LSB_FIRST
54 #undef HOST_IS_LSB_FIRST
61 #include <sys/isa_defs.h>
63 #define HOST_IS_LSB_FIRST
65 #undef HOST_IS_LSB_FIRST
75 #define HOST_IS_LSB_FIRST
79 #error "unknown byte order!"
100 #define DAS_22_STREAM_VER "2.2"
123 #define DASERR_DIS_EXIT 0
126 #define DASERR_DIS_RET 1
129 #define DASERR_DIS_ABORT 43
199 const char* sProgName,
int nErrDis,
int nErrBufSz,
int nLevel,
203 DasErrCode das_error_func(
204 const char* sFile,
const char* sFunc,
int nLine, DasErrCode nCode,
205 const char* sFmt, ...
208 DasErrCode das_error_func_fixed(
209 const char* sFile,
const char* sFunc,
int nLine, DasErrCode nCode,
213 #define DASERR_NOTIMP 8
214 #define DASERR_ASSERT 9
215 #define DASERR_INIT 11
216 #define DASERR_BUF 12
217 #define DASERR_UTIL 13
218 #define DASERR_ENC 14
219 #define DASERR_UNITS 15
220 #define DASERR_DESC 16
221 #define DASERR_PLANE 17
222 #define DASERR_PKT 18
223 #define DASERR_STREAM 19
224 #define DASERR_OOB 20
226 #define DASERR_DSDF 23
227 #define DASERR_DFT 24
228 #define DASERR_LOG 25
229 #define DASERR_ARRAY 26
230 #define DASERR_VAR 27
231 #define DASERR_DIM 28
233 #define DASERR_BLDR 30
234 #define DASERR_HTTP 31
235 #define DASERR_DATUM 32
236 #define DASERR_VALUE 33
238 #define DASERR_CRED 35
239 #define DASERR_NODE 36
291 #define das_error(nErrCode, ...) \
292 das_error_func(__FILE__, __func__, __LINE__, nErrCode, __VA_ARGS__ )
348 typedef struct das_error_message {
376 #define das_within(A, B, E) (fabs(A - B) < E ? true : false)
379 #define DAS_XML_MAXPROPS 400
382 #define DAS_XML_BUF_LEN 1000000
385 #define DAS_XML_NODE_NAME_LEN 256
415 void das_store_str(
char** psDest,
size_t* puLen,
const char* sSrc);
489 const char* sPath,
char ppDirList[][256],
size_t uMaxDirs,
char cType
void das_return_on_error(void)
Error handling: Normal Return Set the library to return normally to the calling function with a retur...
bool das_isdir(const char *path)
Is the path a directory.
char * das_vstring(const char *fmt, va_list ap)
Store a formatted string in a newly allocated buffer.
const char * das_lib_version(void)
Get the library version.
int DasErrCode
return code type 0 indicates success, negative integer indicates failure
Definition: util.h:117
int das_error_disposition(void)
Error handling: get the library's error disposition.
void das_error_free(das_error_msg *pMsg)
Free an error message structure allocated on the heap.
bool das_isfile(const char *path)
Is the path a file.
void das_store_str(char **psDest, size_t *puLen, const char *sSrc)
Store string in a buffer that is reallocated if need be.
void(* das_log_handler_t)(int nLevel, const char *sMsg, bool bPrnTime)
Definition of a message handler function pointer.
Definition: util.h:143
int das_dirlist(const char *sPath, char ppDirList[][256], size_t uMaxDirs, char cType)
Get a sorted directory listing.
Structure returned from das_get_error().
Definition: util.h:348
void das_init(const char *sProgName, int nErrDis, int nErrBufSz, int nLevel, das_log_handler_t logfunc)
Initialize any global structures in the Das2 library.
char * das_strdup(const char *sIn)
Copy a string into a new buffer allocated on the heap.
char * das_string(const char *fmt,...)
Allocate a new string on the heap and format it.
bool das_save_error(int maxmsg)
Error handling: Save formatted error in a message buffer.
void das_print_error(void)
Error handling: Print formatted error to standard error stream Set the library to ouput formatted err...
bool das_assert_valid_id(const char *sId)
Check that a string is suitable for use as an object ID.
void das_exit_on_error(void)
Error handling: Normal Exit Set the library to call exit(ErrorCode) when a problem is detected...
void das_abort_on_error(void)
Error handling: Trigger Core Dumps.
das_error_msg * das_get_error(void)
Return the saved das2 error message buffer.