annotate conv/cbc2c.c @ 564:25f431685d80

*** empty log message ***
author kono
date Tue, 10 Jan 2006 16:30:43 +0900
parents 0b068058dd67
children df04bc5fd5fe
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
60
aa779bcffef7 CwC converters
kono
parents:
diff changeset
1 #define EXTERN /**/
aa779bcffef7 CwC converters
kono
parents:
diff changeset
2
aa779bcffef7 CwC converters
kono
parents:
diff changeset
3 #include "mc.h"
aa779bcffef7 CwC converters
kono
parents:
diff changeset
4
65
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
5 static void open(char *);
60
aa779bcffef7 CwC converters
kono
parents:
diff changeset
6 static void print(char *);
65
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
7 static void close();
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
8 static void comment(char *s);
60
aa779bcffef7 CwC converters
kono
parents:
diff changeset
9
aa779bcffef7 CwC converters
kono
parents:
diff changeset
10 Converter cbc2c_converter = {
65
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
11 &open,
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
12 &print,
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
13 &close,
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
14 &comment,
60
aa779bcffef7 CwC converters
kono
parents:
diff changeset
15 };
aa779bcffef7 CwC converters
kono
parents:
diff changeset
16
aa779bcffef7 CwC converters
kono
parents:
diff changeset
17 static FILE *vout;
aa779bcffef7 CwC converters
kono
parents:
diff changeset
18
aa779bcffef7 CwC converters
kono
parents:
diff changeset
19 static void
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
20 comment(char *s)
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
21 {
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
22 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
23
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
24 static void
65
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
25 open(char *s)
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
26 {
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
27 char *p=cheapp;
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
28 while((*cheapp++ = *s++)) {
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
29 if (*s=='.') {
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
30 *cheapp++=*s++; *cheapp++='c';
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
31 *cheapp++='c'; *cheapp++=0;
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
32 break;
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
33 }
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
34 }
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
35 vout = fopen(p,"w");
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
36 if(!vout) error(-1);
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
37 }
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
38
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
39 static void
60
aa779bcffef7 CwC converters
kono
parents:
diff changeset
40 print(char *s)
aa779bcffef7 CwC converters
kono
parents:
diff changeset
41 {
aa779bcffef7 CwC converters
kono
parents:
diff changeset
42 fprintf(vout,"c: %s\n",s);
aa779bcffef7 CwC converters
kono
parents:
diff changeset
43 }
65
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
44
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
45 static void
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
46 close()
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
47 {
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
48 fclose(vout);
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
49 }
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
50