X-Git-Url: https://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/486240dc4c5d57b0afaddba60d87fe375112bed5..b95b3724f522c3d7ab2ede752e2913287b172b8e:/src/util.h diff --git a/src/util.h b/src/util.h index ba7f1b5..bb69ed2 100644 --- a/src/util.h +++ b/src/util.h @@ -20,17 +20,29 @@ * USA. */ -#ifndef _UTIL_H_ -#define _UTIL_H_ +#ifndef UTIL_H +#define UTIL_H -/* print an error, or warning (if 'is_warn') referring to 'line' */ -void print_error(gboolean is_warn, char *error, int line); +enum { + GOB_WARN, + GOB_ERROR +}; + +/* print an error, or warning referring to 'line' + * (line can be 0 or negative for no line) */ +void error_print(int type, int line, const char *error); +void error_printf(int type, int line, const char *error, ...) G_GNUC_PRINTF (3, 4); /* remove the : separator from a typename */ -char * remove_sep(char *base); +char * remove_sep(const char *base); /* replace the : separator from a typename with a different character*/ char * replace_sep(const char *base, char r); +char * gob_strup (char *s); +char * gob_strdown (char *s); +char * gob_str_delete_quotes(char *str); +int gob_strcasecmp(const char *s1, const char *s2); + /*separate the namespace part and then replace rest of separators with r*/ void separns_replace_sep(const char *base, char **ns, char **name, char r); @@ -39,8 +51,10 @@ void separns_replace_sep(const char *base, char **ns, char **name, char r); namespace */ char * make_pre_macro(const char *base,const char *pre); -/* get a name usable for a cast from a GTK+ type (without GTK_TYPE_)*/ -const char * get_cast(char *type, gboolean simple_only); +/* get a name usable for a cast from a GObject (without G_TYPE_)*/ +const char * get_cast (const char *type, gboolean simple_only); +Type * get_tree_type (const char *type, gboolean simple_only); +char * get_type (const Type *t, gboolean postfix_to_stars); enum { SPECIAL_2POINTER, @@ -51,8 +65,6 @@ enum { /* returns TRUE if there are any special types at all */ gboolean setup_special_array(Class *c, gboolean *special_array); -/* get the id without the first underscore, but only if we're removing them */ -char *get_real_id(char *id); - -#endif +char * make_me_type (const char *type, const char *alt); +#endif /* UTIL_H */