define gstring in terms of gchar*. this typedef reflects the type name of
[platform/upstream/glib.git] / glib.h
diff --git a/glib.h b/glib.h
index 799a07a..7baeb48 100644 (file)
--- a/glib.h
+++ b/glib.h
  */
 #include <glibconfig.h>
 
+/* Define some mathematical constants that aren't available
+ * symbolically in some strict ISO C implementations.
+ */
+#define G_E     2.7182818284590452354E0
+#define G_LN2   6.9314718055994530942E-1
+#define G_LN10  2.3025850929940456840E0
+#define G_PI    3.14159265358979323846E0
+#define G_PI_2  1.57079632679489661923E0
+#define G_PI_4  0.78539816339744830962E0
+#define G_SQRT2 1.4142135623730950488E0
+
 /* include varargs functions for assertment macros
  */
 #include <stdarg.h>
@@ -147,6 +158,14 @@ extern "C" {
 #define G_STRINGIFY(macro_or_string)   G_STRINGIFY_ARG (macro_or_string)
 #define        G_STRINGIFY_ARG(contents)       #contents
 
+/* provide a string identifying the current code position */
+#ifdef  __GNUC__
+#  define G_STRLOC     __FILE__ ":" G_STRINGIFY (__LINE__) ":" __PRETTY_FUNCTION__ "()"
+#else
+#  define G_STRLOC     __FILE__ ":" G_STRINGIFY (__LINE__)
+#endif
+
+
 /* Count the number of elements in an array. The array must be defined
  * as such; using this with a dynamically allocated array will give
  * incorrect results.
@@ -171,9 +190,9 @@ extern "C" {
  * fields through their offsets.
  */
 #define G_STRUCT_OFFSET(struct_type, member)   \
-    ((gulong) ((gchar*) &((struct_type*) 0)->member))
+    ((glong) ((guint8*) &((struct_type*) 0)->member))
 #define G_STRUCT_MEMBER_P(struct_p, struct_offset)   \
-    ((gpointer) ((gchar*) (struct_p) + (gulong) (struct_offset)))
+    ((gpointer) ((guint8*) (struct_p) + (glong) (struct_offset)))
 #define G_STRUCT_MEMBER(member_type, struct_p, struct_offset)   \
     (*(member_type*) G_STRUCT_MEMBER_P ((struct_p), (struct_offset)))
 
@@ -481,6 +500,7 @@ typedef short  gshort;
 typedef long   glong;
 typedef int    gint;
 typedef gint   gboolean;
+typedef gchar* gstring;
 
 typedef unsigned char  guchar;
 typedef unsigned short gushort;
@@ -1022,6 +1042,9 @@ GSList* g_slist_insert            (GSList         *list,
 GSList* g_slist_insert_sorted  (GSList         *list,
                                 gpointer        data,
                                 GCompareFunc    func);
+GSList* g_slist_insert_before   (GSList         *slist,
+                                GSList         *sibling,
+                                gpointer        data);
 GSList* g_slist_concat         (GSList         *list1,
                                 GSList         *list2);
 GSList* g_slist_remove         (GSList         *list,
@@ -1567,6 +1590,9 @@ void    g_usleep        (gulong microseconds);
 gchar*  g_strdelimit           (gchar       *string,
                                 const gchar *delimiters,
                                 gchar        new_delimiter);
+gchar*  g_strcanon             (gchar       *string,
+                                const gchar *valid_chars,
+                                gchar        subsitutor);
 gdouble         g_strtod               (const gchar *nptr,
                                 gchar      **endptr);
 gchar*  g_strerror             (gint         errnum);
@@ -1576,9 +1602,9 @@ gint       g_strcasecmp           (const gchar *s1,
 gint    g_strncasecmp          (const gchar *s1,
                                 const gchar *s2,
                                 guint        n);
-void    g_strdown              (gchar       *string);
-void    g_strup                (gchar       *string);
-void    g_strreverse           (gchar       *string);
+gchar*  g_strdown              (gchar       *string);
+gchar*  g_strup                (gchar       *string);
+gchar*  g_strreverse           (gchar       *string);
 /* removes leading spaces */
 gchar*   g_strchug              (gchar        *string);
 /* removes trailing spaces */
@@ -1683,6 +1709,9 @@ gchar*  g_path_skip_root  (gchar       *file_name);
 gchar* g_dirname               (const gchar *file_name);
 gchar* g_get_current_dir       (void);
 
+/* Get the codeset for the current locale */
+gchar * g_get_codeset    (void);
+
 /* return the environment string for the variable. The returned memory
  * must not be freed. */
 gchar*  g_getenv               (const gchar *variable);
@@ -1839,7 +1868,7 @@ void           g_string_free              (GString         *string,
 GString*     g_string_assign            (GString        *string,
                                         const gchar     *rval);
 GString*     g_string_truncate          (GString        *string,
-                                        gint             len);
+                                        guint            len);
 GString*     g_string_insert_len        (GString         *string,
                                          gint             pos,
                                          const gchar     *val,
@@ -2054,6 +2083,7 @@ void        g_dataset_foreach             (gconstpointer    dataset_location,
 /* Character sets */
 #define G_CSET_A_2_Z   "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 #define G_CSET_a_2_z   "abcdefghijklmnopqrstuvwxyz"
+#define G_CSET_DIGITS  "0123456789"
 #define G_CSET_LATINC  "\300\301\302\303\304\305\306"\
                        "\307\310\311\312\313\314\315\316\317\320"\
                        "\321\322\323\324\325\326"\
@@ -3292,9 +3322,10 @@ guint           g_thread_pool_get_num_unused_threads (void);
 /* Stop all currently unused threads, but leave the limit untouched */
 void            g_thread_pool_stop_unused_threads    (void);
 
+#include <gunicode.h>
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
 
-
 #endif /* __G_LIB_H__ */