X-Git-Url: https://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/e10d6e307623d0952f6e1f5d9fee8720ddab4808..489e97ede850a8de01ca3bd653dce9c25dcd54a1:/src/util.h diff --git a/src/util.h b/src/util.h index 9d0d0cb..8551876 100644 --- a/src/util.h +++ b/src/util.h @@ -1,5 +1,6 @@ /* GOB C Preprocessor * Copyright (C) 1999-2000 the Free Software Foundation. + * Copyright (C) 2000 Eazel, Inc. * * Author: George Lebl * @@ -19,27 +20,44 @@ * 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(int 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(char *base, char r); +char * replace_sep(const char *base, char r); /*separate the namespace part and then replace rest of separators with r*/ -void separns_replace_sep(char *base, char **ns, char **name, char r); +void separns_replace_sep(const char *base, char **ns, char **name, char r); /* make a macro with some prefix before the name but after namespace */ -char * make_pre_macro(char *base, 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); - -#endif - +char * make_pre_macro(const char *base,const char *pre); + +/* 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, + SPECIAL_3POINTER, + SPECIAL_INT_POINTER, + SPECIAL_LAST +}; +/* returns TRUE if there are any special types at all */ +gboolean setup_special_array(Class *c, gboolean *special_array); + +#endif /* UTIL_H */