From 6217011fbc9d21461645ed8d3d098e0c84373dd5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Sat, 25 Apr 2009 13:30:59 +0000 Subject: [PATCH] * add strbuf wrapper arround vcard parser --- libcitadel/lib/libcitadel.h | 4 +++- libcitadel/lib/vcard.c | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) 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 -- 2.39.2