]> git.draconx.ca Git - gob-dx.git/blobdiff - src/util.c
Release 2.0.3
[gob-dx.git] / src / util.c
index 78eaaaa6c02b32b857677568bf81545d95895345..5d891a20e5200377d82efd6bf68666c86365f39d 100644 (file)
@@ -34,7 +34,7 @@
 void
 error_print(int type, int line, const char *error)
 {
-       char *w = NULL;
+       const char *w = NULL;
 
        switch(type) {
        case GOB_WARN:
@@ -77,6 +77,11 @@ remove_sep(const char *base)
 {
        char *p;
        char *s = g_strdup(base);
+
+       /* don't eat C++ :: thingies */
+       if (for_cpp && strstr (s, "::") != NULL)
+               return s;
+
        while((p = strchr(s, ':')))
                strcpy(p, p+1);
        return s;
@@ -87,6 +92,11 @@ replace_sep(const char *base, char r)
 {
        char *p;
        char *s = g_strdup(base);
+
+       /* don't eat C++ :: thingies */
+       if (for_cpp && strstr (s, "::") != NULL)
+               return s;
+
        while((p=strchr(s,':')))
                *p = r;
        if(*s == r) {
@@ -104,7 +114,15 @@ separns_replace_sep(const char *base, char **ns, char **name, char r)
 {
        char *p;
        char *s = g_strdup(base);
+
        *ns = NULL;
+       
+       /* don't eat C++ :: thingies */
+       if (for_cpp && strstr (s, "::") != NULL) {
+               *name = s;
+               return;
+       }
+
        if((p=strchr(s,':')) && p!=s) {
                *p = '\0';
                *ns = g_strdup(s);
@@ -173,11 +191,14 @@ const OurGtkType our_gtk_type_table[] = {
        { TRUE, "NONE",         "void ",        "void",         NULL,   -1 },
        { TRUE, "CHAR",         "gchar ",       "gchar",        NULL,   -1 },
        { TRUE, "UCHAR",        "guchar ",      "guchar",       NULL,   -1 },
+       { TRUE, "UNICHAR",      "gunichar ",    "gunichar",     NULL,   -1 },
        { TRUE, "BOOLEAN",      "gboolean ",    "gboolean",     NULL,   -1 },
        { TRUE, "INT",          "gint ",        "gint",         NULL,   -1 },
        { TRUE, "UINT",         "guint ",       "guint",        NULL,   -1 },
        { TRUE, "LONG",         "glong ",       "glong",        NULL,   -1 },
        { TRUE, "ULONG",        "gulong ",      "gulong",       NULL,   -1 },
+       { TRUE, "INT64",        "gint64 ",      "gint64",       NULL,   -1 },
+       { TRUE, "UINT64",       "guint64 ",     "guint64",      NULL,   -1 },
        { TRUE, "ENUM",         /*"enum"*/"gint ", "gint",      NULL,   -1 },
        { TRUE, "FLAGS",        /*"flags"*/"guint ", "guint",   NULL,   -1 },
        { TRUE, "FLOAT",        "gfloat ",      "gfloat",       NULL,   -1 },
@@ -188,7 +209,7 @@ const OurGtkType our_gtk_type_table[] = {
        { TRUE, "OBJECT",       "GObject *",    "GObject",      "*",    -1 },
        { TRUE, "PARAM",        "GParamSpec *", "GParamSpec",   "*",    -1 },
 
-       /* FIXME: VALUE_ARRAY, CLOSURE, UNICHAR */
+       /* FIXME: VALUE_ARRAY, CLOSURE */
        /* Note that those have some issues with g_value_ calls etc... so
         * we can't just add them */
 
@@ -267,7 +288,7 @@ get_tree_type (const char *type, gboolean simple_only)
 }
 
 static void
-mask_special_array(char *type, gboolean *special_array, gboolean *any_special)
+mask_special_array (const char *type, gboolean *special_array, gboolean *any_special)
 {
        OurGtkType *gtype;