43 #define QOF_MOD_UTIL "qof-utilities" 48 #define ENUM_BODY(name, value) \ 51 #define AS_STRING_CASE(name, value) \ 52 case name: { return #name; } 54 #define FROM_STRING_CASE(name, value) \ 55 if (strcmp(str, #name) == 0) { \ 58 #define DEFINE_ENUM(name, list) \ 63 #define AS_STRING_DEC(name, list) \ 64 const gchar* name##asString(name n); 66 #define AS_STRING_FUNC(name, list) \ 67 const gchar* name##asString(name n) { \ 69 list(AS_STRING_CASE) \ 70 default: return ""; } } 72 #define FROM_STRING_DEC(name, list) \ 73 name name##fromString \ 76 #define FROM_STRING_FUNC(name, list) \ 77 name name##fromString \ 78 (const gchar* str) { \ 79 if(str == NULL) { return 0; } \ 80 list(FROM_STRING_CASE) \ 98 #define DEFINE_ENUM_NON_TYPEDEF(name, list) \ 103 #define FROM_STRING_DEC_NON_TYPEDEF(name, list) \ 104 void name##fromString \ 105 (const gchar* str, enum name *type); 107 #define FROM_STRING_CASE_NON_TYPEDEF(name, value) \ 108 if (strcmp(str, #name) == 0) { *type = name; } 110 #define FROM_STRING_FUNC_NON_TYPEDEF(name, list) \ 111 void name##fromString \ 112 (const gchar* str, enum name *type) { \ 113 if(str == NULL) { return; } \ 114 list(FROM_STRING_CASE_NON_TYPEDEF) } 116 #define AS_STRING_DEC_NON_TYPEDEF(name, list) \ 117 const gchar* name##asString(enum name n); 119 #define AS_STRING_FUNC_NON_TYPEDEF(name, list) \ 120 const gchar* name##asString(enum name n) { \ 122 list(AS_STRING_CASE_NON_TYPEDEF) \ 123 default: return ""; } } 125 #define AS_STRING_CASE_NON_TYPEDEF(name, value) \ 126 case name: { return #name; } 166 gint
safe_strcmp (
const gchar * da,
const gchar * db);
186 gint
null_strcmp (
const gchar * da,
const gchar * db);
191 extern gchar *
strncasestr (
const guchar * str1,
const guchar * str2,
195 extern gchar *strcasestr (
const gchar * str1,
const gchar * str2);
201 gchar *
ultostr (gulong val, gint base);
213 #define stpcpy g_stpcpy 259 const gchar * value_string);
315 #define CACHE_INSERT(str) qof_util_string_cache_insert((gconstpointer)(str)) 316 #define CACHE_REMOVE(str) qof_util_string_cache_remove((str)) 325 #define CACHE_REPLACE(dst, src) do { \ 326 gpointer tmp = CACHE_INSERT((src)); \ 327 CACHE_REMOVE((dst)); \ 331 #define QOF_CACHE_NEW(void) qof_util_string_cache_insert("") gchar * qof_util_make_utf8(gchar *string)
Convert strings received from the wrapped objects into UTF-8.
const gchar * qof_util_whitespace_filter(const gchar *val)
gint safe_strcasecmp(const gchar *da, const gchar *db)
Object instance holds common fields that most QofObjects use.
gint qof_util_bool_to_int(const gchar *val)
gboolean qof_util_param_edit(QofInstance *inst, const QofParam *param)
Prepare to edit a parameter.
QOF error logging and tracing facility.
gpointer qof_util_string_cache_insert(gconstpointer key)
void qof_util_string_cache_remove(gconstpointer key)
void qof_util_string_cache_destroy(void)
gchar * qof_util_param_to_string(QofEntity *ent, const QofParam *param)
Converts a parameter to a string for storage or display.
gint null_strcmp(const gchar *da, const gchar *db)
gboolean qof_util_param_commit(QofInstance *inst, const QofParam *param)
Commit this parameter change, with undo support.
64bit Date handling routines
gchar * ultostr(gulong val, gint base)
gboolean qof_util_param_set_string(QofEntity *ent, const QofParam *param, const gchar *value_string)
Set a parameter from a value string.
Encapsulate all the information about a dataset.
void qof_close(void)
Safely close down the Query Object Framework.
private api for data storage backend
gboolean qof_util_string_isnum(const guchar *s)
gint qof_util_double_compare(gdouble v1, gdouble v2)
Compare two gdouble values.
gint safe_strcmp(const gchar *da, const gchar *db)
gchar * strncasestr(const guchar *str1, const guchar *str2, size_t len)
void qof_init(void)
Initialise the Query Object Framework.