r20516 - gnucash/trunk/src/libqof/qof - Remove a set of kvp_frame functions which are unused throughout gnucash.

Christian Stimming cstim at code.gnucash.org
Sat Apr 2 16:17:42 EDT 2011


Author: cstim
Date: 2011-04-02 16:17:42 -0400 (Sat, 02 Apr 2011)
New Revision: 20516
Trac: http://svn.gnucash.org/trac/changeset/20516

Modified:
   gnucash/trunk/src/libqof/qof/kvp_frame.c
   gnucash/trunk/src/libqof/qof/kvp_frame.h
Log:
Remove a set of kvp_frame functions which are unused throughout gnucash.

Modified: gnucash/trunk/src/libqof/qof/kvp_frame.c
===================================================================
--- gnucash/trunk/src/libqof/qof/kvp_frame.c	2011-04-02 19:59:31 UTC (rev 20515)
+++ gnucash/trunk/src/libqof/qof/kvp_frame.c	2011-04-02 20:17:42 UTC (rev 20516)
@@ -168,7 +168,7 @@
  * Passing in a null value into this routine has the effect of
  * removing the key from the KVP tree.
  */
-KvpValue *
+static KvpValue *
 kvp_frame_replace_slot_nc (KvpFrame * frame, const char * slot,
                            KvpValue * new_value)
 {
@@ -524,7 +524,7 @@
 
 /* ============================================================ */
 
-KvpFrame *
+static KvpFrame *
 kvp_frame_add_value_nc(KvpFrame * frame, const char * path, KvpValue *value)
 {
     char *key = NULL;
@@ -568,89 +568,7 @@
     return frame;
 }
 
-KvpFrame *
-kvp_frame_add_value(KvpFrame * frame, const char * path, KvpValue *value)
-{
-    value = kvp_value_copy (value);
-    frame = kvp_frame_add_value_nc (frame, path, value);
-    if (!frame) kvp_value_delete (value);
-    return frame;
-}
-
 void
-kvp_frame_add_gint64(KvpFrame * frame, const char * path, gint64 ival)
-{
-    KvpValue *value;
-    value = kvp_value_new_gint64 (ival);
-    frame = kvp_frame_add_value_nc (frame, path, value);
-    if (!frame) kvp_value_delete (value);
-}
-
-void
-kvp_frame_add_double(KvpFrame * frame, const char * path, double dval)
-{
-    KvpValue *value;
-    value = kvp_value_new_double (dval);
-    frame = kvp_frame_add_value_nc (frame, path, value);
-    if (!frame) kvp_value_delete (value);
-}
-
-void
-kvp_frame_add_numeric(KvpFrame * frame, const char * path, gnc_numeric nval)
-{
-    KvpValue *value;
-    value = kvp_value_new_gnc_numeric (nval);
-    frame = kvp_frame_add_value_nc (frame, path, value);
-    if (!frame) kvp_value_delete (value);
-}
-
-void
-kvp_frame_add_gdate(KvpFrame * frame, const char * path, GDate nval)
-{
-    KvpValue *value;
-    value = kvp_value_new_gdate (nval);
-    frame = kvp_frame_add_value_nc (frame, path, value);
-    if (!frame) kvp_value_delete (value);
-}
-
-
-void
-kvp_frame_add_string(KvpFrame * frame, const char * path, const char* str)
-{
-    KvpValue *value;
-    value = kvp_value_new_string (str);
-    frame = kvp_frame_add_value_nc (frame, path, value);
-    if (!frame) kvp_value_delete (value);
-}
-
-void
-kvp_frame_add_guid(KvpFrame * frame, const char * path, const GncGUID *guid)
-{
-    KvpValue *value;
-    value = kvp_value_new_guid (guid);
-    frame = kvp_frame_add_value_nc (frame, path, value);
-    if (!frame) kvp_value_delete (value);
-}
-
-void
-kvp_frame_add_timespec(KvpFrame * frame, const char * path, Timespec ts)
-{
-    KvpValue *value;
-    value = kvp_value_new_timespec (ts);
-    frame = kvp_frame_add_value_nc (frame, path, value);
-    if (!frame) kvp_value_delete (value);
-}
-
-void
-kvp_frame_add_frame(KvpFrame * frame, const char * path, KvpFrame *fr)
-{
-    KvpValue *value;
-    value = kvp_value_new_frame (fr);
-    frame = kvp_frame_add_value_nc (frame, path, value);
-    if (!frame) kvp_value_delete (value);
-}
-
-void
 kvp_frame_add_frame_nc(KvpFrame * frame, const char * path, KvpFrame *fr)
 {
     KvpValue *value;
@@ -848,37 +766,6 @@
     }
 }
 
-void
-kvp_frame_add_url_encoding (KvpFrame *frame, const char *enc)
-{
-    char *buff, *p;
-    if (!frame || !enc) return;
-
-    /* Loop over all key-value pairs in the encoded string */
-    buff = g_strdup (enc);
-    p = buff;
-    while (*p)
-    {
-        char *n, *v;
-        n = strchr (p, '&');  /* n = next key-value */
-        if (n) *n = 0x0;
-
-        v = strchr (p, '=');  /* v =  pointer to value */
-        if (!v) break;
-        *v = 0x0;
-        v ++;
-
-        decode (p);
-        decode (v);
-        kvp_frame_set_slot_nc (frame, p, kvp_value_new_string(v));
-
-        if (!n) break; /* no next key, we are done */
-        p = ++n;
-    }
-
-    g_free(buff);
-}
-
 /* ============================================================ */
 
 

