X-Git-Url: http://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/4cda31fc14f41746b4f3ced7015f9f15e0168dfc..8445442abc02fc325a9ce228759403113583818c:/src/util.c diff --git a/src/util.c b/src/util.c index 84ed63e..6405190 100644 --- a/src/util.c +++ b/src/util.c @@ -81,13 +81,17 @@ remove_sep(const char *base) { char *p; char *s = g_strdup(base); + char *q=s; /* don't eat C++ :: thingies */ if (for_cpp && strstr (s, "::") != NULL) return s; - while((p = strchr(s, ':'))) - strcpy(p, p+1); + for(p=(char *)base;*p;p++){ + if (*p!=':') + *q++=*p; + } + *q='\0'; return s; } @@ -268,7 +272,10 @@ get_cast (const char *type, gboolean simple_only) init_type_hash (); - gtype = g_hash_table_lookup (type_hash, type); + if(strncmp(type, "BOXED_", 6) == 0) + gtype = g_hash_table_lookup (type_hash, "BOXED"); + else + gtype = g_hash_table_lookup (type_hash, type); if (gtype == NULL || (simple_only && @@ -400,6 +407,25 @@ gob_strdown (char *str) return str; } +char * +gob_str_delete_quotes(char *str) +{ + char *p, *i; + p=i=str; + while(*p!='\0') + { + if(*p=='\"') + { + p++; + continue; + } + *i=*p; + p++; i++; + } + *i=*p; + return str; +} + char * make_me_type (const char *type, const char *alt) {