Fix lots of warnings all over the place, make inbound buffers of FMOUT const.
[citadel.git] / webcit / vcard_edit.c
index f5c6ebb20acc31327bd803f6b374be910b5cc9d5..ca76ec3746ec167b675289b6b07e8a8c1b49a04e 100644 (file)
@@ -1,3 +1,20 @@
+/*
+ * Copyright (c) 1996-2011 by the citadel.org team
+ *
+ * This program is open source software.  You can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
 
 #include "webcit.h"
 #include "webserver.h"
@@ -488,7 +505,7 @@ void display_parsed_vcard(StrBuf *Target, struct vCard *v, int full, wc_mime_att
                if (pass == 1) {
                        StrBufAppendPrintf(Target, "<tr bgcolor=\"#aaaaaa\">"
       "<td colspan=2 bgcolor=\"#ffffff\">"
-      "<img align=\"center\" src=\"static/viewcontacts_48x.gif\">"
+      "<img align=\"center\" src=\"static/webcit_icons/essen/32x32/contact.png\">"
       "<font size=\"+1\"><b>");
                        StrEscAppend(Target, NULL, fullname, 0, 0);
                        StrBufAppendPrintf(Target, "</b></font>");
@@ -544,36 +561,31 @@ void parse_vcard(StrBuf *Target, struct vCard *v, HashList *VC, int full, wc_mim
        StrBuf *Swap = NULL;
        int i, j;
        char buf[SIZ];
-       char *name;
        int is_qp = 0;
        int is_b64 = 0;
        StrBuf *thisname = NULL;
-       char *thisvalue = NULL;
        char firsttoken[SIZ];
-       int pass;
-       long len;
        void *V;
 
        Swap = NewStrBuf ();
        thisname = NewStrBuf();
        for (i=0; i<(v->numprops); ++i) {
-               int len;
                is_qp = 0;
                is_b64 = 0;
                StrBufPlain(thisname, v->prop[i].name, -1);
                StrBufLowerCase(thisname);
                
-               len = extract_token(firsttoken, thisname, 0, ';', sizeof firsttoken);
+               /*len = */extract_token(firsttoken, ChrPtr(thisname), 0, ';', sizeof firsttoken);
                
-               for (j=0; j<num_tokens(thisname, ';'); ++j) {
-                       extract_token(buf, thisname, j, ';', sizeof buf);
+               for (j=0; j<num_tokens(ChrPtr(thisname), ';'); ++j) {
+                       extract_token(buf, ChrPtr(thisname), j, ';', sizeof buf);
                        if (!strcasecmp(buf, "encoding=quoted-printable")) {
                                is_qp = 1;
-                               remove_token(thisname, j, ';');
+/*                             remove_token(thisname, j, ';');*/
                        }
                        if (!strcasecmp(buf, "encoding=base64")) {
                                is_b64 = 1;
-                               remove_token(thisname, j, ';');
+/*                             remove_token(thisname, j, ';');*/
                        }
                }
                
@@ -593,7 +605,7 @@ void parse_vcard(StrBuf *Target, struct vCard *v, HashList *VC, int full, wc_mim
                        StrBufDecodeBase64(Val);
 
                }
-               lprintf(1, "%s [%s][%s]",
+               syslog(1, "%s [%s][%s]",
                        firsttoken,
                        ChrPtr(Val),
                        v->prop[i].value);
@@ -601,11 +613,11 @@ void parse_vcard(StrBuf *Target, struct vCard *v, HashList *VC, int full, wc_mim
                {
                        eVC evc = (eVC) V;
                        Put(VC, IKEY(evc), Val, HFreeStrBuf);
-                       lprintf(1, "[%ld]\n", evc);
+                       syslog(1, "[%ul]\n", evc);
                        Val = NULL;
                }
                else
-                       lprintf(1, "[]\n");
+                       syslog(1, "[]\n");
 /*
 TODO: check for layer II
                else 
@@ -730,7 +742,7 @@ void display_vcard(StrBuf *Target,
                 ((!isalpha(alpha)) && (!isalpha(this_alpha)))
                ) 
        {
-#ifdef TECH_PREVIEW
+#ifdef XXX_XXX
                new_vcard (Target, v, full, Mime);
 #else
                display_parsed_vcard(Target, v, full, Mime);
@@ -1032,9 +1044,9 @@ void do_edit_vcard(long msgnum, char *partnum,
        /* Display the form */
        output_headers(1, 1, 1, 0, 0, 0);
 
-       do_template("beginbox_1", NULL);
+       do_template("box_begin_1");
        StrBufAppendBufPlain(WC->WBuf, _("Edit contact information"), -1, 0);
-       do_template("beginbox_2", NULL);
+       do_template("box_begin_2");
 
        wc_printf("<form method=\"POST\" action=\"submit_vcard\">\n");
        wc_printf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
@@ -1205,7 +1217,7 @@ void do_edit_vcard(long msgnum, char *partnum,
        );
        
        wc_printf("</td></tr></table>\n");
-       do_template("endbox", NULL);
+       do_template("box_end");
        wDumpContent(1);
        if (Msg != NULL) {
                DestroyMessageSummary(Msg);