Defines | Functions | Variables

go-glib-extras.h File Reference

#include <goffice/utils/goffice-utils.h>
#include <glib.h>
#include <sys/types.h>
#include <glib-object.h>

Go to the source code of this file.

Defines

#define go_string_slist_copy(list)   go_slist_map (list, (GOMapFunc) g_strdup)
#define GO_SLIST_FOREACH(list, valtype, val, stmnt)
#define GO_SLIST_PREPEND(list, item)   (list = g_slist_prepend (list, item))
#define GO_SLIST_APPEND(list, item)   (list = g_slist_append (list, item))
#define GO_SLIST_REMOVE(list, item)   (list = g_slist_remove (list, item))
#define GO_SLIST_CONCAT(list_a, list_b)   (list_a = g_slist_concat (list_a, list_b))
#define GO_SLIST_REVERSE(list)   (list = g_slist_reverse (list))
#define GO_SLIST_SORT(list, cmp_func)   (list = g_slist_sort (list, cmp_func))
#define GO_LIST_FOREACH(list, valtype, val, stmnt)
#define GO_LIST_PREPEND(list, item)   (list = g_list_prepend (list, item))
#define GO_LIST_APPEND(list, item)   (list = g_list_append (list, item))
#define GO_LIST_REMOVE(list, item)   (list = g_list_remove (list, item))
#define GO_LIST_CONCAT(list_a, list_b)   (list_a = g_list_concat (list_a, list_b))
#define GO_LIST_REVERSE(list)   (list = g_list_reverse (list))
#define GO_LIST_SORT(list, cmp_func)   (list = g_list_sort (list, cmp_func))

Functions

void go_ptr_array_insert (GPtrArray *array, gpointer value, int index)
GSList * go_hash_keys (GHashTable *hash)
 go_hash_keys : : GHashTable
GSList * go_hash_values (GHashTable *hash)
 go_hash_values : : GHashTable
GSList * go_slist_map (GSList const *list, GOMapFunc map_func)
 go_slist_map: : list of some items : mapping function
GSList * go_slist_create (gpointer item1,...)
 go_slist_create: : itionally NULL : NULL terminated list of additional items
void go_slist_free_custom (GSList *list, GFreeFunc free_func)
 go_slist_free_custom: : list of some items : function freeing list item
GSList * go_strsplit_to_slist (char const *str, gchar delimiter)
gint go_list_index_custom (GList *list, gpointer data, GCompareFunc cmp_func)
void go_list_free_custom (GList *list, GFreeFunc free_func)
 go_list_free_custom: : list of some items : function freeing list item
int go_str_compare (void const *x, void const *y)
guint go_ascii_strcase_hash (gconstpointer v)
gint go_ascii_strcase_equal (gconstpointer v, gconstpointer v2)
gint go_utf8_collate_casefold (char const *a, char const *b)
char * go_utf8_strcapital (char const *p, gssize len)
 go_utf8_strcapital: : pointer to UTF-8 string : length in bytes, or -1.
void go_strescape (GString *target, char const *str)
char const * go_strunescape (GString *target, char const *str)
void go_string_append_gstring (GString *target, const GString *src)
char const * go_guess_encoding (char const *raw, size_t len, char const *user_guess, char **utf8_str)
char const * go_get_real_name (void)
 go_get_real_name :
void go_destroy_password (char *passwd)
 go_destroy_password : : The buffer to clear
GOMemChunkgo_mem_chunk_new (char const *name, size_t user_atom_size, size_t chunk_size)
void go_mem_chunk_destroy (GOMemChunk *chunk, gboolean expect_leaks)
gpointer go_mem_chunk_alloc (GOMemChunk *chunk)
gpointer go_mem_chunk_alloc0 (GOMemChunk *chunk)
void go_mem_chunk_free (GOMemChunk *chunk, gpointer mem)
void go_mem_chunk_foreach_leak (GOMemChunk *chunk, GFunc cb, gpointer user)
void go_object_toggle (gpointer object, const gchar *property_name)
 go_object_toggle: : GObject : name
GSList * go_object_properties_collect (GObject *obj)
void go_object_properties_apply (GObject *obj, GSList *props, gboolean changed_only)
void go_object_properties_free (GSList *props)

Variables

G_BEGIN_DECLS typedef gpointer(* GOMapFunc )(gpointer value)

Define Documentation

#define GO_LIST_APPEND (   list,
  item 
)    (list = g_list_append (list, item))
#define GO_LIST_CONCAT (   list_a,
  list_b 
)    (list_a = g_list_concat (list_a, list_b))
#define GO_LIST_FOREACH (   list,
  valtype,
  val,
  stmnt 
)
Value:
G_STMT_START { \
    GList *go_l; \
    for (go_l = (list); go_l != NULL; go_l = go_l->next) { \
        valtype *val = go_l->data; \
        stmnt \
        ; \
    } \
} G_STMT_END
#define GO_LIST_PREPEND (   list,
  item 
)    (list = g_list_prepend (list, item))
#define GO_LIST_REMOVE (   list,
  item 
)    (list = g_list_remove (list, item))
#define GO_LIST_REVERSE (   list  )     (list = g_list_reverse (list))
#define GO_LIST_SORT (   list,
  cmp_func 
)    (list = g_list_sort (list, cmp_func))
#define GO_SLIST_APPEND (   list,
  item 
)    (list = g_slist_append (list, item))
#define GO_SLIST_CONCAT (   list_a,
  list_b 
)    (list_a = g_slist_concat (list_a, list_b))
#define GO_SLIST_FOREACH (   list,
  valtype,
  val,
  stmnt 
)
Value:
G_STMT_START { \
    GSList const *go_l; \
    for (go_l = (list); go_l != NULL; go_l = go_l->next) { \
        valtype *val = go_l->data; \
        stmnt \
        ; \
    } \
} G_STMT_END
#define GO_SLIST_PREPEND (   list,
  item 
)    (list = g_slist_prepend (list, item))
#define GO_SLIST_REMOVE (   list,
  item 
)    (list = g_slist_remove (list, item))
#define GO_SLIST_REVERSE (   list  )     (list = g_slist_reverse (list))
#define GO_SLIST_SORT (   list,
  cmp_func 
)    (list = g_slist_sort (list, cmp_func))
#define go_string_slist_copy (   list  )     go_slist_map (list, (GOMapFunc) g_strdup)

