qofutil.h File Reference


Detailed Description

QOF utility functions.

Author:
Copyright (C) 1997 Robin D. Clark <rclark@cs.hmc.edu>

Copyright (C) 2000 Bill Gribble <grib@billgribble.com>

Copyright (C) 1997-2002,2004 Linas Vepstas <linas@linas.org>

Copyright 2006 Neil Williams <linux@codehelp.co.uk>

Definition in file qofutil.h.

#include <stddef.h>
#include "qoflog.h"
#include "qofdate.h"
#include "qofutil.h"
#include "qofbackend-p.h"
#include "qofbook.h"
#include "qofinstance.h"

Go to the source code of this file.

Defines

#define QOF_SCANF_LLD   "%qd"
#define QOF_MOD_UTIL   "qof-utilities"
#define stpcpy   g_stpcpy
 omitted if stpcpy exists.
#define CACHE_INSERT(str)   qof_util_string_cache_insert((gconstpointer)(str))
#define CACHE_REMOVE(str)   qof_util_string_cache_remove((str))
#define CACHE_REPLACE(dst, src)
#define QOF_CACHE_NEW(void)   qof_util_string_cache_insert("")
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

gint safe_strcmp (const gchar *da, const gchar *db)
gint safe_strcasecmp (const gchar *da, const gchar *db)
gint null_strcmp (const gchar *da, const gchar *db)
gchar * strncasestr (const guchar *str1, const guchar *str2, size_t len)
gchar * strcasestr (const gchar *str1, const gchar *str2)
gchar * ultostr (gulong val, gint base)
gboolean qof_util_string_isnum (const guchar *s)
gint qof_util_double_compare (gdouble v1, gdouble v2)
 Compare two gdouble values.
const gchar * qof_util_whitespace_filter (const gchar *val)
gint qof_util_bool_to_int (const gchar *val)
gchar * qof_util_param_to_string (QofEntity *ent, const QofParam *param)
 Converts a parameter to a string for storage or display.
gboolean qof_util_param_set_string (QofEntity *ent, const QofParam *param, const gchar *value_string)
 Set a parameter from a value string.
gchar * qof_util_make_utf8 (gchar *string)
 Convert strings received from the wrapped objects into UTF-8.
void qof_util_string_cache_destroy (void)
void qof_util_string_cache_remove (gconstpointer key)
gpointer qof_util_string_cache_insert (gconstpointer key)
gboolean qof_util_param_edit (QofInstance *inst, const QofParam *param)
 Prepare to edit a parameter.
gboolean qof_util_param_commit (QofInstance *inst, const QofParam *param)
 Commit this parameter change, with undo support.
Convenience wrappers
void qof_init (void)
 Initialise the Query Object Framework.
void qof_close (void)
 Safely close down the Query Object Framework.


Generated on Thu Jan 31 22:50:26 2008 for QOF by  doxygen 1.5.4