$Log$
+ Revision 590.111 2002/02/13 22:04:11 ajc
+ * added vcard_to_html() function
+
Revision 590.110 2002/02/13 15:48:55 ajc
* Allow the READ command to return packets bigger than 1 byte. (ooops!)
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
}
+/*
+ * Experimental output type of thing
+ */
+char *vcard_to_html(struct vCard *v) {
+ char *html = NULL;
+ int i;
+ size_t len = 256;
+
+ if (v == NULL) return NULL;
+
+ if (v->numprops) for (i=0; i<(v->numprops); ++i) {
+ len += strlen(v->prop[i].name);
+ len += strlen(v->prop[i].value);
+ }
+
+ html = mallok(len);
+ if (html == NULL) return NULL;
+
+ sprintf(html, "<TABLE bgcolor=#888888>");
+ if (v->numprops) for (i=0; i<(v->numprops); ++i) {
+ sprintf(&html[strlen(html),
+ "<TR><TD>%s</TD><TD>%s</TD></TR>\n",
+ v->prop[i].name,
+ v->prop[i].value
+ );
+ }
+
+ strcat(html, "</TABLE>");
+
+ return(html);
+}
+
+
+
+
/*
* Set a name/value pair in the card
*/
char *vcard_get_prop(struct vCard *v, char *propname, int is_partial,
int instance);
char *vcard_serialize(struct vCard *);
+char *vcard_to_html(struct vCard *);