Function Documentation

gint go_ascii_strcase_equal ( gconstpointer  v,
gconstpointer  v2 
)
guint go_ascii_strcase_hash ( gconstpointer  v  ) 

References s.

void go_destroy_password ( char *  passwd  ) 

go_destroy_password : : The buffer to clear

Overwrite a string holding a password. This is a separate routine to ensure that the compiler does not try to outsmart us.

Note: this does not free the memory.

go_destroy_password : : The buffer to clear

Overwrite a string holding a password. This is a separate routine to ensure that the compiler does not try to outsmart us.

Note: this does not free the memory.

char const* go_get_real_name ( void   ) 

go_get_real_name :

Returns: a utf8 encoded string with the current user name. Caller should _NOT_ free the result.

Return a utf8 encoded string with the current user name. Caller should _NOT_ free the result.

References go_guess_encoding().

char const* go_guess_encoding ( char const *  raw,
size_t  len,
char const *  user_guess,
char **  utf8_str 
)
GSList* go_hash_keys ( GHashTable *  hash  ) 

go_hash_keys : : GHashTable

Collects an unordered list of the keys in .

Returns: a list which the caller needs to free. The content has not additional references added

Collects an unordered list of the keys in .

Returns a list which the caller needs to free. The content has not additional references added

References cb_hash_collect_keys().

GSList* go_hash_values ( GHashTable *  hash  ) 

go_hash_values : : GHashTable

Collects an unordered list of the values in .

Returns: a list which the caller needs to free. The content has not additional references added

Collects an unordered list of the values in .

Returns a list which the caller needs to free. The content has not additional references added

References cb_hash_collect_values().

void go_list_free_custom ( GList *  list,
GFreeFunc  free_func 
)

go_list_free_custom: : list of some items : function freeing list item

Clears a list, calling for each list item.

gint go_list_index_custom ( GList *  list,
gpointer  data,
GCompareFunc  cmp_func 
)
gpointer go_mem_chunk_alloc ( GOMemChunk chunk  ) 
gpointer go_mem_chunk_alloc0 ( GOMemChunk chunk  ) 
void go_mem_chunk_destroy ( GOMemChunk chunk,
gboolean  expect_leaks 
)
void go_mem_chunk_foreach_leak ( GOMemChunk chunk,
GFunc  cb,
gpointer  user 
)
void go_mem_chunk_free ( GOMemChunk chunk,
gpointer  mem 
)
GOMemChunk* go_mem_chunk_new ( char const *  name,
size_t  user_atom_size,
size_t  chunk_size 
)
void go_object_properties_apply ( GObject *  obj,
GSList *  props,
gboolean  changed_only 
)
GSList* go_object_properties_collect ( GObject *  obj  ) 
void go_object_properties_free ( GSList *  props  ) 
void go_object_toggle ( gpointer  object,
const gchar *  property_name 
)

go_object_toggle: : GObject : name

Toggle a boolean object property.

void go_ptr_array_insert ( GPtrArray *  array,
gpointer  value,
int  index 
)
GSList* go_slist_create ( gpointer  item1,
  ... 
)

go_slist_create: : itionally NULL : NULL terminated list of additional items

Creates a GList from NULL-terminated list of arguments.

Returns: created list.

go_slist_create: : itionally NULL : NULL terminated list of additional items

Creates a GList from NULL-terminated list of arguments.

Return value: created list.

void go_slist_free_custom ( GSList *  list,
GFreeFunc  free_func 
)

go_slist_free_custom: : list of some items : function freeing list item

Clears a list, calling for each list item.

GSList* go_slist_map ( GSList const *  list,
GOMapFunc  map_func 
)

go_slist_map: : list of some items : mapping function

References GO_SLIST_FOREACH, and GO_SLIST_PREPEND.

int go_str_compare ( void const *  x,
void const *  y 
)
void go_strescape ( GString *  target,
char const *  str 
)
void go_string_append_gstring ( GString *  target,
const GString *  src 
)
GSList* go_strsplit_to_slist ( char const *  str,
gchar  delimiter 
)
char const* go_strunescape ( GString *  target,
char const *  str 
)
gint go_utf8_collate_casefold ( char const *  a,
char const *  b 
)
char* go_utf8_strcapital ( const char *  p,
gssize  len 
)

go_utf8_strcapital: : pointer to UTF-8 string : length in bytes, or -1.

Similar to g_utf8_strup and g_utf8_strup, except that this function creates a string "Very Much Like: This, One".

Return value: newly allocated string.


Variable Documentation

G_BEGIN_DECLS typedef gpointer(* GOMapFunc)(gpointer value)