-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathatnd.h
59 lines (47 loc) · 1.2 KB
/
atnd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/************************************************************
* Class to help with printing out attendees.
*/
#ifndef ATND_H
#define ATND_H
typedef struct _ATND {
enum {
ATND_REQD_FLG=1<<0
} flags;
char name[64],
email[128];
} ATND;
#ifdef __cplusplus
extern "C"
{
#endif
#define ATND_create(p, initMaxItems) \
((p)=(ATND_constructor((p)=malloc(sizeof(ATND)), initMaxItems) ? (p) : ( p ? realloc(ATND_destructor(p),0) : 0 )))
ATND*
ATND_constructor (ATND * self, const char *src);
/***********************************************
* Construct a ATND.
*
* src is the string with attendee information.
* returns - pointer to the object, or NULL for failure.
*/
void*
ATND_destructor (ATND * self);
/***********************************************
* Destruct a ATND.
*/
int
ATND_report(ATND *self, FILE *fh);
/***********************************************
* Print out Attendee information for report
*/
int
ATND_ptrvec_cmp(const void *const* pp1, const void *const* pp2);
/***********************************************
* Comparision function for PTRVEC_sort()
*/
#define ATND_destroy(p) \
do {if(ATND_destructor(p)) {free(p); p= NULL;}} while(0)
#ifdef __cplusplus
}
#endif
#endif