48#define QOF_MOD_UTIL "qof.utilities"
53#define ENUM_BODY(name, value) \
56#define AS_STRING_CASE(name, value) \
57 case name: { return #name; }
59#define FROM_STRING_CASE(name, value) \
60 if (strcmp(str, #name) == 0) { \
63#define DEFINE_ENUM(name, list) \
68#define AS_STRING_DEC(name, list) \
69 const gchar* name##asString(name n);
71#define AS_STRING_FUNC(name, list) \
72 const gchar* name##asString(name n) { \
74 list(AS_STRING_CASE) \
75 default: return ""; } }
77#define FROM_STRING_DEC(name, list) \
78 name name##fromString \
81#define FROM_STRING_FUNC(name, list) \
82 name name##fromString \
83 (const gchar* str) { \
84 if(str == NULL) { return 0; } \
85 list(FROM_STRING_CASE) \
103#define DEFINE_ENUM_NON_TYPEDEF(name, list) \
108#define FROM_STRING_DEC_NON_TYPEDEF(name, list) \
109 void name##fromString \
110 (const gchar* str, enum name *type);
112#define FROM_STRING_CASE_NON_TYPEDEF(name, value) \
113 if (strcmp(str, #name) == 0) { *type = name; }
115#define FROM_STRING_FUNC_NON_TYPEDEF(name, list) \
116 void name##fromString \
117 (const gchar* str, enum name *type) { \
118 if(str == NULL) { return; } \
119 list(FROM_STRING_CASE_NON_TYPEDEF) }
121#define AS_STRING_DEC_NON_TYPEDEF(name, list) \
122 const gchar* name##asString(enum name n);
124#define AS_STRING_FUNC_NON_TYPEDEF(name, list) \
125 const gchar* name##asString(enum name n) { \
127 list(AS_STRING_CASE_NON_TYPEDEF) \
128 default: return ""; } }
130#define AS_STRING_CASE_NON_TYPEDEF(name, value) \
131 case name: { return #name; }
187gint
null_strcmp (
const gchar * da,
const gchar * db);
192gchar *
ultostr (gulong val, gint base);
199#define stpcpy g_stpcpy
QofBackendError
The errors that can be reported to the GUI & other front-end users.
gint null_strcmp(const gchar *da, const gchar *db)
The null_strcmp compares strings a and b the same way that strcmp() does, except that either may be n...
gint safe_strcasecmp(const gchar *da, const gchar *db)
case sensitive comparison of strings da and db - either may be NULL.
gboolean qof_commit_edit_part2(QofInstance *inst, void(*on_error)(QofInstance *, QofBackendError), void(*on_done)(QofInstance *), void(*on_free)(QofInstance *))
part2 – deal with the backend
gboolean gnc_strisnum(const gchar *s)
Returns true if string s is a number, possibly surrounded by whitespace.
void qof_init(void)
Initialise the Query Object Framework.
gboolean qof_commit_edit(QofInstance *inst)
commit_edit helpers
void g_hash_table_foreach_sorted(GHashTable *hash_table, GHFunc func, gpointer user_data, GCompareFunc compare_func)
Calls the given function for each of the key/value pairs in the GHashTable in an order determined by ...
gchar * ultostr(gulong val, gint base)
The ultostr() subroutine is the inverse of strtoul().
gboolean qof_utf8_substr_nocase(const gchar *haystack, const gchar *needle)
Search for an occurrence of the substring needle in the string haystack, ignoring case.
gboolean qof_begin_edit(QofInstance *inst)
begin_edit
void qof_close(void)
Safely close down the Query Object Framework.
API for data storage Backend.
Encapsulate all the information about a dataset.
API for registering parameters on objects.
Object instance holds common fields that most gnucash objects use.