2006-08-17 Aaron Bockover <abockover@novell.com>
[mono.git] / eglib / src / glib.h
index 29f74d73f297b078de519c35442806073a6f2c4a..60aea1688b1936da0fdfa20572578c6a5dabc1cf 100644 (file)
@@ -5,6 +5,22 @@
 #include <stdlib.h>
 #include <string.h>
 
+/*
+ * Basic data types
+ */
+typedef int            gboolean;
+typedef int            gint;
+typedef unsigned int   gsize;
+typedef unsigned int   guint;
+typedef short          gshort;
+typedef unsigned short gushort;
+typedef long           glong;
+typedef unsigned long  gulong;
+typedef void *         gpointer;
+typedef const void *   gconstpointer;
+typedef char           gchar;
+typedef unsigned char  guchar;
+
 /*
  * Macros
  */
 #define g_renew(struct_type, mem, n_structs) realloc (mem, sizeof (struct_type) * n_structs)
 #define g_alloca(size)         alloca (size)
 
+gpointer g_memdup (gconstpointer mem, guint byte_size);
+
 /*
  * Misc.
  */
 #define g_atexit(func) ((void) atexit (func))
-/*
- * Basic data types
- */
-typedef int            gboolean;
-typedef int            gint;
-typedef unsigned int   gsize;
-typedef unsigned int   guint;
-typedef short          gshort;
-typedef unsigned short gushort;
-typedef long           glong;
-typedef unsigned long  gulong;
-typedef void *         gpointer;
-typedef const void *   gconstpointer;
-typedef char           gchar;
-typedef unsigned char  guchar;
-
 /*
  * Precondition macros
  */
@@ -70,7 +72,8 @@ typedef unsigned char  guchar;
  * Hashtables
  */
 typedef struct _GHashTable GHashTable;
-typedef void     (* GFunc)         (gpointer data, gpointer user_data);
+typedef void     (*GFunc)          (gpointer data, gpointer user_data);
+typedef gint     (*GCompareFunc)   (gconstpointer a, gconstpointer b);
 typedef void     (*GHFunc)         (gpointer key, gpointer value, gpointer user_data);
 typedef gboolean (*GHRFunc)        (gpointer key, gpointer value, gpointer user_data);
 typedef void     (*GDestroyNotify) (gpointer data);
@@ -113,6 +116,8 @@ void         g_strfreev       (gchar **str_array);
 gchar       *g_strconcat      (const gchar *first, ...);
 gchar      **g_strsplit       (const gchar *string, const gchar *delimiter, gint max_tokens);
 gchar       *g_strreverse     (gchar *str);
+gboolean    g_str_has_prefix  (const gchar *str, const gchar *prefix);
+gboolean    g_str_has_suffix  (const gchar *str, const gchar *suffix);
 
 /*
  * String type
@@ -132,7 +137,7 @@ void         g_string_printf        (GString *string, const gchar *format, ...);
 void         g_string_append_printf (GString *string, const gchar *format, ...);
 GString     *g_string_append_c      (GString *string, gchar c);
 GString     *g_string_append        (GString *string, const gchar *val);
-
+GString     *g_string_append_len    (GString *string, const gchar *val, gsize len);
 #define g_string_sprintfa g_string_append_printf
 
 /*
@@ -155,8 +160,11 @@ void    g_slist_foreach   (GSList* list, GFunc func, gpointer user_data);
 GSList *g_slist_last      (GSList *list);
 GSList *g_slist_find      (GSList *list, gconstpointer data);
 GSList *g_slist_remove    (GSList *list, gconstpointer data);
-GSList *g_slist_remove_link (GSList *list, gconstpointer data);
-
+GSList *g_slist_reverse   (GSList *list);
+GSList *g_slist_remove_link (GSList *list, GSList *link);
+GSList *g_slist_delete_link (GSList *list, GSList *link);
+GSList *g_slist_insert_sorted (GSList *list, gpointer data, GCompareFunc func);
+guint  g_slist_length     (GSList *list);
 #define g_slist_next (slist) ((slist) ? (((GSList *) slist)->next) : NULL)
 
 /*