]> git.draconx.ca Git - gob-dx.git/blob - src/util.h
Release 1.0.5
[gob-dx.git] / src / util.h
1 /* GOB C Preprocessor
2  * Copyright (C) 1999-2000 the Free Software Foundation.
3  * Copyright (C) 2000 Eazel, Inc.
4  *
5  * Author: George Lebl
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the  Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
20  * USA.
21  */
22
23 #ifndef _UTIL_H_
24 #define _UTIL_H_
25
26 enum {
27         GOB_WARN,
28         GOB_ERROR
29 };
30
31 /* print an error, or warning referring to 'line'
32  * (line can be 0 or negative for no line) */
33 void error_print(int type, int line, const char *error);
34 void error_printf(int type, int line, const char *error, ...) G_GNUC_PRINTF (3, 4);
35
36 /* remove the : separator from a typename */
37 char * remove_sep(const char *base);
38 /* replace the : separator from a typename with a different character*/
39 char * replace_sep(const char *base, char r);
40
41 /*separate the namespace part and then replace rest of
42   separators with r*/
43 void separns_replace_sep(const char *base, char **ns, char **name, char r);
44
45 /* make a macro with some prefix before the name but after
46    namespace */
47 char * make_pre_macro(const char *base,const  char *pre);
48
49 /* get a name usable for a cast from a GTK+ type (without GTK_TYPE_)*/
50 const char * get_cast(char *type, gboolean simple_only);
51
52 enum {
53         SPECIAL_2POINTER,
54         SPECIAL_3POINTER,
55         SPECIAL_INT_POINTER,
56         SPECIAL_LAST
57 };
58 /* returns TRUE if there are any special types at all */
59 gboolean setup_special_array(Class *c, gboolean *special_array);
60
61 /* get the id without the first underscore, but only if we're removing them */
62 const char *get_real_id(const char *id);
63
64 #endif
65