#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
*/
* 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);
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
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
/*
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)
/*