From: Wilfried Göesgens Date: Sat, 25 Apr 2009 13:30:59 +0000 (+0000) Subject: * add strbuf wrapper arround vcard parser X-Git-Tag: v7.86~1222 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=6217011fbc9d21461645ed8d3d098e0c84373dd5;p=citadel.git * add strbuf wrapper arround vcard parser --- diff --git a/libcitadel/lib/libcitadel.h b/libcitadel/lib/libcitadel.h index fe8e0d09a..eb3a5e362 100644 --- a/libcitadel/lib/libcitadel.h +++ b/libcitadel/lib/libcitadel.h @@ -391,7 +391,9 @@ struct vCard { struct vCard *vcard_new(void); void vcard_add_prop(struct vCard *v, char *propname, char *propvalue); -struct vCard *vcard_load(char *); +struct vCard *vcard_load(char *vtext); +struct vCard *VCardLoad(StrBuf *vbtext); + void vcard_free(struct vCard *); void vcard_set_prop(struct vCard *v, char *name, char *value, int append); char *vcard_get_prop(struct vCard *v, char *propname, int is_partial, diff --git a/libcitadel/lib/vcard.c b/libcitadel/lib/vcard.c index 2c8a7b65f..8acef1058 100644 --- a/libcitadel/lib/vcard.c +++ b/libcitadel/lib/vcard.c @@ -91,7 +91,12 @@ void vcard_add_prop(struct vCard *v, char *propname, char *propvalue) { v->prop[v->numprops-1].value = strdup(propvalue); } - +/* + * Constructor - returns a new struct vcard given a serialized vcard + */ +struct vCard *VCardLoad(StrBuf *vbtext) { + return vcard_load((char*)ChrPtr(vbtext)); +} /* * Constructor - returns a new struct vcard given a serialized vcard