10 static gboolean in_out = TRUE;
12 static gboolean in_outh = TRUE;
14 static gboolean in_outph = TRUE;
19 strchrcnt(char *s, char c)
29 out_printf(FILE *fp, const char *format,...)
38 s = g_strdup_vprintf(format, ap);
42 outline += strchrcnt(s, '\n');
44 outhline += strchrcnt(s, '\n');
46 outphline += strchrcnt(s, '\n');
48 g_assert_not_reached();
55 out_addline_infile(FILE *fp, int line)
57 if(no_lines || no_write)
63 } else if(fp == outh) {
66 } else if(fp == outph) {
70 g_assert_not_reached();
72 fprintf(fp, "#line %d \"%s\"\n", line, filename);
76 out_addline_outfile(FILE *fp)
78 if(no_lines || no_write)
85 fprintf(fp,"#line %d \"%s.c\"\n",outline,filebase);
87 fprintf(fp,"#line %d \"%s.cc\"\n",outline,filebase);
89 } else if(fp == outh) {
92 fprintf(fp,"#line %d \"%s.h\"\n",outhline,filebase);
94 } else if(fp == outph) {
97 fprintf(fp,"#line %d \"%s%cprivate.h\"\n",outphline,filebase,file_sep);
100 g_assert_not_reached();