hl7parse
util.h
Go to the documentation of this file.
1 
4 #ifndef UTIL_H
5 #define UTIL_H
6 
7 #include <stddef.h>
8 #include <string.h>
9 
10 #include "node.h"
11 
12 #ifdef _WIN32
13 
14  #define SIZE_T_L "%lld"
15 #else
16 
17  #define SIZE_T_L "%ld"
18 #endif
19 
20 // ascii for window's CMD.EXE
21 #ifdef _WIN32
22 
23  #define MARKER_T "\xC3"
24 
25  #define MARKER_L "\xC0"
26 
27  #define MARKER_D "\xC4"
28 #else // UTF-8 for the rest
29 
30  #define MARKER_T "\u251C"
31 
32  #define MARKER_L "\u2514"
33 
34  #define MARKER_D "\u2500"
35 #endif
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
50 void *memdup(void* src, size_t length);
51 
59 void dump_structure(message_t *message);
60 
73 char *trim(char *str);
74 
88 char *escape(char *str, char *quote_char, char escape_char);
89 
90 #ifdef __cplusplus
91 }
92 #endif
93 
94 #endif // UTIL_H
char * escape(char *str, char *quote_char, char escape_char)
escape a character in a string
Definition: util.c:111
Main datastructures for HL7 nodes and messages This file contains the main parser data structures and...
char * trim(char *str)
trim white space at the beginnign and end of a string
Definition: util.c:14
void * memdup(void *src, size_t length)
copy a chunck of memory
Definition: util.c:8
Definition: node.h:244
void dump_structure(message_t *message)
print a parsed HL7 structure
Definition: util.c:36