51 # define QOF_SCANF_LLD "%lld"
54 # define QOF_SCANF_LLD "%qd"
57 # define QOF_SCANF_LLD "%I64d"
59 # error "No scanf format string is known for LLD. Fix your ./configure so that the correct one is detected!"
64 #define QOF_MOD_UTIL "qof.utilities"
69 #define ENUM_BODY(name, value) \
72 #define AS_STRING_CASE(name, value) \
73 case name: { return #name; }
75 #define FROM_STRING_CASE(name, value) \
76 if (strcmp(str, #name) == 0) { \
79 #define DEFINE_ENUM(name, list) \
84 #define AS_STRING_DEC(name, list) \
85 const gchar* name##asString(name n);
87 #define AS_STRING_FUNC(name, list) \
88 const gchar* name##asString(name n) { \
90 list(AS_STRING_CASE) \
91 default: return ""; } }
93 #define FROM_STRING_DEC(name, list) \
94 name name##fromString \
97 #define FROM_STRING_FUNC(name, list) \
98 name name##fromString \
99 (const gchar* str) { \
100 if(str == NULL) { return 0; } \
101 list(FROM_STRING_CASE) \
119 #define DEFINE_ENUM_NON_TYPEDEF(name, list) \
124 #define FROM_STRING_DEC_NON_TYPEDEF(name, list) \
125 void name##fromString \
126 (const gchar* str, enum name *type);
128 #define FROM_STRING_CASE_NON_TYPEDEF(name, value) \
129 if (strcmp(str, #name) == 0) { *type = name; }
131 #define FROM_STRING_FUNC_NON_TYPEDEF(name, list) \
132 void name##fromString \
133 (const gchar* str, enum name *type) { \
134 if(str == NULL) { return; } \
135 list(FROM_STRING_CASE_NON_TYPEDEF) }
137 #define AS_STRING_DEC_NON_TYPEDEF(name, list) \
138 const gchar* name##asString(enum name n);
140 #define AS_STRING_FUNC_NON_TYPEDEF(name, list) \
141 const gchar* name##asString(enum name n) { \
143 list(AS_STRING_CASE_NON_TYPEDEF) \
144 default: return ""; } }
146 #define AS_STRING_CASE_NON_TYPEDEF(name, value) \
147 case name: { return #name; }
203 gint
null_strcmp (
const gchar * da,
const gchar * db);
208 gchar *
ultostr (gulong val, gint base);
215 #define stpcpy g_stpcpy
API for data storage Backend.
QofBackendError
The errors that can be reported to the GUI & other front-end users.
gint safe_strcasecmp(const gchar *da, const gchar *db)
Object instance holds common fields that most gnucash objects use.
gboolean qof_commit_edit(QofInstance *inst)
gboolean gnc_strisnum(const gchar *s)
gboolean qof_begin_edit(QofInstance *inst)
gint null_strcmp(const gchar *da, const gchar *db)
gchar * ultostr(gulong val, gint base)
gboolean qof_commit_edit_part2(QofInstance *inst, void(*on_error)(QofInstance *, QofBackendError), void(*on_done)(QofInstance *), void(*on_free)(QofInstance *))
void g_hash_table_foreach_sorted(GHashTable *hash_table, GHFunc func, gpointer user_data, GCompareFunc compare_func)
Encapsulate all the information about a dataset.
API for registering paramters on objects.
void qof_close(void)
Safely close down the Query Object Framework.
gboolean qof_utf8_substr_nocase(const gchar *haystack, const gchar *needle)
void qof_init(void)
Initialise the Query Object Framework.