Annotation of OpenXM/src/kan96xx/plugin/file2.hh, Revision 1.1.1.1
1.1 maekawa 1: else if (strcmp(key,"fp2fdopen") == 0) {
2: if (size != 2) errorKan1("%s\n","[(fp2fdopen) obj] extension obj-fp2.");
3: obj1 = getoa(obj,1);
4: if (obj1.tag != Sinteger) {
5: errorKan1("%s\n","[(fp2fdopen) file-descriptor-integer] extension obj-fp2.");
6: }
7: rob.tag = Sfile;
8: rob.lc.str = MAGIC2 ;
9: rob.rc.voidp = (void *) fp2open(KopInteger(obj1));
10:
11: }
12: else if (strcmp(key,"fp2fflush") == 0) {
13: if (size != 2) errorKan1("%s\n","[(fp2fflush) obj-fp2] extension 0.");
14: obj1= getoa(obj,1);
15: if (obj1.tag != Sfile) {
16: errorKan1("%s\n","[(fp2fflush) obj-fp2] extension 0.");
17: }
18: if (strcmp(obj1.lc.str,MAGIC2) != 0) {
19: errorKan1("%s\n","[(fp2fflush) obj-fp2] extension 0. obj-fp2 is not Sfile (FILE2).");
20: }
21: fp2fflush((FILE2 *) obj1.rc.voidp);
22: rob = KpoInteger(0);
23: }
24: else if (strcmp(key,"fp2fclose") == 0) {
25: if (size != 2) errorKan1("%s\n","[(fp2fclose) obj-fp2] extension r.");
26: obj1= getoa(obj,1);
27: if (obj1.tag != Sfile) {
28: errorKan1("%s\n","[(fp2fclose) obj-fp2] extension r.");
29: }
30: if (strcmp(obj1.lc.str,MAGIC2) != 0) {
31: errorKan1("%s\n","[(fp2fclose) obj-fp2] extension r. obj-fp2 is not Sfile (FILE2).");
32: }
33: rob = KpoInteger(fp2fclose((FILE2 *) obj1.rc.voidp));
34: }
35: else if (strcmp(key,"fp2fgetc") == 0) {
36: if (size != 2) errorKan1("%s\n","[(fp2fgetc) obj-fp2] extension c.");
37: obj1= getoa(obj,1);
38: if (obj1.tag != Sfile) {
39: errorKan1("%s\n","[(fp2fgetc) obj-fp2] extension c.");
40: }
41: if (strcmp(obj1.lc.str,MAGIC2) != 0) {
42: errorKan1("%s\n","[(fp2fgetc) obj-fp2] extension c. obj-fp2 is not Sfile (FILE2).");
43: }
44: rob = KpoInteger(fp2fgetc((FILE2 *) obj1.rc.voidp));
45: }
46: else if (strcmp(key,"fp2fputc") == 0) {
47: if (size != 3) errorKan1("%s\n","[(fp2fgetc) c obj-fp2] extension c.");
48: obj1 = getoa(obj,1);
49: if (obj1.tag != Sinteger) {
50: errorKan1("%s\n","[(fp2fputc) c-integer obj-fp2] extension c.");
51: }
52: obj2= getoa(obj,2);
53: if (obj2.tag != Sfile) {
54: errorKan1("%s\n","[(fp2fputc) c obj-file-fp2] extension c.");
55: }
56: if (strcmp(obj2.lc.str,MAGIC2) != 0) {
57: errorKan1("%s\n","[(fp2fputc) c obj-fp2] extension c. obj-fp2 is not Sfile (FILE2).");
58: }
59: rob = KpoInteger(fp2fputc(obj1.lc.ival,(FILE2 *) obj2.rc.voidp));
60: }
61: else if (strcmp(key,"fp2dumpBuffer") == 0) {
62: if (size != 2) errorKan1("%s\n","[(fp2dumpBuffer) obj-fp2] extension c.");
63: obj1= getoa(obj,1);
64: if (obj1.tag != Sfile) {
65: errorKan1("%s\n","[(fp2dumpBuffer) obj-fp2] extension c.");
66: }
67: if (strcmp(obj1.lc.str,MAGIC2) != 0) {
68: errorKan1("%s\n","[(fp2dumpBuffer) obj-fp2] extension c. obj-fp2 is not Sfile (FILE2).");
69: }
70: rob = KpoInteger(fp2dumpBuffer((FILE2 *) obj1.rc.voidp));
71: }
72: else if (strcmp(key,"fp2openForRead") == 0) {
73: if (size != 2) errorKan1("%s\n","[(fp2openForRead) name] extension c.");
74: obj1= getoa(obj,1);
75: if (obj1.tag != Sdollar) {
76: errorKan1("%s\n","[(fp2openForRead) name-string] extension c.");
77: }
78: rob = KpoInteger(open(obj1.lc.str,O_RDONLY));
79: }
80: else if (strcmp(key,"fp2openForWrite") == 0) {
81: if (size != 2) errorKan1("%s\n","[(fp2openForWrite) name] extension c.");
82: obj1= getoa(obj,1);
83: if (obj1.tag != Sdollar) {
84: errorKan1("%s\n","[(fp2openForWrite) name-string] extension c.");
85: }
86: rob = KpoInteger(creat(obj1.lc.str, S_IREAD|S_IWRITE|S_IRGRP|S_IROTH));
87: }
88: else if (strcmp(key,"fp2close") == 0) {
89: if (size != 2) errorKan1("%s\n","[(fp2close) fd] extension c.");
90: obj1= getoa(obj,1);
91: if (obj1.tag != Sinteger) {
92: errorKan1("%s\n","[(fp2close) fd-integer] extension c.");
93: }
94: rob = KpoInteger(close(obj1.lc.ival));
95: }
96: else if (strcmp(key,"fp2clearReadBuf") == 0) {
97: if (size != 2) errorKan1("%s\n","[(fp2ClearReadBuf) obj-fp2] extension c.");
98: obj1= getoa(obj,1);
99: if (obj1.tag != Sfile) {
100: errorKan1("%s\n","[(fp2clearReadBuf) obj-fp2] extension c.");
101: }
102: if (strcmp(obj1.lc.str,MAGIC2) != 0) {
103: errorKan1("%s\n","[(fp2clearReadBuf) obj-fp2] extension c. obj-fp2 is not Sfile (FILE2).");
104: }
105: rob = KpoInteger(fp2dumpBuffer((FILE2 *) obj1.rc.voidp));
106: rob = KpoInteger(fp2clearReadBuf((FILE2 *)obj1.rc.voidp));
107: }
108:
109:
110:
111:
112:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>