GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
xml-helpers.h
1 
2 /* xml-helpers.h
3  * Miscellaneous bogus helper routines.
4  */
5 
6 static inline void
7 maybe_add_int (xmlNodePtr ptr, const char *tag, gint val)
8 {
9  if (val)
10  xmlAddChild (ptr, int_to_dom_tree (tag, val));
11 }
12 
13 static inline void
14 maybe_add_numeric (xmlNodePtr ptr, const char *tag, gnc_numeric val)
15 {
16  if (!gnc_numeric_zero_p (val))
17  xmlAddChild (ptr, gnc_numeric_to_dom_tree (tag, &val));
18 }
19 
20 static inline void
21 maybe_add_string (xmlNodePtr ptr, const char *tag, const char *str)
22 {
23  if (str && strlen(str) > 0)
24  xmlAddChild (ptr, text_to_dom_tree (tag, str));
25 }
26 
27 static inline void
28 maybe_add_guid (xmlNodePtr ptr, const char *tag, QofInstance *inst)
29 {
30  if (inst)
31  xmlAddChild (ptr, guid_to_dom_tree (tag,
32  qof_instance_get_guid (inst)));
33 }
34 
const GncGUID * qof_instance_get_guid(gconstpointer)
gboolean gnc_numeric_zero_p(gnc_numeric a)