11 extern gboolean for_cpp;
13 extern char *filename;
14 extern char *filebase;
17 static gboolean in_out = TRUE;
19 static gboolean in_outh = TRUE;
21 static gboolean in_outph = TRUE;
24 strchrcnt(char *s, char c)
34 out_printf(FILE *fp,char *format,...)
40 s = g_strdup_vprintf(format,ap);
44 outline += strchrcnt(s,'\n');
46 outhline += strchrcnt(s,'\n');
48 outphline += strchrcnt(s,'\n');
50 g_assert_not_reached();
57 out_addline_infile(FILE *fp, int line)
62 } else if(fp == outh) {
65 } else if(fp == outph) {
69 g_assert_not_reached();
71 fprintf(fp,"#line %d \"%s\"\n",line,filename);
75 out_addline_outfile(FILE *fp)
81 fprintf(fp,"#line %d \"%s.c\"\n",outline,filebase);
83 fprintf(fp,"#line %d \"%s.cc\"\n",outline,filebase);
85 } else if(fp == outh) {
88 fprintf(fp,"#line %d \"%s.h\"\n",outhline,filebase);
90 } else if(fp == outph) {
93 fprintf(fp,"#line %d \"%s-private.h\"\n",outphline,filebase);
96 g_assert_not_reached();