comparison os9/mc09/mclibos9.c @ 102:09148bb27659

fix
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 27 Dec 2018 16:03:36 +0900
parents 15569aa4098e
children 844305752064
comparison
equal deleted inserted replaced
101:15569aa4098e 102:09148bb27659
11 typedef struct { 11 typedef struct {
12 int fd; /* 0 */ 12 int fd; /* 0 */
13 int mode; /* 2 */ 13 int mode; /* 2 */
14 int len; /* 4 */ 14 int len; /* 4 */
15 char *name; /* 6 */ 15 char *name; /* 6 */
16 unsigned char*ptr; /* 8 */ 16 char *ptr; /* 8 */
17 unsigned char buf[256]; /* 10 */ 17 char buff[256]; /* 10 */
18 } FILE ; 18 } FILE ;
19 19
20 #define FCBSIZE (sizeof(FILE)) 20 #define FCBSIZE (sizeof(FILE))
21 21
22 #define NFILES 8 22 #define NFILES 8
50 argc = 0; 50 argc = 0;
51 argv = 0; 51 argv = 0;
52 n = 0; 52 n = 0;
53 quote = 0; 53 quote = 0;
54 for( i = 0; i < 2 ; i++ ) { 54 for( i = 0; i < 2 ; i++ ) {
55 if (i==1 && argc) { argv = (char**)malloc(sizeof(char*)*argc; } 55 if (i==1 && argc) { argv = (char**)malloc(sizeof(char*)*argc); }
56 p = args; 56 p = args;
57 while((c = *p++)) { 57 while((c = *p++)) {
58 if (i==1) argv[n] = args; 58 if (i==1) argv[n] = args;
59 if (c=='\'') { 59 if (c=='\'') {
60 if (!quote) { 60 if (!quote) {
132 ldd #-1 132 ldd #-1
133 std ,x 133 std ,x
134 _LC0002 134 _LC0002
135 puls x,y,u 135 puls x,y,u
136 #endasm 136 #endasm
137 if fcbp->fd < 0 ) return NULL; 137 if (fcbp->fd < 0 ) return NULL;
138 fcbp->ptr = fcpp->buf; 138 fcbp->ptr = fcbp->buff;
139 fcbp->len = 0; 139 fcbp->len = 0;
140 return (_fcbtbl[i] = fcbp); 140 return (_fcbtbl[i] = fcbp);
141 } 141 }
142 142
143 FILE *_create(name,cm) 143 FILE *_create(name,cm)
169 ldd #-1 169 ldd #-1
170 std ,x 170 std ,x
171 _LC0002 171 _LC0002
172 puls x,y,u 172 puls x,y,u
173 #endasm 173 #endasm
174 if fcbp->fd < 0 ) return NULL; 174 if (fcbp->fd < 0 ) return NULL;
175 fcbp->ptr = fcpp->buf; 175 fcbp->ptr = fcbp->buff;
176 fcbp->len = 0; 176 fcbp->len = 0;
177 return (_fcbtbl[i] = fcbp); 177 return (_fcbtbl[i] = fcbp);
178 } 178 }
179 179
180 fclose(fcbp) 180 fclose(fcbp)