Merged from silc_1_0_branch.
[silc.git] / lib / silcutil / silcvcard.h
index ec448086f355c8bfe3be44ec5c12c0081f597ea5..7f9666c528257d3a70bcb92f25070157a2c58b2f 100644 (file)
@@ -23,9 +23,9 @@
  *
  * Implementation of the VCard 3.0 standard (RFC 2426) that can be used
  * with Requested Attributes (in WHOIS command) to deliver personal
- * information.  All fields are not supported since some other the
+ * information.  All fields are not supported since some of the
  * information are not needed in context of SILC.  If such VCard is
- * received this ignores the unsupported fields.
+ * received this implementation ignores the unsupported fields.
  *
  ***/
 
@@ -62,7 +62,7 @@ typedef struct {
   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 *catclass;          /* class (public, private, confidental), string */
   char *url;               /* home page, URI string */
   char *label;             /* formatted address label, string (same
                               format as for 'addr' but comma sep.) */
@@ -84,7 +84,7 @@ typedef struct {
     char *type;                    /* telephone number type, string
                               (msg, voice, home, work, pref, bbs, modem, car,
                               cell, video, pager, isdn, fax) */
-    char *tel;             /* single telephone number, string */
+    char *telnum;          /* single telephone number, string */
   } *tels;
   SilcUInt8 num_tels;
 
@@ -96,6 +96,8 @@ typedef struct {
 
   char *note;              /* a note, string */
   char *rev;               /* revision of card, UTC date string */
+
+  bool dynamic;                    /* TRUE when dynamically allocated */
 } SilcVCardStruct, *SilcVCard;
 /***/
 
@@ -103,7 +105,7 @@ typedef struct {
  *
  * SYNOPSIS
  *
- *    char *silc_vcard_encode(SilcVCard vcard, SilcUInt8 *vcard_len);
+ *    char *silc_vcard_encode(SilcVCard vcard, SilcUInt32 *vcard_len);
  *
  * DESCRIPTION
  *
@@ -135,11 +137,25 @@ unsigned char *silc_vcard_encode(SilcVCard vcard, SilcUInt32 *vcard_len);
 bool silc_vcard_decode(const unsigned char *data, SilcUInt32 data_len,
                       SilcVCard vcard);
 
+/****f* silcutil/SilcVCard/silc_vcard_alloc
+ *
+ * SYNOPSIS
+ *
+ *    SilcVCard silc_vcard_alloc(void);
+ *
+ * DESCRIPTION
+ *
+ *    Allocate a SilcVCard context which must be freed with the
+ *    silc_vcard_free function.
+ *
+ ***/
+SilcVCard silc_vcard_alloc(void);
+
 /****f* silcutil/SilcVCard/silc_vcard_free
  *
  * SYNOPSIS
  *
- *    void silc_vcard_free(SilcVcard vcard);
+ *    void silc_vcard_free(SilcVCard vcard);
  *
  * DESCRIPTION
  *