60
|
1 #define EXTERN /**/
|
|
2
|
|
3 #include "mc.h"
|
|
4
|
65
|
5 static void open(char *);
|
60
|
6 static void print(char *);
|
65
|
7 static void close();
|
66
|
8 static void comment(char *s);
|
60
|
9
|
|
10 Converter cbc2c_converter = {
|
65
|
11 &open,
|
|
12 &print,
|
|
13 &close,
|
66
|
14 &comment,
|
60
|
15 };
|
|
16
|
|
17 static FILE *vout;
|
|
18
|
|
19 static void
|
66
|
20 comment(char *s)
|
|
21 {
|
|
22 }
|
|
23
|
|
24 static void
|
65
|
25 open(char *s)
|
|
26 {
|
|
27 char *p=cheapp;
|
|
28 while((*cheapp++ = *s++)) {
|
|
29 if (*s=='.') {
|
|
30 *cheapp++=*s++; *cheapp++='c';
|
|
31 *cheapp++='c'; *cheapp++=0;
|
|
32 break;
|
|
33 }
|
|
34 }
|
|
35 vout = fopen(p,"w");
|
|
36 if(!vout) error(-1);
|
|
37 }
|
|
38
|
|
39 static void
|
60
|
40 print(char *s)
|
|
41 {
|
|
42 fprintf(vout,"c: %s\n",s);
|
|
43 }
|
65
|
44
|
|
45 static void
|
|
46 close()
|
|
47 {
|
|
48 fclose(vout);
|
|
49 }
|
|
50
|