32 qof_kvp_array_va (
KvpFrame * kvp_root,
const gchar *path,
33 QofTime *qt,
const gchar *first_name, va_list ap)
54 guid = va_arg (ap,
const GUID *);
58 name = va_arg (ap,
const char *);
68 QofTime *qt,
const gchar *first_name, ...)
72 va_start (ap, first_name);
73 cwd = qof_kvp_array_va (pwd, path, qt, first_name, ap);
80 #define MATCH_GUID(elt) { \ 81 KvpFrame *fr = kvp_value_get_frame (elt); \ 83 GUID *guid = kvp_frame_get_guid (fr, guid_name); \ 84 if (guid && guid_equal (desired_guid, guid)) return fr; \ 90 const gchar *guid_name,
GUID * desired_guid)
96 arr = kvp_frame_get_value (root, path);
97 valtype = kvp_value_get_type (arr);
123 GList *node, *listhead;
125 arr = kvp_frame_get_value (root, path);
126 valtype = kvp_value_get_type (arr);
144 for (node = listhead; node; node = node->next)
149 listhead = g_list_remove_link (listhead, node);
150 g_list_free_1 (node);
162 qof_kvp_bag_get_first (
KvpFrame * root,
const gchar *path)
168 arr = kvp_frame_get_value (root, path);
169 valtype = kvp_value_get_type (arr);
187 KvpFrame * kvp_from,
const gchar *frompath)
191 fr = qof_kvp_bag_get_first (kvp_from, frompath);
196 fr = qof_kvp_bag_get_first (kvp_from, frompath);
201 kv_pair_helper (gpointer key, gpointer val, gpointer user_data)
203 GSList **result = (GSList **) user_data;
208 *result = g_slist_prepend (*result, kvp);
214 GSList *result_list = NULL;
215 g_hash_table_foreach (table, kv_pair_helper, &result_list);
220 g_hash_table_kv_pair_free_gfunc (gpointer data, gpointer user_data
221 __attribute__ ((unused)))
230 if (0 ==
safe_strcmp (QOF_TYPE_INT64, type_string))
232 if (0 ==
safe_strcmp (QOF_TYPE_DOUBLE, type_string))
234 if (0 ==
safe_strcmp (QOF_TYPE_NUMERIC, type_string))
236 if (0 ==
safe_strcmp (QOF_TYPE_STRING, type_string))
252 return QOF_TYPE_INT64;
257 return QOF_TYPE_DOUBLE;
262 return QOF_TYPE_NUMERIC;
267 return QOF_TYPE_STRING;
272 return QOF_TYPE_GUID;
277 return QOF_TYPE_BOOLEAN;
282 return QOF_TYPE_TIME;
Private KVP utilities for backends etc.
GList * kvp_value_replace_glist_nc(KvpValue *value, GList *newlist)
void kvp_frame_set_guid(KvpFrame *frame, const gchar *path, const GUID *guid)
Store a copy of the GUID at the indicated path.
QofIdTypeConst kvp_value_type_to_qof_id(KvpValueType n)
Convert a KvpValueType to a QofIdType.
KvpValueType
possible types in the union KvpValue
void kvp_frame_set_time(KvpFrame *frame, const gchar *path, QofTime *qt)
Store a copy of the QofTime at the indicated path.
void kvp_frame_add_frame_nc(KvpFrame *frame, const gchar *path, KvpFrame *fr)
Add the frame to the glist bag without copying.
struct _KvpFrame KvpFrame
void qof_kvp_bag_remove_frame(KvpFrame *root, const gchar *path, KvpFrame *fr)
void qof_kvp_bag_merge(KvpFrame *kvp_into, const gchar *intopath, KvpFrame *kvp_from, const gchar *frompath)
128bit denominator/numerator maths.
KvpValue * kvp_frame_replace_value_nc(KvpFrame *frame, const gchar *key_path, KvpValue *new_value)
struct _KvpValue KvpValue
KvpFrame * qof_kvp_bag_add(KvpFrame *pwd, const gchar *path, QofTime *qt, const gchar *first_name,...)
KvpValueType qof_id_to_kvp_value_type(QofIdTypeConst type_string)
Convert a QofIdType to a KvpValueType.
GSList * g_hash_table_key_value_pairs(GHashTable *table)
GList * kvp_value_get_glist(const KvpValue *value)
KvpFrame * kvp_value_replace_frame_nc(KvpValue *value, KvpFrame *newframe)
const gchar * QofIdTypeConst
struct QofTime64 QofTime
Use a 64-bit signed int QofTime.
KvpFrame * qof_kvp_bag_find_by_guid(KvpFrame *root, const gchar *path, const gchar *guid_name, GUID *desired_guid)
KvpFrame * kvp_frame_new(void)
gint safe_strcmp(const gchar *da, const gchar *db)
KvpFrame * kvp_value_get_frame(const KvpValue *value)
void kvp_value_delete(KvpValue *value)
64bit time/date handling.