]> code.citadel.org Git - citadel.git/commitdiff
* added vcard_to_html() function
authorArt Cancro <ajc@citadel.org>
Wed, 13 Feb 2002 22:04:12 +0000 (22:04 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 13 Feb 2002 22:04:12 +0000 (22:04 +0000)
citadel/ChangeLog
citadel/messages.c
citadel/vcard.c
citadel/vcard.h

index 544461cf03c38a7849b82d2c15610da5dae8fe34..58874085ce08413ccf74bc9e3790e385de08827d 100644 (file)
@@ -1,4 +1,7 @@
  $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!)
 
@@ -3334,4 +3337,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
-
index 32fe876fe7a27bfece66c66bd7a4223cb573d9ff..f7035ccc59fcd2f611423bbdf554ceaf67a30389 100644 (file)
@@ -595,7 +595,7 @@ int read_message(
                fprintf(dest, "\n");
        } else {
                scr_printf("\n");
-               scr_flush();
+               /* scr_flush(); */
                ++lines_printed;
                lines_printed = checkpagin(lines_printed, pagin, screenheight);
        }
index 6686909c8bf246b1299f11a28c021e6f384add45..c35472c5245cd529126a1bf31f3bc61dd42cfeca 100644 (file)
@@ -183,6 +183,41 @@ void vcard_free(struct vCard *v) {
 }
 
 
+/*
+ * 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
  */
index 743efa99063c2c415d8167f74239af4b74a54e31..2173085ef6234c1069430d6e2a1af53fd7b6febe 100644 (file)
@@ -31,3 +31,4 @@ 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,
                        int instance);
 char *vcard_serialize(struct vCard *);
+char *vcard_to_html(struct vCard *);