Files | |
file | gnc-engine-util.h |
GnuCash engine utility functions. | |
Defines | |
#define | SAFE_STRCMP_REAL(fcn, da, db) |
#define | SAFE_STRCMP(da, db) SAFE_STRCMP_REAL(strcmp,(da),(db)) |
#define | SAFE_STRCASECMP(da, db) SAFE_STRCMP_REAL(strcasecmp,(da),(db)) |
#define | GNC_SCANF_LLD "%qd" |
#define | stpcpy gnc_stpcpy |
Functions | |
int | safe_strcmp (const char *da, const char *db) |
int | safe_strcasecmp (const char *da, const char *db) |
int | null_strcmp (const char *da, const char *db) |
char * | strncasestr (const char *str1, const char *str2, size_t len) |
char * | strcasestr (const char *str1, const char *str2) |
char * | ultostr (unsigned long val, int base) |
gboolean | gnc_strisnum (const char *s) |
char * | gnc_stpcpy (char *dest, const char *src) |
const char * | qof_util_whitespace_filter (const char *val) |
int | qof_util_bool_to_int (const char *val) |
GCache * | gnc_engine_get_string_cache (void) |
void | gnc_engine_string_cache_destroy (void) |
|
Value: { \ if ((da) && (db)) { \ if ((da) != (db)) { \ int retval = fcn ((da), (db)); \ /* if strings differ, return */ \ if (retval) return retval; \ } \ } else \ if ((!(da)) && (db)) { \ return -1; \ } else \ if ((da) && (!(db))) { \ return +1; \ } \ } |
|
Get the gnc_string_cache. Create it if it doesn't exist already |
|
Local copy of stpcpy, used wtih libc's that don't have one. |
|
Returns true if string s is a number, possibly surrounded by whitespace. |
|
The null_strcmp compares strings a and b the same way that strcmp() does, except that either may be null. This routine assumes that a null string is equal to the empty string. |
|
Return integer 1 if the string starts with 't' or 'T' or contains the word 'true' or 'TRUE'; if string is a number, return that number. (Leading whitespace is ignored). |
|
Return NULL if the field is whitespace (blank, tab, formfeed etc.) Else return pointer to first non-whitespace character. |
|
The safe_strcmp compares strings a and b the same way that strcmp() does, except that either may be null. This routine assumes that a non-null string is always greater than a null string. |
|
Search for str2 in first nchar chars of str1, ignore case. Return pointer to first match, or null. These are just like that strnstr and the strstr functions, except that they ignore the case. |
|
The ultostr() subroutine is the inverse of strtoul(). It accepts a number and prints it in the indicated base. The returned string should be g_freed when done. |