4 * vCard implementation for Citadel/UX
6 * Copyright (C) 1999 by Art Cancro
7 * This code is freely redistributable under the terms of the GNU General
8 * Public License. All other rights reserved.
18 #define CTDL_VCARD_MAGIC 0xa1f9
21 * This data structure represents a vCard object currently in memory.
36 * Constructor (empty vCard)
38 struct vCard *new_vcard() {
41 v = (struct vCard *) malloc(sizeof(struct vCard));
42 if (v == NULL) return v;
44 v->magic = CTDL_VCARD_MAGIC;
56 void free_vcard(struct vCard *v) {
59 if (v->magic != CTDL_VCARD_MAGIC) return; /* Self-check */
61 if (v->numprops) for (i=0; i<(v->numprops); ++i) {
62 free(v->prop[i].name);
63 free(v->prop[i].value);
66 if (v->prop != NULL) free(v->prop);
68 memset(v, 0, sizeof(struct vCard));