GnuCash  5.6-150-g038405b370+
Macros | Functions
qofutil.h File Reference

QOF utility functions. More...

#include <stddef.h>
#include "qof.h"
#include "qoflog.h"
#include "qofbackend.h"
#include "qofclass.h"
#include "qofbook.h"
#include "qofinstance.h"

Go to the source code of this file.

Macros

#define QOF_MOD_UTIL   "qof.utilities"
 
#define stpcpy   g_stpcpy
 
typedef enum as string macros
#define ENUM_BODY(name, value)   name value,
 
#define AS_STRING_CASE(name, value)   case name: { return #name; }
 
#define FROM_STRING_CASE(name, value)
 
#define DEFINE_ENUM(name, list)
 
#define AS_STRING_DEC(name, list)   const gchar* name##asString(name n);
 
#define AS_STRING_FUNC(name, list)
 
#define FROM_STRING_DEC(name, list)
 
#define FROM_STRING_FUNC(name, list)
 
enum as string with no typedef

Similar but used when the enum is NOT a typedef Make sure you use the DEFINE_ENUM_NON_TYPEDEF macro.

You can precede the FROM_STRING_FUNC_NON_TYPEDEF and AS_STRING_FUNC_NON_TYPEDEF macros with the keyword static if appropriate.

ENUM_BODY is used in both types.

#define DEFINE_ENUM_NON_TYPEDEF(name, list)
 
#define FROM_STRING_DEC_NON_TYPEDEF(name, list)
 
#define FROM_STRING_CASE_NON_TYPEDEF(name, value)   if (strcmp(str, #name) == 0) { *type = name; }
 
#define FROM_STRING_FUNC_NON_TYPEDEF(name, list)
 
#define AS_STRING_DEC_NON_TYPEDEF(name, list)   const gchar* name##asString(enum name n);
 
#define AS_STRING_FUNC_NON_TYPEDEF(name, list)
 
#define AS_STRING_CASE_NON_TYPEDEF(name, value)   case name: { return #name; }
 

Functions

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 the GCompareFunc applied to the keys. More...
 
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. More...
 
gint safe_strcasecmp (const gchar *da, const gchar *db)
 case sensitive comparison of strings da and db - either may be NULL. More...
 
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 null. More...
 
gchar * ultostr (gulong val, gint base)
 The ultostr() subroutine is the inverse of strtoul(). More...
 
gboolean gnc_strisnum (const gchar *s)
 Returns true if string s is a number, possibly surrounded by whitespace. More...
 
gboolean qof_begin_edit (QofInstance *inst)
 begin_edit More...
 
gboolean qof_commit_edit (QofInstance *inst)
 commit_edit helpers More...
 
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 More...
 
Convenience wrappers
void qof_init (void)
 Initialise the Query Object Framework. More...
 
void qof_close (void)
 Safely close down the Query Object Framework. More...
 

Detailed Description

QOF utility functions.

Author
Copyright (C) 1997 Robin D. Clark rclar.nosp@m.k@cs.nosp@m..hmc..nosp@m.edu
Copyright (C) 2000 Bill Gribble grib@.nosp@m.bill.nosp@m.gribb.nosp@m.le.c.nosp@m.om
Copyright (C) 1997-2002,2004 Linas Vepstas linas.nosp@m.@lin.nosp@m.as.or.nosp@m.g
Copyright 2006 Neil Williams linux.nosp@m.@cod.nosp@m.ehelp.nosp@m..co..nosp@m.uk

Definition in file qofutil.h.