From 81d09cf045b817c56bf0e357d0a4a17278881c9a Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Mon, 14 Oct 2002 14:58:14 +0000 Subject: [PATCH] Comments. --- lib/silcutil/DIRECTORY | 1 + lib/silcutil/silcvcard.c | 7 ++++++- lib/silcutil/silcvcard.h | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/silcutil/DIRECTORY b/lib/silcutil/DIRECTORY index 37b0a95e..60e94a78 100644 --- a/lib/silcutil/DIRECTORY +++ b/lib/silcutil/DIRECTORY @@ -19,6 +19,7 @@ @LINK=silcutil.html:SILC Util Interface @LINK=silclist.html:SILC List Interface @LINK=silcdlist.html:SILC Dynamic List Interface +@LINK=silcvcard.html:SILC VCard Interface @LINK=silczip.html:SILC Zip API --> diff --git a/lib/silcutil/silcvcard.c b/lib/silcutil/silcvcard.c index ca26ae28..3a008f68 100644 --- a/lib/silcutil/silcvcard.c +++ b/lib/silcutil/silcvcard.c @@ -16,6 +16,7 @@ GNU General Public License for more details. */ +/* $Id$ */ /* Implementation of the VCard (RFC 2426) */ #include "silcincludes.h" @@ -73,7 +74,7 @@ static void silc_vcard_free_internal(SilcVCard vcard) /* Encode VCard */ -char *silc_vcard_encode(SilcVCard vcard, SilcUInt32 *vcard_len) +unsigned char *silc_vcard_encode(SilcVCard vcard, SilcUInt32 *vcard_len) { SilcBufferStruct buffer; int i; @@ -171,6 +172,7 @@ char *silc_vcard_encode(SilcVCard vcard, SilcUInt32 *vcard_len) return buffer.head; } +/* Take one token */ #define VCARD_TOKEN(x) \ if (!(x)) { \ (x) = silc_memdup(val + off, i - off); \ @@ -178,6 +180,7 @@ char *silc_vcard_encode(SilcVCard vcard, SilcUInt32 *vcard_len) continue; \ } +/* Take on TYPE= token and prepare for next token */ #define VCARD_TYPETOKEN(x) \ if (!(x)) { \ int tmpi; \ @@ -187,6 +190,7 @@ char *silc_vcard_encode(SilcVCard vcard, SilcUInt32 *vcard_len) i = tmpi; \ } +/* Take last token */ #define VCARD_LASTTOKEN(x) \ if (!(x)) { \ if (off < len) \ @@ -262,6 +266,7 @@ bool silc_vcard_decode(const unsigned char *data, SilcUInt32 data_len, break; } } + /* It's possible to have ORG without last ';', so check for it */ if (!vcard->org_name) { VCARD_LASTTOKEN(vcard->org_name); } else { diff --git a/lib/silcutil/silcvcard.h b/lib/silcutil/silcvcard.h index 91056904..ec448086 100644 --- a/lib/silcutil/silcvcard.h +++ b/lib/silcutil/silcvcard.h @@ -59,8 +59,8 @@ typedef struct { char *bday; /* birth day, UTC date string */ char *title; /* job title X.520, string */ char *role; /* job role X.520, string */ - char *org_name; /* organization name */ - char *org_unit; /* organization unit */ + char *org_name; /* organization name, string */ + char *org_unit; /* organization unit, string */ char *categories; /* application category, string */ char *class; /* class (public, private, confidental), string */ char *url; /* home page, URI string */ @@ -114,7 +114,7 @@ typedef struct { * buffer. Returns NULL on error. * ***/ -char *silc_vcard_encode(SilcVCard vcard, SilcUInt32 *vcard_len); +unsigned char *silc_vcard_encode(SilcVCard vcard, SilcUInt32 *vcard_len); /****f* silcutil/SilcVCard/silc_vcard_decode * -- 2.24.0