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