Modified: gnucash/trunk/src/libqof/qof/kvp_frame.h
===================================================================
--- gnucash/trunk/src/libqof/qof/kvp_frame.h	2011-04-02 19:59:31 UTC (rev 20515)
+++ gnucash/trunk/src/libqof/qof/kvp_frame.h	2011-04-02 20:17:42 UTC (rev 20516)
@@ -236,93 +236,24 @@
 KvpValue * kvp_frame_replace_value_nc (KvpFrame * frame, const gchar * slot,
                                        KvpValue * new_value);
 /** @} */
-/** @name KvpFrame URL handling
- @{
-*/
-/** The kvp_frame_add_url_encoding() routine will parse the
- *  value string, assuming it to be URL-encoded in the standard way,
- *  turning it into a set of key-value pairs, and adding those to the
- *  indicated frame.  URL-encoded strings are the things that are
- *  returned by web browsers when a form is filled out.  For example,
- *  'start-date=June&end-date=November' consists of two keys,
- *  'start-date' and 'end-date', which have the values 'June' and
- *  'November', respectively.  This routine also handles % encoding.
- *
- *  This routine treats all values as strings; it does *not* attempt
- *  to perform any type-conversion.
- * */
-void     kvp_frame_add_url_encoding (KvpFrame *frame, const gchar *enc);
-/** @} */
 
 /** @name KvpFrame Glist Bag Storing
  @{
 */
 
-/** The kvp_frame_add_gint64() routine will add the value of the
- *     gint64 to the glist bag of values at the indicated path.
- *     If not all frame components of the path exist, they are
- *     created.  If the value previously stored at this path was
- *     not a glist bag, then a bag will be formed there, the old
- *     value placed in the bag, and the new value added to the bag.
- *
- *     Similarly, the add_double, add_numeric, and add_timespec
- *     routines perform the same function, for each of the respective
- *     types.
- */
-void kvp_frame_add_gint64(KvpFrame * frame, const gchar * path, gint64 ival);
-void kvp_frame_add_double(KvpFrame * frame, const gchar * path, double dval);
-/** \deprecated
+/** \brief Store the given kvp_frame to the glist bag at the indicated path (non-copying)
 
-Use kvp_frame_add_numeric instead of kvp_frame_add_gnc_numeric
-*/
-#define kvp_frame_add_gnc_numeric kvp_frame_add_numeric
-
-void kvp_frame_add_numeric(KvpFrame * frame, const gchar * path, gnc_numeric nval);
-void kvp_frame_add_timespec(KvpFrame * frame, const gchar * path, Timespec ts);
-void kvp_frame_add_gdate(KvpFrame * frame, const gchar * path, GDate date);
-
-/** \deprecated
-
-Use kvp_frame_add_string instead of kvp_frame_add_str
-*/
-#define kvp_frame_add_str kvp_frame_add_string
-
-/** \brief Copy of the string to the glist bag at the indicated path.
-
  *    If not all frame components
  *    of the path exist, they are created.  If there was another
  *    item previously stored at that path, then the path is converted
  *    to a bag, and the old value, along with the new value, is added
  *    to the bag.
  *
- *    Similarly, the add_guid and add_frame will make copies and
- *    add those.
- *
- * The kvp_frame_add_frame_nc() routine works as above, but does
- *    *NOT* copy the frame.
+ * This method does *NOT* copy the frame.
  */
-void kvp_frame_add_string(KvpFrame * frame, const gchar * path, const gchar* str);
-void kvp_frame_add_guid(KvpFrame * frame, const gchar * path, const GncGUID *guid);
-
-void kvp_frame_add_frame(KvpFrame *frame, const gchar *path, KvpFrame *chld);
 void kvp_frame_add_frame_nc(KvpFrame *frame, const gchar *path, KvpFrame *chld);
 
-/* The kvp_frame_add_value() routine will  add a copy of the value
- *    to the glist bag at the indicated path. If not all frame components
- *    of the path exist, they are created.  If there was another
- *    item previously stored at that path, then the path is converted
- *    to a bag, and the old value, along with the new value, is added
- *    to the bag.  This routine returns the pointer to the last frame
- *    (the actual frame to which the value was added), or NULL if there
- *    was an error of any sort (typically, a parse error in the path).
- *
- *    The *_nc() routine is analogous, except that it doesn't copy the
- *    value.
- */
-KvpFrame * kvp_frame_add_value(KvpFrame * frame, const gchar * path, KvpValue *value);
-KvpFrame * kvp_frame_add_value_nc(KvpFrame * frame, const gchar * path, KvpValue *value);
 
-
 /** @} */
 
 /** @name KvpFrame Value Fetching
@@ -443,8 +374,8 @@
  *    Passing in a NULL new_value has the effect of deleting that
  *    slot.
  */
-KvpValue * kvp_frame_replace_slot_nc (KvpFrame * frame, const gchar * slot,
-                                      KvpValue * new_value);
+/* KvpValue * kvp_frame_replace_slot_nc (KvpFrame * frame, const gchar * slot, */
+/*                                       KvpValue * new_value); */
 
 
 /** The kvp_frame_set_slot() routine copies the value into the frame,



More information about the gnucash-changes mailing list