hl7parse
|
hl7 utilitiy functions More...
Go to the source code of this file.
Macros | |
#define | SIZE_T_L "%ld" |
#define | MARKER_T "\u251C" |
#define | MARKER_L "\u2514" |
#define | MARKER_D "\u2500" |
Functions | |
void * | memdup (void *src, size_t length) |
copy a chunck of memory More... | |
void | dump_structure (message_t *message) |
print a parsed HL7 structure More... | |
char * | trim (char *str) |
trim white space at the beginnign and end of a string More... | |
char * | escape (char *str, char *quote_char, char escape_char) |
escape a character in a string More... | |
hl7 utilitiy functions
#define MARKER_D "\u2500" |
console marker for none
#define MARKER_L "\u2514" |
console marker for leaf
#define MARKER_T "\u251C" |
console marker for node
#define SIZE_T_L "%ld" |
unix long int
void dump_structure | ( | message_t * | message | ) |
print a parsed HL7 structure
debug function, used by 7parse to display an ASCII tree of the file content.
message | the message to print |
char* escape | ( | char * | str, |
char * | quote_char, | ||
char | escape_char | ||
) |
escape a character in a string
This function will allcoate a new string with all occourances of quote_char prepended with escape_char.
You must take care of freeing the result!
str | string to escape |
quote_char | the character to find and escape |
escape_char | the character to prepend in front of quote char |
void* memdup | ( | void * | src, |
size_t | length | ||
) |
copy a chunck of memory
Will allocate memory for you, you are in charge to free it later.
src | byte array to copy |
length | length of input array |
char* trim | ( | char * | str | ) |
trim white space at the beginnign and end of a string
[out] | str | to string |