hl7parse
address.h
Go to the documentation of this file.
1 
32 #ifndef ADDRESS_H
33 #define ADDRESS_H
34 
49 typedef struct hl7_addr_t {
51  char* segment;
53  int fieldlist;
55  int field;
57  int comp;
59  int subcmp;
61  int seg_count;
62 } hl7_addr_t;
63 
77 typedef struct seg_count {
79  unsigned int length;
81  unsigned int _allocated;
83  char** segments;
85  int* count;
86 } seg_count_t;
87 
88 
89 #ifdef __cplusplus
90 extern "C" {
91 #endif
92 
93 
102 
111 
121 hl7_addr_t* addr_from_string(char* str);
122 
150 int set_addr_from_string(char* str, hl7_addr_t **ret_addr);
151 
160 char* addr_to_string(hl7_addr_t* addr);
161 
166 void free_addr(hl7_addr_t* addr);
167 
175 void addr_dump(hl7_addr_t* addr);
176 
186 
193 
199 void free_seg_count(seg_count_t* segc);
200 
213 int add_seg_count(char* segment, seg_count_t* segc);
214 
224 int get_seg_count(char* segment, seg_count_t* segc);
225 
226 #ifdef __cplusplus
227 }
228 #endif
229 
230 #endif // ADDRESS_H
int set_addr_from_string(char *str, hl7_addr_t **ret_addr)
set address by string
Definition: address.c:33
int subcmp
Definition: address.h:59
int seg_count
Definition: address.h:61
void addr_dump(hl7_addr_t *addr)
dispaly address
Definition: address.c:304
seg_count_t * create_seg_count()
Create segment struct.
Definition: address.c:332
int fieldlist
Definition: address.h:53
hl7_addr_t * addr_from_string(char *str)
parse string adresss
Definition: address.c:246
void free_seg_count(seg_count_t *segc)
free segment count struct
Definition: address.c:343
int add_seg_count(char *segment, seg_count_t *segc)
increment count for segment
Definition: address.c:352
int get_seg_count(char *segment, seg_count_t *segc)
get count for segment name
Definition: address.c:388
unsigned int _allocated
Definition: address.h:81
hl7_addr_t * reset_addr(hl7_addr_t *addr)
reset to default values
Definition: address.c:9
hl7 element address
Definition: address.h:49
int comp
Definition: address.h:57
keep track of the number of the same segments in a message_t
Definition: address.h:77
int field
Definition: address.h:55
hl7_addr_t * create_addr()
create address structure
Definition: address.c:19
struct hl7_addr_t hl7_addr_t
hl7 element address
hl7_addr_t * clone_addr(hl7_addr_t *addr)
clone an address
Definition: address.c:321
int * count
Definition: address.h:85
char ** segments
Definition: address.h:83
unsigned int length
Definition: address.h:79
char * addr_to_string(hl7_addr_t *addr)
create a string representation of the address
Definition: address.c:256
char * segment
Definition: address.h:51
void free_addr(hl7_addr_t *addr)
free hl7_addr_t struct
Definition: address.c:24
struct seg_count seg_count_t
keep track of the number of the same segments in a message_t