camel-string-utils

camel-string-utils

Synopsis

int                 camel_strcase_equal                 (gconstpointer a,
                                                         gconstpointer b);
guint               camel_strcase_hash                  (gconstpointer v);
void                camel_string_list_free              (GList *string_list);
char *              camel_strstrcase                    (const char *haystack,
                                                         const char *needle);
const char *        camel_strdown                       (char *str);
char                camel_tolower                       (char c);
char                camel_toupper                       (char c);
const char *        camel_pstring_add                   (char *str,
                                                         gboolean own);
const char *        camel_pstring_strdup                (const char *s);
void                camel_pstring_free                  (const char *s);
const char *        camel_pstring_peek                  (const char *str);

Description

Details

camel_strcase_equal ()

int                 camel_strcase_equal                 (gconstpointer a,
                                                         gconstpointer b);

a :

b :

Returns :


camel_strcase_hash ()

guint               camel_strcase_hash                  (gconstpointer v);

v :

Returns :


camel_string_list_free ()

void                camel_string_list_free              (GList *string_list);

string_list :


camel_strstrcase ()

char *              camel_strstrcase                    (const char *haystack,
                                                         const char *needle);

haystack :

needle :

Returns :


camel_strdown ()

const char *        camel_strdown                       (char *str);

str :

Returns :


camel_tolower ()

char                camel_tolower                       (char c);

ASCII to-lower function.

c :

Returns :


camel_toupper ()

char                camel_toupper                       (char c);

ASCII to-upper function.

c :

Returns :


camel_pstring_add ()

const char *        camel_pstring_add                   (char *str,
                                                         gboolean own);

Add the string to the pool.

The NULL and empty strings are special cased to constant values.

str :

string to add to the string pool

own :

whether the string pool will own the memory pointed to by str, if str is not yet in the pool

Returns :

A pointer to an equivalent string of s. Use camel_pstring_free() when it is no longer needed.

camel_pstring_strdup ()

const char *        camel_pstring_strdup                (const char *s);

Create a new pooled string entry for the string s. A pooled string is a table where common strings are uniquified to the same pointer value. They are also refcounted, so freed when no longer in use. In a thread-safe manner.

The NULL and empty strings are special cased to constant values.

s :

String to copy.

Returns :

A pointer to an equivalent string of s. Use camel_pstring_free() when it is no longer needed.

camel_pstring_free ()

void                camel_pstring_free                  (const char *s);

De-ref a pooled string. If no more refs exist to this string, it will be deallocated.

NULL and the empty string are special cased.

s :

String to free.

camel_pstring_peek ()

const char *        camel_pstring_peek                  (const char *str);

Add return the string from the pool.

The NULL and empty strings are special cased to constant values.

str :

string to fetch to the string pool

Returns :

A pointer to an equivalent string of s. Use camel_pstring_free() when it is no longer needed.