Removing deprecated #define

kvp_value should not be used, but rather the standard KvpValue. Using
the deprecated value just adds one more variation on this typename.
This commit is contained in:
lmat 2014-09-17 17:31:16 -04:00 committed by John Ralls
parent 010cf541f9
commit b109c94f2c
15 changed files with 113 additions and 115 deletions

View File

@ -492,7 +492,7 @@ set_guid_val( gpointer pObject, /*@ null @*/ gpointer pValue )
case KVP_TYPE_GLIST: case KVP_TYPE_GLIST:
{ {
slot_info_t *newInfo = slot_info_copy( pInfo, (GncGUID*)pValue ); slot_info_t *newInfo = slot_info_copy( pInfo, (GncGUID*)pValue );
kvp_value *pValue = NULL; KvpValue *pValue = NULL;
gchar *key = get_key_from_path( pInfo->path ); gchar *key = get_key_from_path( pInfo->path );
newInfo->context = LIST; newInfo->context = LIST;
@ -684,7 +684,7 @@ save_slot( const gchar* key, KvpValue* value, gpointer data )
g_return_if_fail( pSlot_info->is_ok ); g_return_if_fail( pSlot_info->is_ok );
for (cursor = kvp_value_get_glist(value); cursor; cursor = cursor->next) for (cursor = kvp_value_get_glist(value); cursor; cursor = cursor->next)
{ {
kvp_value *val = (kvp_value*)cursor->data; KvpValue *val = (KvpValue*)cursor->data;
save_slot("", val, pNewInfo); save_slot("", val, pNewInfo);
} }
kvp_value_delete( pSlot_info->pKvpValue ); kvp_value_delete( pSlot_info->pKvpValue );

View File

@ -435,7 +435,7 @@ gnc_is_xml_data_file(const gchar *filename)
static void static void
kvp_value_result_cleanup(sixtp_child_result *cr) kvp_value_result_cleanup(sixtp_child_result *cr)
{ {
kvp_value *v = (kvp_value *) cr->data;; KvpValue *v = (KvpValue *) cr->data;;
if (v) kvp_value_delete(v); if (v) kvp_value_delete(v);
} }
@ -476,7 +476,7 @@ simple_kvp_value_parser_new(sixtp_end_handler end_handler)
{ \ { \
gchar *txt = NULL; \ gchar *txt = NULL; \
TYPE val; \ TYPE val; \
kvp_value *kvpv; \ KvpValue *kvpv; \
gboolean ok; \ gboolean ok; \
\ \
txt = concatenate_child_result_chars(data_from_children); \ txt = concatenate_child_result_chars(data_from_children); \
@ -559,7 +559,7 @@ string_kvp_value_end_handler(gpointer data_for_children,
const gchar *tag) const gchar *tag)
{ {
gchar *txt = NULL; gchar *txt = NULL;
kvp_value *kvpv; KvpValue *kvpv;
txt = concatenate_child_result_chars(data_from_children); txt = concatenate_child_result_chars(data_from_children);
g_return_val_if_fail(txt, FALSE); g_return_val_if_fail(txt, FALSE);
@ -591,7 +591,7 @@ guid_kvp_value_end_handler(gpointer data_for_children,
{ {
gchar *txt = NULL; gchar *txt = NULL;
GncGUID val; GncGUID val;
kvp_value *kvpv; KvpValue *kvpv;
gboolean ok; gboolean ok;
txt = concatenate_child_result_chars(data_from_children); txt = concatenate_child_result_chars(data_from_children);
@ -644,13 +644,13 @@ glist_kvp_value_end_handler(gpointer data_for_children,
{ {
GSList *lp; GSList *lp;
GList *result_glist; GList *result_glist;
kvp_value *kvp_result; KvpValue *kvp_result;
result_glist = NULL; result_glist = NULL;
for (lp = data_from_children; lp; lp = lp->next) for (lp = data_from_children; lp; lp = lp->next)
{ {
sixtp_child_result *cr = (sixtp_child_result *) lp->data; sixtp_child_result *cr = (sixtp_child_result *) lp->data;
kvp_value *kvp = (kvp_value *) cr->data; KvpValue *kvp = (KvpValue *) cr->data;
/* children are in reverse chron order, so this fixes it. */ /* children are in reverse chron order, so this fixes it. */
result_glist = g_list_prepend(result_glist, kvp); result_glist = g_list_prepend(result_glist, kvp);
@ -764,7 +764,7 @@ kvp_frame_slot_end_handler(gpointer data_for_children,
guint64 key_node_count; guint64 key_node_count;
gchar *key = NULL; gchar *key = NULL;
sixtp_child_result *value_cr = NULL; sixtp_child_result *value_cr = NULL;
kvp_value *value = NULL; KvpValue *value = NULL;
gboolean delete_value = FALSE; gboolean delete_value = FALSE;
g_return_val_if_fail(f, FALSE); g_return_val_if_fail(f, FALSE);

View File

@ -264,7 +264,7 @@ static void
add_kvp_slot(gpointer key, gpointer value, gpointer data); add_kvp_slot(gpointer key, gpointer value, gpointer data);
static void static void
add_kvp_value_node(xmlNodePtr node, gchar *tag, kvp_value* val) add_kvp_value_node(xmlNodePtr node, gchar *tag, KvpValue* val)
{ {
xmlNodePtr val_node; xmlNodePtr val_node;
kvp_value_t kvp_type; kvp_value_t kvp_type;
@ -333,7 +333,7 @@ add_kvp_value_node(xmlNodePtr node, gchar *tag, kvp_value* val)
xmlSetProp(val_node, BAD_CAST "type", BAD_CAST "list"); xmlSetProp(val_node, BAD_CAST "type", BAD_CAST "list");
for (cursor = kvp_value_get_glist(val); cursor; cursor = cursor->next) for (cursor = kvp_value_get_glist(val); cursor; cursor = cursor->next)
{ {
kvp_value *val = (kvp_value*)cursor->data; KvpValue *val = (KvpValue*)cursor->data;
add_kvp_value_node(val_node, "slot:value", val); add_kvp_value_node(val_node, "slot:value", val);
} }
} }
@ -369,7 +369,7 @@ add_kvp_slot(gpointer key, gpointer value, gpointer data)
xmlNewTextChild(slot_node, NULL, BAD_CAST "slot:key", xmlNewTextChild(slot_node, NULL, BAD_CAST "slot:key",
checked_char_cast (newkey)); checked_char_cast (newkey));
g_free (newkey); g_free (newkey);
add_kvp_value_node(slot_node, "slot:value", (kvp_value*)value); add_kvp_value_node(slot_node, "slot:value", (KvpValue*)value);
} }
xmlNodePtr xmlNodePtr

View File

@ -78,12 +78,12 @@ dom_tree_to_guid(xmlNodePtr node)
} }
} }
kvp_value* KvpValue*
dom_tree_to_integer_kvp_value(xmlNodePtr node) dom_tree_to_integer_kvp_value(xmlNodePtr node)
{ {
gchar *text; gchar *text;
gint64 daint; gint64 daint;
kvp_value* ret = NULL; KvpValue* ret = NULL;
text = dom_tree_to_text(node); text = dom_tree_to_text(node);
@ -161,12 +161,12 @@ dom_tree_to_boolean(xmlNodePtr node, gboolean* b)
} }
} }
kvp_value* KvpValue*
dom_tree_to_double_kvp_value(xmlNodePtr node) dom_tree_to_double_kvp_value(xmlNodePtr node)
{ {
gchar *text; gchar *text;
double dadoub; double dadoub;
kvp_value *ret = NULL; KvpValue *ret = NULL;
text = dom_tree_to_text(node); text = dom_tree_to_text(node);
@ -180,11 +180,11 @@ dom_tree_to_double_kvp_value(xmlNodePtr node)
return ret; return ret;
} }
kvp_value* KvpValue*
dom_tree_to_numeric_kvp_value(xmlNodePtr node) dom_tree_to_numeric_kvp_value(xmlNodePtr node)
{ {
gnc_numeric *danum; gnc_numeric *danum;
kvp_value *ret = NULL; KvpValue *ret = NULL;
danum = dom_tree_to_gnc_numeric(node); danum = dom_tree_to_gnc_numeric(node);
@ -198,11 +198,11 @@ dom_tree_to_numeric_kvp_value(xmlNodePtr node)
return ret; return ret;
} }
kvp_value* KvpValue*
dom_tree_to_string_kvp_value(xmlNodePtr node) dom_tree_to_string_kvp_value(xmlNodePtr node)
{ {
gchar *datext; gchar *datext;
kvp_value *ret = NULL; KvpValue *ret = NULL;
datext = dom_tree_to_text(node); datext = dom_tree_to_text(node);
if (datext) if (datext)
@ -215,11 +215,11 @@ dom_tree_to_string_kvp_value(xmlNodePtr node)
return ret; return ret;
} }
kvp_value* KvpValue*
dom_tree_to_guid_kvp_value(xmlNodePtr node) dom_tree_to_guid_kvp_value(xmlNodePtr node)
{ {
GncGUID *daguid; GncGUID *daguid;
kvp_value *ret = NULL; KvpValue *ret = NULL;
daguid = dom_tree_to_guid(node); daguid = dom_tree_to_guid(node);
if (daguid) if (daguid)
@ -232,11 +232,11 @@ dom_tree_to_guid_kvp_value(xmlNodePtr node)
return ret; return ret;
} }
kvp_value* KvpValue*
dom_tree_to_timespec_kvp_value (xmlNodePtr node) dom_tree_to_timespec_kvp_value (xmlNodePtr node)
{ {
Timespec ts; Timespec ts;
kvp_value * ret = NULL; KvpValue * ret = NULL;
ts = dom_tree_to_timespec (node); ts = dom_tree_to_timespec (node);
if (ts.tv_sec || ts.tv_nsec) if (ts.tv_sec || ts.tv_nsec)
@ -246,11 +246,11 @@ dom_tree_to_timespec_kvp_value (xmlNodePtr node)
return ret; return ret;
} }
kvp_value* KvpValue*
dom_tree_to_gdate_kvp_value (xmlNodePtr node) dom_tree_to_gdate_kvp_value (xmlNodePtr node)
{ {
GDate *date; GDate *date;
kvp_value *ret = NULL; KvpValue *ret = NULL;
date = dom_tree_to_gdate(node); date = dom_tree_to_gdate(node);
@ -303,16 +303,16 @@ string_to_binary(const gchar *str, void **v, guint64 *data_len)
return(TRUE); return(TRUE);
} }
kvp_value* KvpValue*
dom_tree_to_list_kvp_value(xmlNodePtr node) dom_tree_to_list_kvp_value(xmlNodePtr node)
{ {
GList *list = NULL; GList *list = NULL;
xmlNodePtr mark; xmlNodePtr mark;
kvp_value *ret = NULL; KvpValue *ret = NULL;
for (mark = node->xmlChildrenNode; mark; mark = mark->next) for (mark = node->xmlChildrenNode; mark; mark = mark->next)
{ {
kvp_value *new_val; KvpValue *new_val;
if (g_strcmp0 ((char*)mark->name, "text") == 0) if (g_strcmp0 ((char*)mark->name, "text") == 0)
continue; continue;
@ -329,11 +329,11 @@ dom_tree_to_list_kvp_value(xmlNodePtr node)
return ret; return ret;
} }
kvp_value* KvpValue*
dom_tree_to_frame_kvp_value(xmlNodePtr node) dom_tree_to_frame_kvp_value(xmlNodePtr node)
{ {
kvp_frame *frame; kvp_frame *frame;
kvp_value *ret = NULL; KvpValue *ret = NULL;
frame = dom_tree_to_kvp_frame(node); frame = dom_tree_to_kvp_frame(node);
@ -351,7 +351,7 @@ dom_tree_to_frame_kvp_value(xmlNodePtr node)
struct kvp_val_converter struct kvp_val_converter
{ {
gchar *tag; gchar *tag;
kvp_value* (*converter)(xmlNodePtr node); KvpValue* (*converter)(xmlNodePtr node);
}; };
struct kvp_val_converter val_converters[] = struct kvp_val_converter val_converters[] =
@ -368,13 +368,13 @@ struct kvp_val_converter val_converters[] =
{ 0, 0 }, { 0, 0 },
}; };
kvp_value* KvpValue*
dom_tree_to_kvp_value(xmlNodePtr node) dom_tree_to_kvp_value(xmlNodePtr node)
{ {
xmlChar *xml_type; xmlChar *xml_type;
gchar *type; gchar *type;
struct kvp_val_converter *mark; struct kvp_val_converter *mark;
kvp_value *ret = NULL; KvpValue *ret = NULL;
xml_type = xmlGetProp(node, BAD_CAST "type"); xml_type = xmlGetProp(node, BAD_CAST "type");
if (xml_type) if (xml_type)
@ -417,7 +417,7 @@ dom_tree_to_kvp_frame_given(xmlNodePtr node, kvp_frame *frame)
{ {
xmlNodePtr mark2; xmlNodePtr mark2;
gchar *key = NULL; gchar *key = NULL;
kvp_value *val = NULL; KvpValue *val = NULL;
for (mark2 = mark->xmlChildrenNode; mark2; mark2 = mark2->next) for (mark2 = mark->xmlChildrenNode; mark2; mark2 = mark2->next)
{ {

View File

@ -50,17 +50,17 @@ gboolean string_to_binary(const gchar *str, void **v, guint64 *data_len);
gboolean dom_tree_to_kvp_frame_given(xmlNodePtr node, kvp_frame *frame); gboolean dom_tree_to_kvp_frame_given(xmlNodePtr node, kvp_frame *frame);
kvp_frame* dom_tree_to_kvp_frame(xmlNodePtr node); kvp_frame* dom_tree_to_kvp_frame(xmlNodePtr node);
kvp_value* dom_tree_to_kvp_value(xmlNodePtr node); KvpValue* dom_tree_to_kvp_value(xmlNodePtr node);
kvp_value* dom_tree_to_integer_kvp_value(xmlNodePtr node); KvpValue* dom_tree_to_integer_kvp_value(xmlNodePtr node);
kvp_value* dom_tree_to_double_kvp_value(xmlNodePtr node); KvpValue* dom_tree_to_double_kvp_value(xmlNodePtr node);
kvp_value* dom_tree_to_numeric_kvp_value(xmlNodePtr node); KvpValue* dom_tree_to_numeric_kvp_value(xmlNodePtr node);
kvp_value* dom_tree_to_string_kvp_value(xmlNodePtr node); KvpValue* dom_tree_to_string_kvp_value(xmlNodePtr node);
kvp_value* dom_tree_to_guid_kvp_value(xmlNodePtr node); KvpValue* dom_tree_to_guid_kvp_value(xmlNodePtr node);
kvp_value* dom_tree_to_timespec_kvp_value(xmlNodePtr node); KvpValue* dom_tree_to_timespec_kvp_value(xmlNodePtr node);
kvp_value* dom_tree_to_binary_kvp_value(xmlNodePtr node); KvpValue* dom_tree_to_binary_kvp_value(xmlNodePtr node);
kvp_value* dom_tree_to_list_kvp_value(xmlNodePtr node); KvpValue* dom_tree_to_list_kvp_value(xmlNodePtr node);
kvp_value* dom_tree_to_frame_kvp_value(xmlNodePtr node); KvpValue* dom_tree_to_frame_kvp_value(xmlNodePtr node);
kvp_value* dom_tree_to_gdate_kvp_value (xmlNodePtr node); KvpValue* dom_tree_to_gdate_kvp_value (xmlNodePtr node);
gboolean dom_tree_to_integer(xmlNodePtr node, gint64 *daint); gboolean dom_tree_to_integer(xmlNodePtr node, gint64 *daint);
gboolean dom_tree_to_guint16(xmlNodePtr node, guint16 *i); gboolean dom_tree_to_guint16(xmlNodePtr node, guint16 *i);

View File

@ -16,10 +16,10 @@ const gchar *gnc_v2_xml_version_string = GNC_V2_STRING;
static void static void
test_kvp_get_slot(int run, test_kvp_get_slot(int run,
kvp_frame *test_frame1, const kvp_value *test_val1, kvp_frame *test_frame1, const KvpValue *test_val1,
const gchar *test_key) const gchar *test_key)
{ {
const kvp_value *test_val2; const KvpValue *test_val2;
test_val2 = kvp_frame_get_slot(test_frame1, test_key); test_val2 = kvp_frame_get_slot(test_frame1, test_key);
if (kvp_value_compare(test_val1, test_val2) == 0) if (kvp_value_compare(test_val1, test_val2) == 0)
{ {
@ -37,7 +37,7 @@ test_kvp_get_slot(int run,
static void static void
test_kvp_copy_compare(int run, test_kvp_copy_compare(int run,
kvp_frame *test_frame1, const kvp_value *test_val1, kvp_frame *test_frame1, const KvpValue *test_val1,
const gchar *test_key) const gchar *test_key)
{ {
kvp_frame *test_frame2; kvp_frame *test_frame2;
@ -70,11 +70,11 @@ test_kvp_copy_compare(int run,
static void static void
test_kvp_copy_get_slot(int run, test_kvp_copy_get_slot(int run,
kvp_frame *test_frame1, const kvp_value *test_val1, kvp_frame *test_frame1, const KvpValue *test_val1,
const gchar *test_key) const gchar *test_key)
{ {
kvp_frame *test_frame2; kvp_frame *test_frame2;
const kvp_value *test_val2; const KvpValue *test_val2;
test_frame2 = kvp_frame_copy(test_frame1); test_frame2 = kvp_frame_copy(test_frame1);
test_val2 = kvp_frame_get_slot(test_frame2, test_key); test_val2 = kvp_frame_get_slot(test_frame2, test_key);
@ -126,7 +126,7 @@ test_kvp_frames1(void)
{ {
kvp_frame *test_frame1; kvp_frame *test_frame1;
gchar *test_key; gchar *test_key;
kvp_value *test_val1; KvpValue *test_val1;
test_val1 = get_random_kvp_value(i % KVP_TYPE_FRAME); test_val1 = get_random_kvp_value(i % KVP_TYPE_FRAME);

View File

@ -847,15 +847,15 @@ exchange.
To meet this need for varying data storage, the GnuCash accounting To meet this need for varying data storage, the GnuCash accounting
entities use Key-Value Pair Frames (hereafter referred to as the entities use Key-Value Pair Frames (hereafter referred to as the
datatype @code{kvp_frame}). A @code{kvp_frame} is a set of associations datatype @code{kvp_frame}). A @code{kvp_frame} is a set of associations
between character strings (keys) and @code{kvp_value} structures. A between character strings (keys) and @code{KvpValue} structures. A
@code{kvp_value} is a union with possible types enumerated in the @code{KvpValue} is a union with possible types enumerated in the
@code{kvp_value_t} enum which indicates the type of data stored in a @code{kvp_value_t} enum which indicates the type of data stored in a
@code{kvp_value} object. @code{KvpValue} object.
@menu @menu
* Key-Value Policy:: * Key-Value Policy::
* kvp_frame:: * kvp_frame::
* kvp_value:: * KvpValue::
* kvp_list:: * kvp_list::
@end menu @end menu
@ -910,12 +910,12 @@ same basic purpose.
@end itemize @end itemize
@node kvp_frame, kvp_value, Key-Value Policy, Key-Value Pair Frames @node kvp_frame, KvpValue, Key-Value Policy, Key-Value Pair Frames
@subsection kvp_frame @subsection kvp_frame
@tindex kvp_frame @tindex kvp_frame
A @code{kvp_frame} is the datatype used to associate key strings with A @code{kvp_frame} is the datatype used to associate key strings with
@code{kvp_value} objects (@pxref{kvp_value}). @code{KvpValue} objects (@pxref{KvpValue}).
@deftypefun kvp_frame* kvp_frame_new (void) @deftypefun kvp_frame* kvp_frame_new (void)
Create and initialize a new @code{kvp_frame} object and return Create and initialize a new @code{kvp_frame} object and return
@ -930,40 +930,40 @@ Free all memory associated with @var{frame}.
Return a deep copy of @var{frame}. Return a deep copy of @var{frame}.
@end deftypefun @end deftypefun
@deftypefun void kvp_frame_set_slot (kvp_frame * @var{frame}, const char * @var{key}, const kvp_value * @var{value}) @deftypefun void kvp_frame_set_slot (kvp_frame * @var{frame}, const char * @var{key}, const KvpValue * @var{value})
Associate @var{key} with @var{value} in @var{frame}. Associate @var{key} with @var{value} in @var{frame}.
@end deftypefun @end deftypefun
@deftypefun void kvp_frame_set_slot_nc (kvp_frame * @var{frame}, const char * @var{key}, kvp_value * @var{value}) @deftypefun void kvp_frame_set_slot_nc (kvp_frame * @var{frame}, const char * @var{key}, KvpValue * @var{value})
Same as @code{kvp_frame_set_slot}, except that @var{value} is used Same as @code{kvp_frame_set_slot}, except that @var{value} is used
directly, instead of being copied. This call transfers 'ownership' directly, instead of being copied. This call transfers 'ownership'
of @var{value} to @var{frame}. of @var{value} to @var{frame}.
@end deftypefun @end deftypefun
@deftypefun kvp_value* kvp_frame_get_slot (kvp_frame * @var{frame}, const char * @var{key}) @deftypefun KvpValue* kvp_frame_get_slot (kvp_frame * @var{frame}, const char * @var{key})
Return the @code{kvp_value} object associated with @var{key} Return the @code{KvpValue} object associated with @var{key}
in @var{frame} or return @code{NULL} if there is no association in @var{frame} or return @code{NULL} if there is no association
for @var{key}. The value returned is not a copy. for @var{key}. The value returned is not a copy.
@end deftypefun @end deftypefun
@deftypefun void kvp_frame_set_slot_path (kvp_frame * @var{frame}, const kvp_value * @var{value}, const char * @var{first_key}, ...) @deftypefun void kvp_frame_set_slot_path (kvp_frame * @var{frame}, const KvpValue * @var{value}, const char * @var{first_key}, ...)
Associate @var{value} with the ``key path'' specified by the variable Associate @var{value} with the ``key path'' specified by the variable
argument list. Each key in the path except the last denotes a sub-frame argument list. Each key in the path except the last denotes a sub-frame
which is associated with the given key. The variable list must be which is associated with the given key. The variable list must be
terminated with NULL. terminated with NULL.
@end deftypefun @end deftypefun
@deftypefun void kvp_frame_set_slot_path_gslist (kvp_frame * @var{frame}, const kvp_value * @var{value}, GSList * @var{key_path}) @deftypefun void kvp_frame_set_slot_path_gslist (kvp_frame * @var{frame}, const KvpValue * @var{value}, GSList * @var{key_path})
The same as @code{kvp_frame_set_slot_path}, except that the key path is The same as @code{kvp_frame_set_slot_path}, except that the key path is
specified using a GSList. All the keys in the list should be non-NULL. specified using a GSList. All the keys in the list should be non-NULL.
@end deftypefun @end deftypefun
@deftypefun {kvp_value *} kvp_frame_get_slot_path (kvp_frame * @var{frame}, const char * @var{first_key}, ...) @deftypefun {KvpValue *} kvp_frame_get_slot_path (kvp_frame * @var{frame}, const char * @var{first_key}, ...)
Return the value associated with the key path, or @code{NULL} if none. Return the value associated with the key path, or @code{NULL} if none.
The path is specified as in @code{kvp_frame_set_slot_path}. The path is specified as in @code{kvp_frame_set_slot_path}.
@end deftypefun @end deftypefun
@deftypefun {kvp_value *} kvp_frame_get_slot_path_gslist (kvp_frame * @var{frame}, GSList * @var{key_path}) @deftypefun {KvpValue *} kvp_frame_get_slot_path_gslist (kvp_frame * @var{frame}, GSList * @var{key_path})
Return the value associated with the key path, or @code{NULL} if none. Return the value associated with the key path, or @code{NULL} if none.
The path is specified as in @code{kvp_frame_set_slot_path_gslist}. The path is specified as in @code{kvp_frame_set_slot_path_gslist}.
@end deftypefun @end deftypefun
@ -990,23 +990,23 @@ is arguably a bug that needs fixing).
@end deftypefun @end deftypefun
@node kvp_value, kvp_list, kvp_frame, Key-Value Pair Frames @node KvpValue, kvp_list, kvp_frame, Key-Value Pair Frames
@subsection kvp_value @subsection KvpValue
@tindex kvp_value @tindex KvpValue
@tindex kvp_value_t @tindex kvp_value_t
The @code{kvp_value} object stores the 'value' part of a key-value The @code{KvpValue} object stores the 'value' part of a key-value
association in a @code{kvp_frame} object. association in a @code{kvp_frame} object.
@deftypefun void kvp_value_delete (kvp_value * @var{value}) @deftypefun void kvp_value_delete (KvpValue * @var{value})
Free all of the memory associated with @var{value}. Free all of the memory associated with @var{value}.
@end deftypefun @end deftypefun
@deftypefun kvp_value* kvp_value_copy (const kvp_value * @var{value}) @deftypefun KvpValue* kvp_value_copy (const KvpValue * @var{value})
Return a deep copy of @var{value}. Return a deep copy of @var{value}.
@end deftypefun @end deftypefun
@deftypefun kvp_value_t kvp_value_get_type (const kvp_value * @var{value}) @deftypefun kvp_value_t kvp_value_get_type (const KvpValue * @var{value})
Return the type of value stored in @var{value}. Return the type of value stored in @var{value}.
@end deftypefun @end deftypefun
@ -1033,7 +1033,7 @@ A @code{GUID} value. @xref{Globally Unique Identifiers}.
Arbitrary binary data. Arbitrary binary data.
@item KVP_TYPE_LIST @item KVP_TYPE_LIST
A @code{kvp_list} item which contains a list of @code{kvp_value} items. A @code{kvp_list} item which contains a list of @code{KvpValue} items.
@item KVP_TYPE_FRAME @item KVP_TYPE_FRAME
A @code{kvp_frame} object. Thus, frames may contain other frames in a A @code{kvp_frame} object. Thus, frames may contain other frames in a
@ -1043,53 +1043,53 @@ recursive manner.
@subsubsection Value Constructors @subsubsection Value Constructors
The following functions create and return @code{kvp_value} objects with The following functions create and return @code{KvpValue} objects with
particular values. In the case of pointer arguments, deep copies are particular values. In the case of pointer arguments, deep copies are
performed. performed.
@deftypefun kvp_value* kvp_value_new_int64 (gint64 @var{value}) @deftypefun KvpValue* kvp_value_new_int64 (gint64 @var{value})
@end deftypefun @end deftypefun
@deftypefun kvp_value* kvp_value_new_float64 (double @var{value}) @deftypefun KvpValue* kvp_value_new_float64 (double @var{value})
@end deftypefun @end deftypefun
@deftypefun kvp_value* kvp_value_new_string (const char * @var{value}) @deftypefun KvpValue* kvp_value_new_string (const char * @var{value})
@end deftypefun @end deftypefun
@deftypefun kvp_value* kvp_value_new_guid (const GUID * @var{guid}) @deftypefun KvpValue* kvp_value_new_guid (const GUID * @var{guid})
@end deftypefun @end deftypefun
@deftypefun kvp_value* kvp_value_new_binary (const void * @var{data}, int @var{datasize}) @deftypefun KvpValue* kvp_value_new_binary (const void * @var{data}, int @var{datasize})
@end deftypefun @end deftypefun
@deftypefun kvp_value* kvp_value_new_list (const kvp_list * @var{value}) @deftypefun KvpValue* kvp_value_new_list (const kvp_list * @var{value})
@end deftypefun @end deftypefun
@deftypefun kvp_value* kvp_value_new_frame (const kvp_frame * @var{value}); @deftypefun KvpValue* kvp_value_new_frame (const kvp_frame * @var{value});
@end deftypefun @end deftypefun
@subsubsection Value Accessors @subsubsection Value Accessors
The following functions access the value of a given @code{kvp_value} The following functions access the value of a given @code{KvpValue}
object. If the type of the object does not correspond to that named object. If the type of the object does not correspond to that named
in the function, @code{NULL}, @code{0}, or @code{0.0} is returned in the function, @code{NULL}, @code{0}, or @code{0.0} is returned
as appropriate. as appropriate.
@deftypefun gint64 kvp_value_get_int64 (const kvp_value * @var{value}) @deftypefun gint64 kvp_value_get_int64 (const KvpValue * @var{value})
@end deftypefun @end deftypefun
@deftypefun double kvp_value_get_float64 (const kvp_value * @var{value}) @deftypefun double kvp_value_get_float64 (const KvpValue * @var{value})
@end deftypefun @end deftypefun
@deftypefun char* kvp_value_get_string (const kvp_value * @var{value}) @deftypefun char* kvp_value_get_string (const KvpValue * @var{value})
@end deftypefun @end deftypefun
@deftypefun GUID* kvp_value_get_guid (const kvp_value * @var{value}) @deftypefun GUID* kvp_value_get_guid (const KvpValue * @var{value})
@end deftypefun @end deftypefun
@deftypefun void* kvp_value_get_binary (const kvp_value * @var{value}, int * @var{size_return}) @deftypefun void* kvp_value_get_binary (const KvpValue * @var{value}, int * @var{size_return})
@end deftypefun @end deftypefun
@deftypefun kvp_list* kvp_value_get_list (const kvp_value * @var{value}) @deftypefun kvp_list* kvp_value_get_list (const KvpValue * @var{value})
@end deftypefun @end deftypefun
@deftypefun kvp_frame* kvp_value_get_frame (const kvp_value * @var{value}) @deftypefun kvp_frame* kvp_value_get_frame (const KvpValue * @var{value})
@end deftypefun @end deftypefun
@node kvp_list, , kvp_value, Key-Value Pair Frames @node kvp_list, , KvpValue, Key-Value Pair Frames
@subsection kvp_list @subsection kvp_list
@tindex kvp_list @tindex kvp_list
A @code{kvp_list} object abstract a list of @code{kvp_value} objects. A @code{kvp_list} object abstract a list of @code{KvpValue} objects.
@deftypefun kvp_list* kvp_list_new () @deftypefun kvp_list* kvp_list_new ()
Return a newly allocated @code{kvp_list} object. Return a newly allocated @code{kvp_list} object.
@ -1097,7 +1097,7 @@ Return a newly allocated @code{kvp_list} object.
@deftypefun void kvp_list_delete (kvp_list * @var{list}) @deftypefun void kvp_list_delete (kvp_list * @var{list})
Free all memory associated with @var{list}, including the Free all memory associated with @var{list}, including the
@code{kvp_value} objects in @var{list}. @code{KvpValue} objects in @var{list}.
@end deftypefun @end deftypefun
@deftypefun kvp_list* kvp_list_copy (const kvp_list * @var{list}) @deftypefun kvp_list* kvp_list_copy (const kvp_list * @var{list})
@ -1108,9 +1108,9 @@ Return a deep copy of @var{list}.
Return @code{TRUE} if @var{list} is the empty list. Return @code{TRUE} if @var{list} is the empty list.
@end deftypefun @end deftypefun
@deftypefun kvp_value* kvp_list_car (kvp_list * @var{list}) @deftypefun KvpValue* kvp_list_car (kvp_list * @var{list})
If @var{list} is @code{NULL} or the empty list, return @code{NULL}. If @var{list} is @code{NULL} or the empty list, return @code{NULL}.
Otherwise, return the first @code{kvp_value} object in the list. Otherwise, return the first @code{KvpValue} object in the list.
@end deftypefun @end deftypefun
@deftypefun kvp_list* kvp_list_cdr (kvp_list * @var{list}) @deftypefun kvp_list* kvp_list_cdr (kvp_list * @var{list})
@ -1119,7 +1119,7 @@ Otherwise, return a @code{kvp_list} object consisting of @var{list}
with the first value removed. NOTE: the returned list is not a copy! with the first value removed. NOTE: the returned list is not a copy!
@end deftypefun @end deftypefun
@deftypefun kvp_list* kvp_list_cons (kvp_value * @var{car}, kvp_list * @var{cdr}) @deftypefun kvp_list* kvp_list_cons (KvpValue * @var{car}, kvp_list * @var{cdr})
If either @var{car} or @var{cdr} is @code{NULL}, return @code{NULL}. Otherwise, If either @var{car} or @var{cdr} is @code{NULL}, return @code{NULL}. Otherwise,
return a @code{kvp_list} object consisting of the value of @var{car} followed return a @code{kvp_list} object consisting of the value of @var{car} followed
by the values of @var{cdr}. This function uses 'hand-over' semantics, i.e., by the values of @var{cdr}. This function uses 'hand-over' semantics, i.e.,
@ -2074,12 +2074,12 @@ Return the Transaction associated with @var{GUID}, or @code{NULL} if
there is no such Transaction. there is no such Transaction.
@end deftypefun @end deftypefun
@deftypefun {kvp_value *} xaccTransGetSlot (Transaction * @var{trans}, const char * @var{key}) @deftypefun {KvpValue *} xaccTransGetSlot (Transaction * @var{trans}, const char * @var{key})
Return the @code{kvp_value} associated with @var{key} in @var{trans}. Return the @code{KvpValue} associated with @var{key} in @var{trans}.
If there is none, @code{NULL} is returned. If there is none, @code{NULL} is returned.
@end deftypefun @end deftypefun
@deftypefun void xaccTransSetSlot (Split * @var{trans}, const char * @var{key}, const kvp_value * @var{value}) @deftypefun void xaccTransSetSlot (Split * @var{trans}, const char * @var{key}, const KvpValue * @var{value})
Associate a copy of @var{value} with @var{key} in @var{trans}. Associate a copy of @var{value} with @var{key} in @var{trans}.
@end deftypefun @end deftypefun

View File

@ -5047,7 +5047,7 @@ gnc_imap_find_account (GncImportMatchMap *imap,
const char *category, const char *category,
const char *key) const char *key)
{ {
kvp_value *value; KvpValue *value;
GncGUID * guid; GncGUID * guid;
if (!imap || !key) return NULL; if (!imap || !key) return NULL;
@ -5072,7 +5072,7 @@ gnc_imap_add_account (GncImportMatchMap *imap,
const char *key, const char *key,
Account *acc) Account *acc)
{ {
kvp_value *value; KvpValue *value;
if (!imap || !key || !acc || (strlen (key) == 0)) return; if (!imap || !key || !acc || (strlen (key) == 0)) return;
if (!category) if (!category)
@ -5120,7 +5120,7 @@ struct token_accounts_info
* \note Can always assume that keys are unique, reduces code in this function * \note Can always assume that keys are unique, reduces code in this function
*/ */
static void static void
buildTokenInfo(const char *key, kvp_value *value, gpointer data) buildTokenInfo(const char *key, KvpValue *value, gpointer data)
{ {
struct token_accounts_info *tokenInfo = (struct token_accounts_info*)data; struct token_accounts_info *tokenInfo = (struct token_accounts_info*)data;
struct account_token_count* this_account; struct account_token_count* this_account;
@ -5242,7 +5242,7 @@ gnc_imap_find_account_bayes (GncImportMatchMap *imap, GList *tokens)
GHashTable *final_probabilities = g_hash_table_new(g_str_hash, GHashTable *final_probabilities = g_hash_table_new(g_str_hash,
g_str_equal); g_str_equal);
struct account_info account_i; struct account_info account_i;
kvp_value* value; KvpValue* value;
kvp_frame* token_frame; kvp_frame* token_frame;
ENTER(" "); ENTER(" ");
@ -5407,10 +5407,10 @@ gnc_imap_add_account_bayes(GncImportMatchMap *imap,
Account *acc) Account *acc)
{ {
GList *current_token; GList *current_token;
kvp_value *value; KvpValue *value;
gint64 token_count; gint64 token_count;
char* account_fullname; char* account_fullname;
kvp_value *new_value; /* the value that will be added back into KvpValue *new_value; /* the value that will be added back into
* the kvp tree */ * the kvp tree */
ENTER(" "); ENTER(" ");

View File

@ -2553,7 +2553,7 @@ Transaction *
xaccTransReverse (Transaction *orig) xaccTransReverse (Transaction *orig)
{ {
Transaction *trans; Transaction *trans;
kvp_value *kvp_val; KvpValue *kvp_val;
g_return_val_if_fail(orig, NULL); g_return_val_if_fail(orig, NULL);
trans = xaccTransClone(orig); trans = xaccTransClone(orig);

View File

@ -170,7 +170,7 @@ get_random_list_element (GList *list)
g_list_length (list) - 1)); g_list_length (list) - 1));
} }
static kvp_value* get_random_kvp_value_depth (int type, gint depth); static KvpValue* get_random_kvp_value_depth (int type, gint depth);
static GList* static GList*
get_random_glist_depth (gint depth) get_random_glist_depth (gint depth)

View File

@ -17,7 +17,7 @@ Timespec* get_random_timespec(void);
void random_timespec_zero_nsec (gboolean zero_nsec); void random_timespec_zero_nsec (gboolean zero_nsec);
void random_timespec_usec_resolution (gboolean usec_resolution); void random_timespec_usec_resolution (gboolean usec_resolution);
kvp_value* get_random_kvp_value(int type); KvpValue* get_random_kvp_value(int type);
typedef struct typedef struct
{ {

View File

@ -130,7 +130,7 @@ GList *
gnc_ab_get_book_template_list(QofBook *b) gnc_ab_get_book_template_list(QofBook *b)
{ {
kvp_frame *frame = gnc_ab_get_book_kvp(b, FALSE); kvp_frame *frame = gnc_ab_get_book_kvp(b, FALSE);
kvp_value *value = kvp_frame_get_slot(frame, AB_TEMPLATES); KvpValue *value = kvp_frame_get_slot(frame, AB_TEMPLATES);
return kvp_value_get_glist(value); return kvp_value_get_glist(value);
} }
@ -138,7 +138,7 @@ void
gnc_ab_set_book_template_list(QofBook *b, GList *template_list) gnc_ab_set_book_template_list(QofBook *b, GList *template_list)
{ {
kvp_frame *frame = gnc_ab_get_book_kvp(b, TRUE); kvp_frame *frame = gnc_ab_get_book_kvp(b, TRUE);
kvp_value *value = kvp_value_new_glist_nc(template_list); KvpValue *value = kvp_value_new_glist_nc(template_list);
kvp_frame_set_slot_nc(frame, AB_TEMPLATES, value); kvp_frame_set_slot_nc(frame, AB_TEMPLATES, value);
qof_instance_set_dirty_flag(QOF_INSTANCE(b), TRUE); qof_instance_set_dirty_flag(QOF_INSTANCE(b), TRUE);
} }

View File

@ -112,7 +112,7 @@ gnc_ab_trans_templ_list_new_from_kvp_list(GList *v)
for (iter = v; iter; iter = iter->next) for (iter = v; iter; iter = iter->next)
{ {
kvp_frame *frame = kvp_value_get_frame((kvp_value*) iter->data); kvp_frame *frame = kvp_value_get_frame((KvpValue*) iter->data);
res = g_list_prepend(res, gnc_ab_trans_templ_new_from_kvp(frame)); res = g_list_prepend(res, gnc_ab_trans_templ_new_from_kvp(frame));
} }
res = g_list_reverse(res); res = g_list_reverse(res);
@ -171,7 +171,7 @@ gnc_ab_trans_templ_list_to_kvp_list(GList *k)
for (iter = k; iter; iter = iter->next) for (iter = k; iter; iter = iter->next)
{ {
GncABTransTempl *t = (GncABTransTempl*) iter->data; GncABTransTempl *t = (GncABTransTempl*) iter->data;
kvp_value *value = kvp_value_new_frame_nc(gnc_ab_trans_templ_to_kvp(t)); KvpValue *value = kvp_value_new_frame_nc(gnc_ab_trans_templ_to_kvp(t));
res = g_list_prepend(res, value); res = g_list_prepend(res, value);
} }
res = g_list_reverse(res); res = g_list_reverse(res);

View File

@ -110,8 +110,6 @@ do \b not use these in new code.
*/ */
#define kvp_frame KvpFrame #define kvp_frame KvpFrame
/** \deprecated Deprecated backwards compat token */ /** \deprecated Deprecated backwards compat token */
#define kvp_value KvpValue
/** \deprecated Deprecated backwards compat token */
#define kvp_value_t KvpValueType #define kvp_value_t KvpValueType
/** @name KvpFrame Constructors /** @name KvpFrame Constructors

View File

@ -862,7 +862,7 @@ gboolean qof_book_uses_autoreadonly (const QofBook *book)
gint qof_book_get_num_days_autoreadonly (const QofBook *book) gint qof_book_get_num_days_autoreadonly (const QofBook *book)
{ {
kvp_value *kvp_val; KvpValue *kvp_val;
double tmp = 0; double tmp = 0;
KvpFrame *frame = qof_instance_get_slots (QOF_INSTANCE (book)); KvpFrame *frame = qof_instance_get_slots (QOF_INSTANCE (book));