- Timestamp:
- 07/15/2017 03:12:10 PM (8 years ago)
- Branches:
- master
- Children:
- ea232f9
- Parents:
- 7d0d347
- Location:
- libcio
- Files:
-
- 48 edited
Legend:
- Unmodified
- Added
- Removed
-
libcio/atoi.c
r7d0d347 r8973acd 10 10 int16_t atoi(int8_t *cp) 11 11 { 12 register uint16_t i;12 register int16_t i; 13 13 register int16_t sign; 14 14 -
libcio/blkrd.c
r7d0d347 r8973acd 70 70 if ((track NE _b_trak) OR (side NE _b_side)) { /* track in buffer ? */ 71 71 72 if ( brc = BIOS(B_RDWR, 0, &_b_tbuf, _thebpb->dspt, _b_tsec, 0)) {72 if ((brc = BIOS(B_RDWR, 0, &_b_tbuf, _thebpb->dspt, _b_tsec, 0))) { 73 73 74 74 _b_trak = -1; … … 111 111 112 112 #if TBUFFER 113 if ( brc = _secrd(buf, (int16_t)fcp->curdsn)) {113 if ((brc = _secrd(buf, (int16_t)fcp->curdsn))) { 114 114 #else 115 115 if (brc = BIOS(B_RDWR, 0, buf, 1, (short)fcp->curdsn, 0)) { … … 121 121 } 122 122 123 if ( rb = _nsic(fcp, _thebpb, _thefat)) { /* find next sector */123 if ((rb = _nsic(fcp, _thebpb, _thefat))) { /* find next sector */ 124 124 125 125 if (rb EQ -1) /* see if we had an error */ -
libcio/blkwr.c
r7d0d347 r8973acd 100 100 #endif 101 101 102 if ( rc = BIOS(B_RDWR, 1, buf, 1, (int16_t)fcp->curdsn, 0)) {102 if ((rc = BIOS(B_RDWR, 1, buf, 1, (int16_t)fcp->curdsn, 0))) { 103 103 104 104 #if DEBUGIT … … 150 150 #endif 151 151 152 if ( rc = BIOS(B_RDWR, 1, buf, 1, (int16_t)fcp->curdsn, 0)) {152 if ((rc = BIOS(B_RDWR, 1, buf, 1, (int16_t)fcp->curdsn, 0))) { 153 153 154 154 #if DEBUGIT … … 184 184 } 185 185 186 fcp->de.bclust = micon s(clustr);186 fcp->de.bclust = micon16((uint16_t)clustr); 187 187 _ptcl12(_thefat, clustr, 0x0FF8); 188 188 _fatmod = TRUE; … … 201 201 #endif 202 202 203 if ( rc = BIOS(B_RDWR, 1, buf, 1, (int16_t)fcp->curdsn, 0)) {203 if ((rc = BIOS(B_RDWR, 1, buf, 1, (int16_t)fcp->curdsn, 0))) { 204 204 205 205 #if DEBUGIT -
libcio/close.c
r7d0d347 r8973acd 87 87 */ 88 88 89 int16_t _filecl( struct fcb *fp)89 int16_t _filecl(io_arg arg) 90 90 { 91 struct fcb *fp; 91 92 register int16_t rc; 93 94 fp = (struct fcb *)arg; 92 95 93 96 rc = ClsFile(fp); /* close the FCB */ -
libcio/close.x
r7d0d347 r8973acd 8 8 9 9 #include "biosdefs.h" 10 #include "fspars.h" 10 11 #include "stdint.h" 11 12 … … 19 20 extern void _clsfat(void); 20 21 extern void _fd_cls(void); 21 extern int16_t _filecl( struct fcb *fp);22 extern int16_t _filecl(io_arg arg); 22 23 extern int16_t close(int16_t fd); -
libcio/clusmap.c
r7d0d347 r8973acd 75 75 76 76 nc = 0; 77 clus = micons(fcp->de.bclust);77 clus = (int16_t)micon16(fcp->de.bclust); 78 78 79 79 if (clus) { … … 173 173 printf(" modefl 0x%04x\n", fcp->modefl); 174 174 175 printf(" crtime 0x%04x", micon s(fcp->de.crtime));176 printf(" crdate 0x%04x\n", micon s(fcp->de.crdate));175 printf(" crtime 0x%04x", micon16(fcp->de.crtime)); 176 printf(" crdate 0x%04x\n", micon16(fcp->de.crdate)); 177 177 178 178 printf(" asects %8ld", fcp->asects); 179 printf(" flen %8ld", micon l(fcp->de.flen));179 printf(" flen %8ld", micon32(fcp->de.flen)); 180 180 printf(" curlen %8ld\n", fcp->curlen); 181 181 182 printf(" bclust %8d", micon s(fcp->de.bclust));182 printf(" bclust %8d", micon16(fcp->de.bclust)); 183 183 printf(" curcls %8d", fcp->curcls); 184 184 printf(" clsec %8d\n", fcp->clsec); … … 198 198 */ 199 199 200 void MapFAT( int8_t *fat, int16_t ncl, int16_t stops)200 void MapFAT(uint8_t *fat, int16_t ncl, int16_t stops) 201 201 { 202 202 register int16_t i; -
libcio/clusmap.x
r7d0d347 r8973acd 21 21 extern FILE *FILEfl(FILE *fp); 22 22 extern void FILEpr(FILE *fp); 23 extern void MapFAT( int8_t *fat, int16_t ncl, int16_t stops);23 extern void MapFAT(uint8_t *fat, int16_t ncl, int16_t stops); 24 24 extern struct fcb *SnapFCB(struct fcb *fcp); 25 25 extern struct fcb *fd2fcb(int16_t fd); -
libcio/conin.c
r7d0d347 r8973acd 8 8 #include "ram.h" 9 9 10 int8_t _ConBuf[258]; /* console input buffer */10 uint8_t _ConBuf[258]; /* console input buffer */ 11 11 int16_t _CBused; 12 12 13 int16_t _conin(io_arg arg, int8_t*buff, int16_t len)13 int16_t _conin(io_arg arg, void *buff, int16_t len) 14 14 { 15 15 int16_t nbp; … … 23 23 _ConBuf[1] = _ConBuf[2] = 0; 24 24 25 readbuf(CON_DEV, _ConBuf);25 readbuf(CON_DEV, (int8_t *)_ConBuf); 26 26 writeln(CON_DEV, "\r\n"); 27 27 … … 43 43 memcpy(buff, (_ConBuf + _CBused), l); 44 44 _CBused += l; 45 _ConBuf[1] -= l;45 _ConBuf[1] = (uint8_t)(_ConBuf[1] - l); 46 46 return (l); 47 47 } -
libcio/conin.x
r7d0d347 r8973acd 17 17 18 18 extern int16_t _CBused; 19 extern int8_t _ConBuf[258];19 extern uint8_t _ConBuf[258]; 20 20 21 21 /* … … 25 25 */ 26 26 27 extern int16_t _conin(io_arg arg, int8_t*buff, int16_t len);27 extern int16_t _conin(io_arg arg, void *buff, int16_t len); -
libcio/conwr.c
r7d0d347 r8973acd 16 16 ============================================================================ 17 17 */ 18 int16_t _conwr(i nt16_t kind, int8_t*buff, int16_t len)18 int16_t _conwr(io_arg arg, void *buff, int16_t len) 19 19 { 20 struct devtabl *dp; 21 int8_t *buff8; 20 22 register int16_t count; 21 23 24 dp = (struct devtabl *)arg; 25 buff8 = buff; 26 22 27 for (count = 0; count < len; ++count) 23 BIOS(B_PUTC, kind, *buff++);28 BIOS(B_PUTC, dp->d_kind, *buff8++); 24 29 25 30 return(count); -
libcio/conwr.x
r7d0d347 r8973acd 15 15 */ 16 16 17 extern int16_t _conwr(i nt16_t kind, int8_t*buff, int16_t len);17 extern int16_t _conwr(io_arg arg, void *buff, int16_t len); -
libcio/dirfns.c
r7d0d347 r8973acd 72 72 */ 73 73 74 int8_t *dtunpk( int16_t din,int16_t tin, int8_t *s, int16_t fmt)74 int8_t *dtunpk(uint16_t din, uint16_t tin, int8_t *s, int16_t fmt) 75 75 { 76 register int16_t ftm, fdt;76 register uint16_t ftm, fdt; 77 77 78 ftm = ((tin << 8) & 0xFF00) | ((tin >> 8) & 0x00FF);79 fdt = ((din << 8) & 0xFF00) | ((din >> 8) & 0x00FF);78 ftm = micon16(tin); 79 fdt = micon16(din); 80 80 81 81 switch (fmt) { -
libcio/dirfns.x
r7d0d347 r8973acd 16 16 17 17 extern int8_t *atrstr(int16_t atr, int8_t s[]); 18 extern int8_t *dtunpk( int16_t din,int16_t tin, int8_t *s, int16_t fmt);18 extern int8_t *dtunpk(uint16_t din, uint16_t tin, int8_t *s, int16_t fmt); 19 19 extern int8_t *mname(int16_t n); -
libcio/fgets.c
r7d0d347 r8973acd 40 40 41 41 while ((i = getchar()) NE EOF AND i NE '\n') 42 *cp++ = i;42 *cp++ = (int8_t)i; 43 43 44 44 *cp = 0; /* terminate the line */ … … 55 55 register int8_t *cp; 56 56 57 c = 0; 57 58 cp = s; 58 59 59 60 while (--n > 0 AND (c = agetc(fp)) NE EOF) { 60 61 61 *cp++ = c;62 *cp++ = (int8_t)c; 62 63 63 64 if (c EQ '\n') -
libcio/filesys.c
r7d0d347 r8973acd 30 30 struct dirent *_dptr; /* internal directory pointer */ 31 31 32 uint 16_t _thefat[MAXFAT * WDPSEC]; /* file allocation table */32 uint8_t _thefat[MAXFAT * BPSEC]; /* file allocation table */ 33 33 34 34 int16_t _fatin; /* FAT has been read */ … … 47 47 */ 48 48 49 uint16_t _cl2lsn(struct bpb *bpp, uint16_t clnum)49 int16_t _cl2lsn(struct bpb *bpp, int16_t clnum) 50 50 { 51 51 return(bpp->datrec + (bpp->clsiz * (clnum - 2)) ); … … 59 59 */ 60 60 61 uint16_t _gtcl12(int8_t *fat, uint16_t cl) 62 { 63 register uint16_t cla, clt; 61 int16_t _gtcl12(uint8_t *fat, int16_t cl) 62 { 63 int16_t cla; 64 uint16_t clt; 64 65 65 66 cla = cl + (cl >> 1); 66 clt = ( (uint16_t)0xFF00 & (fat[cla+1] << 8))67 | ( (uint16_t)0x00FF& fat[cla]);67 clt = (0xFF00u & ((uint16_t)fat[cla + 1] << 8)) 68 | (0x00FFu & fat[cla]); 68 69 69 70 if (cl & 1) 70 71 clt >>= 4; 71 72 72 clt &= (uint16_t)0x0FFF;73 return( clt);73 clt &= 0x0FFFu; 74 return((int16_t)clt); 74 75 } 75 76 … … 81 82 */ 82 83 83 uint16_t _getfat(uint16_t *bufad, struct bpb *bpp, uint16_t nfat)84 { 85 uint16_t fatsec;84 int32_t _getfat(uint8_t *bufad, struct bpb *bpp, int16_t nfat) 85 { 86 int16_t fatsec; 86 87 87 88 fatsec = nfat ? bpp->fatrec : (bpp->fatrec - bpp->fsiz); 88 return(BIOS(B_RDWR, 0, (int8_t *)bufad, bpp->fsiz, fatsec, 0));89 return(BIOS(B_RDWR, 0, bufad, bpp->fsiz, fatsec, 0)); 89 90 } 90 91 … … 96 97 */ 97 98 98 int16_t _rdfat(uint 16_t *bufad, struct bpb *bpp)99 int16_t _rdfat(uint8_t *bufad, struct bpb *bpp) 99 100 { 100 101 if (_getfat(bufad, bpp, 0)) { … … 116 117 */ 117 118 118 int 16_t _rdroot(uint16_t *buf, struct bpb *bpp)119 { 120 return(BIOS(B_RDWR, 0, (int8_t *)buf, bpp->rdlen,119 int32_t _rdroot(struct dirent *buf, struct bpb *bpp) 120 { 121 return(BIOS(B_RDWR, 0, buf, bpp->rdlen, 121 122 (bpp->fatrec + bpp->fsiz), 0)); 122 123 } … … 131 132 */ 132 133 133 int16_t _nsic(struct fcb *fcp, struct bpb *bpp, int8_t *fp)134 { 135 register uint16_t tfe;134 int16_t _nsic(struct fcb *fcp, struct bpb *bpp, uint8_t *fp) 135 { 136 register int16_t tfe; 136 137 137 138 /* check the FCB flags */ … … 220 221 struct dirent *_dsrch(struct dirent *de) 221 222 { 222 uint16_t i, dl;223 int16_t i, dl; 223 224 register struct dirent *dp; 224 225 225 226 dp = _thedir; 226 dl = _thebpb->rdlen * (_thebpb->recsiz / DENTSIZE);227 dl = _thebpb->rdlen * (_thebpb->recsiz / (int16_t)DENTSIZE); 227 228 228 229 for (i = 0; i < dl; i++) { /* check each entry */ … … 253 254 struct dirent *_dsnew(void) 254 255 { 255 uint16_t i, dl;256 int16_t i, dl; 256 257 register struct dirent *dp; 257 258 258 259 dp = _thedir; 259 dl = _thebpb->rdlen * (_thebpb->recsiz / DENTSIZE);260 dl = _thebpb->rdlen * (_thebpb->recsiz / (int16_t)DENTSIZE); 260 261 261 262 for (i = 0; i < dl; i++) { /* check each entry */ … … 304 305 int16_t _seek(struct fcb *fcp) 305 306 { 306 register uint16_t acls, rcls, nc;307 uint16_t sic, spc;307 register int16_t acls, rcls, nc; 308 int16_t sic, spc; 308 309 309 310 if (!(fcp->modefl & FC_OPN)) { /* file must be open */ … … 328 329 rcls = fcp->curlsn / spc; /* calculate relative cluster */ 329 330 sic = fcp->curlsn - (rcls * spc); /* calculate sector in cluster */ 330 acls = micons(fcp->de.bclust);/* get first cluster */331 acls = (int16_t)micon16(fcp->de.bclust); /* get first cluster */ 331 332 fcp->modefl &= ~FC_EOF; /* turn off the EOF flag */ 332 333 … … 400 401 int16_t _ftrnc(struct dirent *dp) 401 402 { 402 register uint16_t acls, ncls;403 register int16_t acls, ncls; 403 404 404 405 #if DEBUGIT … … 408 409 #endif 409 410 410 acls = micons(dp->bclust);/* get first cluster number */411 acls = (int16_t)micon16(dp->bclust); /* get first cluster number */ 411 412 412 413 /* zap entries until EOF or bad cluster */ … … 481 482 #endif 482 483 483 if ( nc = _newcls()) { /* get a new cluster */484 if ((nc = _newcls())) { /* get a new cluster */ 484 485 485 486 #if DEBUGIT … … 488 489 489 490 _ptcl12(_thefat, nc, FAT_EOF); /* mark new cluster as EOF */ 490 pc = micons(fcp->de.bclust); /* get first cluster */491 pc = (int16_t)micon16(fcp->de.bclust); /* get first cluster */ 491 492 492 493 #if DEBUGIT … … 689 690 /* create the file */ 690 691 691 if (rc = _fmake(fcp)) {692 if ((rc = _fmake(fcp))) { 692 693 693 694 _deadio(fcp, EIO); /* couldn't create the file */ … … 758 759 memcpy(&fcp->de, _dptr, DENTSIZE); 759 760 fcp->clsec = 0; 760 fcp->curcls = micons(fcp->de.bclust);761 fcp->curcls = (int16_t)micon16(fcp->de.bclust); 761 762 fcp->offset = 0; 762 763 fcp->curlsn = 0L; 763 764 fcp->curdsn = fcp->de.bclust ? _cl2lsn(_thebpb, fcp->curcls) : 0; 764 fcp->curlen = miconl(fcp->de.flen);765 766 fcp->asects = (( fcp->curlen / _thebpb->clsizb)765 fcp->curlen = (int32_t)micon32(fcp->de.flen); 766 767 fcp->asects = ((int16_t)(fcp->curlen / _thebpb->clsizb) 767 768 + ((fcp->curlen & (_thebpb->clsizb - 1)) ? 1 : 0)) 768 769 * _thebpb->clsiz; … … 787 788 */ 788 789 789 int16_t _inifcb(struct fcb *fcp, int8_t *name, int8_t *ext, int16_t mode)790 int16_t _inifcb(struct fcb *fcp, int8_t *name, int8_t *ext, uint16_t mode) 790 791 { 791 792 int16_t fl; … … 923 924 if (fcp->modefl & (FC_CR | FC_AP | FC_WR)) { /* writing ? */ 924 925 925 if ( dp = _dsrch(&fcp->de)) { /* locate the dirent */926 if ((dp = _dsrch(&fcp->de))) { /* locate the dirent */ 926 927 927 928 /* update the directory entry if it changed */ … … 1050 1051 return(FAILURE); 1051 1052 1052 _dptr->fname[0] = 0xE5;/* mark directory entry as free */1053 _dptr->fname[0] = (int8_t)0xE5; /* mark directory entry as free */ 1053 1054 1054 1055 #if DEBUGIT -
libcio/filesys.x
r7d0d347 r8973acd 26 26 extern struct bpb *_thebpb; 27 27 extern struct dirent _thedir[MAXDIRNT]; 28 extern uint 16_t _thefat[MAXFAT * WDPSEC];28 extern uint8_t _thefat[MAXFAT * BPSEC]; 29 29 30 30 /* … … 37 37 extern int16_t DelFile(struct fcb *fcp); 38 38 extern int16_t _alcnew(struct fcb *fcp); 39 extern uint16_t _cl2lsn(struct bpb *bpp, uint16_t clnum);39 extern int16_t _cl2lsn(struct bpb *bpp, int16_t clnum); 40 40 extern void _clsvol(void); 41 41 extern void _deadio(struct fcb *fcp, int16_t err); … … 44 44 extern int16_t _fmake(struct fcb *fcp); 45 45 extern int16_t _ftrnc(struct dirent *dp); 46 extern uint16_t _getfat(uint16_t *bufad, struct bpb *bpp, uint16_t nfat);47 extern uint16_t _gtcl12(int8_t *fat, uint16_t cl);48 extern int16_t _inifcb(struct fcb *fcp, int8_t *name, int8_t *ext, int16_t mode);46 extern int32_t _getfat(uint8_t *bufad, struct bpb *bpp, int16_t nfat); 47 extern int16_t _gtcl12(uint8_t *fat, int16_t cl); 48 extern int16_t _inifcb(struct fcb *fcp, int8_t *name, int8_t *ext, uint16_t mode); 49 49 extern int16_t _newcls(void); 50 extern int16_t _nsic(struct fcb *fcp, struct bpb *bpp, int8_t *fp);50 extern int16_t _nsic(struct fcb *fcp, struct bpb *bpp, uint8_t *fp); 51 51 extern int16_t _opfcb(struct fcb *fcp); 52 52 extern int16_t _opnvol(void); 53 extern int16_t _rdfat(uint 16_t *bufad, struct bpb *bpp);54 extern int 16_t _rdroot(uint16_t *buf, struct bpb *bpp);53 extern int16_t _rdfat(uint8_t *bufad, struct bpb *bpp); 54 extern int32_t _rdroot(struct dirent *buf, struct bpb *bpp); 55 55 extern int16_t _seek(struct fcb *fcp); 56 56 extern int16_t fcbinit(int8_t *name, struct fcb *fcp); -
libcio/filname.c
r7d0d347 r8973acd 62 62 tp = p; 63 63 64 while ( c = *s) { /* scan the string */64 while ((c = *s)) { /* scan the string */ 65 65 66 66 if (c EQ '.') { /* ... until we hit the dot */ -
libcio/flread.c
r7d0d347 r8973acd 34 34 } else { 35 35 36 ilen = len;36 ilen = (int16_t)len; 37 37 38 38 if (1 NE fread(buff, ilen, 1, fp)) -
libcio/fopen.c
r7d0d347 r8973acd 8 8 #include "ram.h" 9 9 10 FILE *_opener(int8_t *name, int8_t *mode, int16_t aflag)10 FILE *_opener(int8_t *name, int8_t *mode, uint16_t rawflg) 11 11 { 12 12 register FILE *fp; … … 26 26 27 27 case 'r': /* read mode */ 28 if ((fp->_unit = open(name, (plusopt ? O_RDWR : O_RDONLY) , aflag)) EQ -1)28 if ((fp->_unit = open(name, (plusopt ? O_RDWR : O_RDONLY) | rawflg)) EQ -1) 29 29 return(NULL); 30 30 break; 31 31 32 32 case 'w': /* write mode */ 33 if ((fp->_unit = open(name, (plusopt ? O_RDWR : O_WRONLY)|O_CREAT|O_TRUNC , aflag)) EQ -1)33 if ((fp->_unit = open(name, (plusopt ? O_RDWR : O_WRONLY)|O_CREAT|O_TRUNC|rawflg)) EQ -1) 34 34 return(NULL); 35 35 … … 37 37 38 38 case 'a': /* append mode */ 39 if ((fp->_unit = open(name, (plusopt ? O_RDWR : O_WRONLY)|O_CREAT , aflag)) EQ -1)39 if ((fp->_unit = open(name, (plusopt ? O_RDWR : O_WRONLY)|O_CREAT|rawflg)) EQ -1) 40 40 return(NULL); 41 41 -
libcio/fopen.x
r7d0d347 r8973acd 16 16 */ 17 17 18 extern FILE *_opener(int8_t *name, int8_t *mode, int16_t aflag);18 extern FILE *_opener(int8_t *name, int8_t *mode, uint16_t aflag); 19 19 extern FILE *fopen(int8_t *name, int8_t *mode); 20 20 extern FILE *fopena(int8_t *name, int8_t *mode); -
libcio/fread.c
r7d0d347 r8973acd 15 15 */ 16 16 17 int16_t fread( int8_t *buffer, uint16_t size, int16_t number, FILE *stream)17 int16_t fread(void *buffer, int16_t size, int16_t number, FILE *stream) 18 18 { 19 uint8_t *buffer8; 19 20 int16_t total; 20 21 register int16_t c,i; 22 23 buffer8 = buffer; 21 24 22 25 for (total = 0; total < number; ++total) { … … 27 30 return(total); 28 31 29 *buffer ++ =c;32 *buffer8++ = (uint8_t)c; 30 33 } 31 34 } -
libcio/fread.x
r7d0d347 r8973acd 16 16 */ 17 17 18 extern int16_t fread( int8_t *buffer, uint16_t size, int16_t number, FILE *stream);18 extern int16_t fread(void *buffer, int16_t size, int16_t number, FILE *stream); -
libcio/fseek.c
r7d0d347 r8973acd 16 16 int16_t fseek(FILE *fp, int32_t pos, int16_t mode) 17 17 { 18 register int 16_t lr;18 register int32_t lr; 19 19 20 20 if (fp->_flags & _DIRTY) { … … 30 30 31 31 fp->_bp = fp->_bend = NULL; 32 fp->_flags &= ~_EOF;32 fp->_flags = (uint8_t)(fp->_flags & ~_EOF); 33 33 34 34 lr = lseek(fp->_unit, pos, mode); -
libcio/fsinit.c
r7d0d347 r8973acd 8 8 #include "ram.h" 9 9 10 int 8_t *Stdbufs; /* buffer chain pointer */10 int32_t *Stdbufs; /* buffer chain pointer */ 11 11 12 12 int8_t Wrkbuf[BPSEC]; /* sector work buffer */ … … 39 39 */ 40 40 41 int16_t _badfio(io_arg arg, int8_t*buff, int16_t len)41 int16_t _badfio(io_arg arg, void *buff, int16_t len) 42 42 { 43 43 (void)arg; … … 69 69 */ 70 70 71 int16_t _nopo(int8_t *name, int16_t flag, int16_t mode, struct channel *chp, struct devtabl *dp)71 int16_t _nopo(int8_t *name, uint16_t flag, struct channel *chp, struct devtabl *dp) 72 72 { 73 73 (void)name; 74 74 (void)flag; 75 (void)mode;76 75 (void)chp; 77 76 (void)dp; … … 99 98 */ 100 99 101 void InitCH(struct channel *cp, int 8_t rdi, int8_t wri, int8_t ioi, int8_t ski, chclo cfp, io_arg charg)100 void InitCH(struct channel *cp, int16_t rdi, int16_t wri, int16_t ioi, int16_t ski, chclo cfp, io_arg charg) 102 101 { 103 102 cp->c_read = rdi; … … 115 114 */ 116 115 117 void Init_CB(FILE *fp, int8_t flags, int8_t unit, int32_t *bufad, int16_t bufsize)116 void Init_CB(FILE *fp, uint8_t flags, int16_t unit, int32_t *bufad, int16_t bufsize) 118 117 { 119 118 fp->_bp = (int8_t *)0L; … … 124 123 fp->_bytbuf = 0; 125 124 fp->_buflen = bufsize; 126 } ;125 } 127 126 128 127 /* … … 139 138 memsetw(Stdbuf, 0, sizeof Stdbuf / 2); /* clear buffers */ 140 139 141 Init_CB(stdin, _BUSY, 0, (int8_t *)0L, BUFSIZ); /* stdin */142 Init_CB(stdout, _BUSY, 1, (int8_t *)0L, 1); /* stdout */143 Init_CB(stderr, _BUSY, 2, (int8_t *)0L, 1);/* stderr */140 Init_CB(stdin, _BUSY, 0, NULL, BUFSIZ); /* stdin */ 141 Init_CB(stdout, _BUSY, 1, NULL, 1); /* stdout */ 142 Init_CB(stderr, _BUSY, 2, NULL, 1); /* stderr */ 144 143 145 144 for (i = 3; i < NSTREAMS; i++) 146 Init_CB(&Cbuffs[i], 0, 0, (int8_t *)0L, 0);145 Init_CB(&Cbuffs[i], 0, 0, NULL, 0); 147 146 148 147 Stdbuf[0][0] = 0L; /* initialize the buffer list */ -
libcio/fsinit.x
r7d0d347 r8973acd 21 21 extern FILE Cbuffs[NSTREAMS]; 22 22 extern int32_t Stdbuf[MAXDFILE][BUFSIZL]; 23 extern int 8_t *Stdbufs;23 extern int32_t *Stdbufs; 24 24 extern int8_t Wrkbuf[BPSEC]; 25 25 extern int16_t _b_sect; … … 37 37 */ 38 38 39 extern void InitCH(struct channel *cp, int 8_t rdi, int8_t wri, int8_t ioi, int8_t ski, chclo cfp, io_arg charg);39 extern void InitCH(struct channel *cp, int16_t rdi, int16_t wri, int16_t ioi, int16_t ski, chclo cfp, io_arg charg); 40 40 extern void InitFS(void); 41 extern void Init_CB(FILE *fp, int8_t flags, int8_t unit, int32_t *bufad, int16_t bufsize);41 extern void Init_CB(FILE *fp, uint8_t flags, int16_t unit, int32_t *bufad, int16_t bufsize); 42 42 extern int16_t _badfd(void); 43 43 extern int16_t _noper(void); 44 44 45 45 extern int16_t _badfc(io_arg arg); 46 extern int16_t _badfio(io_arg arg, int8_t*buff, int16_t len);46 extern int16_t _badfio(io_arg arg, void *buff, int16_t len); 47 47 extern int16_t _nopc(io_arg arg); 48 extern int16_t _nopo(int8_t *name, int16_t flag, int16_t mode, struct channel *chp, struct devtabl *dp);48 extern int16_t _nopo(int8_t *name, uint16_t flag, struct channel *chp, struct devtabl *dp); -
libcio/ftell.c
r7d0d347 r8973acd 57 57 fcp = chp->c_arg; /* point at the FCB */ 58 58 59 dpos = fcp->offset + ( fcp->curlsn << FILESHFT);59 dpos = fcp->offset + ((int32_t)fcp->curlsn << FILESHFT); 60 60 61 61 if (fp->_flags & _DIRTY) /* adjust for the buffering */ -
libcio/fwrite.c
r7d0d347 r8973acd 19 19 */ 20 20 21 int16_t fwrite( int8_t*buffer, int16_t size, int16_t number, FILE *stream)21 int16_t fwrite(void *buffer, int16_t size, int16_t number, FILE *stream) 22 22 { 23 uint8_t *buffer8; 23 24 register int16_t i, j; 25 26 buffer8 = buffer; 24 27 25 28 if (size < 0) /* check size for validity */ … … 31 34 for (i = 0; i < number; ++i) 32 35 for (j = 0; j < size; ++j) 33 if (putc(*buffer ++, stream) EQ EOF)36 if (putc(*buffer8++, stream) EQ EOF) 34 37 return(i); 35 38 -
libcio/fwrite.x
r7d0d347 r8973acd 16 16 */ 17 17 18 extern int16_t fwrite( int8_t*buffer, int16_t size, int16_t number, FILE *stream);18 extern int16_t fwrite(void *buffer, int16_t size, int16_t number, FILE *stream); -
libcio/getc.c
r7d0d347 r8973acd 17 17 return(EOF); 18 18 19 ptr->_flags &= ~_DIRTY;/* reset the dirty buffer bit */19 ptr->_flags = (uint8_t)(ptr->_flags & ~_DIRTY); /* reset the dirty buffer bit */ 20 20 21 21 if (ptr->_buff EQ NULL) /* get a buffer if none exists */ … … 24 24 if ((len = read(ptr->_unit, ptr->_buff, ptr->_buflen)) LE 0) { 25 25 26 ptr->_flags |= ((len EQ 0) ? _EOF : _IOERR);26 ptr->_flags = (uint8_t)(ptr->_flags | ((len EQ 0) ? _EOF : _IOERR)); 27 27 return(EOF); 28 28 } -
libcio/getl.c
r7d0d347 r8973acd 22 22 register int8_t *t; 23 23 24 t = &temp;24 t = (int8_t *)&temp; 25 25 26 *t++ = fgetc(stream);27 *t++ = fgetc(stream);28 *t++ = fgetc(stream);29 *t = fgetc(stream);26 *t++ = (int8_t)fgetc(stream); 27 *t++ = (int8_t)fgetc(stream); 28 *t++ = (int8_t)fgetc(stream); 29 *t = (int8_t)fgetc(stream); 30 30 31 31 return(temp); -
libcio/getw.c
r7d0d347 r8973acd 22 22 register int8_t *t; 23 23 24 t = &temp;24 t = (int8_t *)&temp; 25 25 26 *t++ = fgetc(stream);27 *t = fgetc(stream);26 *t++ = (int8_t)fgetc(stream); 27 *t = (int8_t)fgetc(stream); 28 28 29 29 return(temp); -
libcio/lseek.c
r7d0d347 r8973acd 45 45 46 46 case 1: /* relative to current position */ 47 pos += fp->offset + ( fp->curlsn << FILESHFT);47 pos += fp->offset + ((int32_t)fp->curlsn << FILESHFT); 48 48 49 49 case 0: /* relative to start of file */ … … 72 72 73 73 fp->offset = fp->curlen & (BPSEC -1); 74 fp->curlsn = fp->curlen >> FILESHFT;74 fp->curlsn = (int16_t)(fp->curlen >> FILESHFT); 75 75 fp->modefl |= FC_ERR; 76 76 … … 86 86 87 87 fp->offset = pos & ((int32_t)BPSEC - 1); /* calculate sector offset */ 88 fp->curlsn = pos >> FILESHFT;/* calculate logical sector */88 fp->curlsn = (int16_t)(pos >> FILESHFT); /* calculate logical sector */ 89 89 90 90 if (_seek(fp) < 0) { /* position to the physical sector */ -
libcio/open.c
r7d0d347 r8973acd 19 19 static struct devtabl devtabl[] = { 20 20 21 { "con:", &condev, &devtabl[0] }, /* console device */22 { "CON:", &condev, &devtabl[1] },23 24 { 0, &filedev, NULL} /* this MUST be the last entry */21 { "con:", &condev, &devtabl[0], CON_DEV }, /* console device */ 22 { "CON:", &condev, &devtabl[1], CON_DEV }, 23 24 { 0, &filedev, NULL, -1 } /* this MUST be the last entry */ 25 25 }; 26 26 … … 34 34 */ 35 35 36 int16_t open(int8_t *name, int16_t flag, int16_t mode)36 int16_t open(int8_t *name, uint16_t flag) 37 37 { 38 38 register struct devtabl *dp; 39 39 register struct channel *chp; 40 40 register struct device *dev; 41 int16_t fd, mdmask; 41 int16_t fd; 42 uint16_t mdmask; 42 43 43 44 /* search for a free channel */ … … 84 85 chp->c_close = _nopc; 85 86 86 if ((*dev->d_open)(name, flag, mode,chp, dp) < 0) { /* open */87 if ((*dev->d_open)(name, flag, chp, dp) < 0) { /* open */ 87 88 88 89 chp->c_close = _badfc; /* couldn't open for some reason */ … … 102 103 */ 103 104 104 int16_t opena(int8_t *name, int16_t flag, int16_t mode)105 { 106 return(open(name, flag , mode));105 int16_t opena(int8_t *name, uint16_t flag) 106 { 107 return(open(name, flag)); 107 108 } 108 109 … … 116 117 */ 117 118 118 int16_t openb(int8_t *name, int16_t flag, int16_t mode)119 { 120 return(open(name, flag|O_RAW , mode));119 int16_t openb(int8_t *name, uint16_t flag) 120 { 121 return(open(name, flag|O_RAW)); 121 122 } 122 123 … … 131 132 */ 132 133 133 int16_t creat(int8_t *name , int16_t mode)134 { 135 return(open(name, O_WRONLY|O_TRUNC|O_CREAT , mode));134 int16_t creat(int8_t *name) 135 { 136 return(open(name, O_WRONLY|O_TRUNC|O_CREAT)); 136 137 } 137 138 … … 146 147 */ 147 148 148 int16_t creata(int8_t *name , int16_t mode)149 { 150 return(open(name, O_WRONLY|O_TRUNC|O_CREAT , mode));149 int16_t creata(int8_t *name) 150 { 151 return(open(name, O_WRONLY|O_TRUNC|O_CREAT)); 151 152 } 152 153 … … 161 162 */ 162 163 163 int16_t creatb(int8_t *name , int16_t mode)164 { 165 return(open(name, O_WRONLY|O_TRUNC|O_CREAT|O_RAW , mode));164 int16_t creatb(int8_t *name) 165 { 166 return(open(name, O_WRONLY|O_TRUNC|O_CREAT|O_RAW)); 166 167 } 167 168 … … 174 175 */ 175 176 176 int16_t _fileop(int8_t *name, int16_t flag, int16_t mode, struct channel *chp, struct devtabl *dp)177 int16_t _fileop(int8_t *name, uint16_t flag, struct channel *chp, struct devtabl *dp) 177 178 { 178 179 register struct fcb *fp; 179 180 int8_t tmpname[9], tmpext[4]; 180 181 181 (void)mode;182 182 (void)dp; 183 183 -
libcio/open.x
r7d0d347 r8973acd 16 16 */ 17 17 18 extern int16_t _fileop(int8_t *name, int16_t flag, int16_t mode, struct channel *chp, struct devtabl *dp);19 extern int16_t creat(int8_t *name , int16_t mode);20 extern int16_t creata(int8_t *name , int16_t mode);21 extern int16_t creatb(int8_t *name , int16_t mode);22 extern int16_t open(int8_t *name, int16_t flag, int16_t mode);23 extern int16_t opena(int8_t *name, int16_t flag, int16_t mode);24 extern int16_t openb(int8_t *name, int16_t flag, int16_t mode);18 extern int16_t _fileop(int8_t *name, uint16_t flag, struct channel *chp, struct devtabl *dp); 19 extern int16_t creat(int8_t *name); 20 extern int16_t creata(int8_t *name); 21 extern int16_t creatb(int8_t *name); 22 extern int16_t open(int8_t *name, uint16_t flag); 23 extern int16_t opena(int8_t *name, uint16_t flag); 24 extern int16_t openb(int8_t *name, uint16_t flag); -
libcio/posit.c
r7d0d347 r8973acd 14 14 */ 15 15 16 int16_t posit(int16_t fd, uint16_t pos)16 int16_t posit(int16_t fd, int16_t pos) 17 17 { 18 18 register struct fcb *fp; … … 27 27 28 28 if ((chantab[fd].c_seek EQ 0) 29 OR (( pos << FILESHFT) > fp->curlen)) {29 OR (((int32_t)pos << FILESHFT) > fp->curlen)) { 30 30 31 31 errno = EINVAL; -
libcio/posit.x
r7d0d347 r8973acd 15 15 */ 16 16 17 extern int16_t posit(int16_t fd, uint16_t pos);17 extern int16_t posit(int16_t fd, int16_t pos); -
libcio/putc.c
r7d0d347 r8973acd 59 59 if (data EQ -1) { /* just flushing, not adding data */ 60 60 61 ptr->_flags &= ~_DIRTY;61 ptr->_flags = (uint8_t)(ptr->_flags & ~_DIRTY); 62 62 ptr->_bend = ptr->_bp = NULL; 63 63 return(0); … … 79 79 ptr->_flags |= _DIRTY; 80 80 81 return((*ptr->_bp++ = data) & 0x00FF);81 return((*ptr->_bp++ = (int8_t)data) & 0x00FF); 82 82 } 83 83 … … 134 134 return(flush_(ptr, c & 0xFF)); 135 135 136 return((*ptr->_bp++ = c) & 0xFF);136 return((*ptr->_bp++ = (int8_t)c) & 0xFF); 137 137 } 138 138 -
libcio/putl.c
r7d0d347 r8973acd 12 12 void putl(int32_t w, FILE *stream) 13 13 { 14 if (putc((( w >> 24) & 0xFF), stream) < 0 )14 if (putc(((int16_t)(w >> 24) & 0xFF), stream) < 0) 15 15 return; 16 16 17 if (putc(( (w >> 16) & 0xFF), stream) < 0 )17 if (putc((int16_t)((w >> 16) & 0xFF), stream) < 0) 18 18 return; 19 19 20 if (putc(( (w >> 8) & 0xFF), stream) < 0 )20 if (putc((int16_t)((w >> 8) & 0xFF), stream) < 0) 21 21 return; 22 22 -
libcio/putw.c
r7d0d347 r8973acd 10 10 #include "ram.h" 11 11 12 void putw( uint16_t w, FILE *stream)12 void putw(int32_t w, FILE *stream) 13 13 { 14 14 if (putc(((w >> 8) & 0xFF), stream) < 0 ) -
libcio/putw.x
r7d0d347 r8973acd 16 16 */ 17 17 18 extern void putw( uint16_t w, FILE *stream);18 extern void putw(int32_t w, FILE *stream); -
libcio/read.c
r7d0d347 r8973acd 38 38 #include "ram.h" 39 39 40 static int16_t (*t_read[])(io_arg arg, int8_t*buff, int16_t len) = {40 static int16_t (*t_read[])(io_arg arg, void *buff, int16_t len) = { 41 41 42 42 _badfio, /* 0 - invalid type */ … … 52 52 */ 53 53 54 int16_t read(int16_t fd, int8_t *buff, uint16_t len)54 int16_t read(int16_t fd, void *buff, int16_t len) 55 55 { 56 56 register struct channel *chp; … … 73 73 */ 74 74 75 int16_t _getsec(struct fcb *fp, int8_t *buf, uint16_t len)75 int16_t _getsec(struct fcb *fp, void *buf, int16_t len) 76 76 { 77 77 if ((errno = ReadRN(fp, Wrkbuf)) NE 0) /* get current sector */ … … 98 98 */ 99 99 100 int16_t _filerd( struct fcb *fp, int8_t *buffer, uint16_t len)100 int16_t _filerd(io_arg arg, void *buffer, int16_t len) 101 101 { 102 register uint16_t l; 103 register uint16_t j, k; 104 register int32_t curpos, newpos; 102 struct fcb *fp; 103 int8_t *buffer8; 104 register int16_t l; 105 register int16_t j, k; 106 register int32_t cpos, npos; 107 108 fp = (struct fcb *)arg; 109 buffer8 = buffer; 105 110 106 111 l = 0; 107 c urpos = fp->offset + (fp->curlsn << FILESHFT);108 n ewpos = curpos + len;112 cpos = fp->offset + ((int32_t)fp->curlsn << FILESHFT); 113 npos = cpos + len; 109 114 110 115 #if DEBUGIT 111 116 if (fsdebug) 112 117 printf("_filerd(): len=%u, curpos=%ld, newpos=%ld, curlen=%ld\n", 113 len, c urpos, newpos, fp->curlen);118 len, cpos, npos, fp->curlen); 114 119 #endif 115 120 116 if (n ewpos GT fp->curlen) {121 if (npos GT fp->curlen) { 117 122 118 len = fp->curlen - curpos;123 len = (int16_t)(fp->curlen - cpos); 119 124 120 125 #if DEBUGIT … … 129 134 l = len; 130 135 131 if (_getsec(fp, buffer , l)) /* read what we can */136 if (_getsec(fp, buffer8, l)) /* read what we can */ 132 137 return(len); /* return if ERROR */ 133 138 } 134 139 135 if ( k = (len - l) / BPSEC)/* see what we still need */136 if ((j = blkrd(fp, buffer+ l, k)) NE 0)140 if ((k = (len - l) / BPSEC)) { /* see what we still need */ 141 if ((j = blkrd(fp, buffer8 + l, k)) NE 0) 137 142 return((k - j) * BPSEC + l); /* return bytes read */ 143 } 138 144 139 145 l += k * BPSEC; /* adjust l by what we just read */ 140 146 141 147 if (l < len) /* see if we still need a partial sector */ 142 if (_getsec(fp, buffer + l, len - l)) /* read partial sector */148 if (_getsec(fp, buffer8 + l, len - l)) /* read partial sector */ 143 149 return(l); /* return if ERROR or EOF */ 144 150 -
libcio/read.x
r7d0d347 r8973acd 8 8 9 9 #include "biosdefs.h" 10 #include "fspars.h" 10 11 #include "stdint.h" 11 12 … … 16 17 */ 17 18 18 extern int16_t _filerd( struct fcb *fp, int8_t *buffer, uint16_t len);19 extern int16_t _getsec(struct fcb *fp, int8_t *buf, uint16_t len);20 extern int16_t read(int16_t fd, int8_t *buff, uint16_t len);19 extern int16_t _filerd(io_arg arg, void *buffer, int16_t len); 20 extern int16_t _getsec(struct fcb *fp, void *buf, int16_t len); 21 extern int16_t read(int16_t fd, void *buff, int16_t len); -
libcio/readrn.c
r7d0d347 r8973acd 30 30 int32_t brc; /* bios return code */ 31 31 32 if ( sv = _seek(fcp))/* try to find the sector we want */32 if ((sv = _seek(fcp))) { /* try to find the sector we want */ 33 33 if (sv < 0) { 34 34 … … 41 41 return(1); /* return: EOF */ 42 42 } 43 } 43 44 44 45 #if DEBUGIT … … 49 50 50 51 #if TBUFFER 51 if ( brc = _secrd(buf, (int16_t)fcp->curdsn)) {52 if ((brc = _secrd(buf, (int16_t)fcp->curdsn))) { 52 53 #else 53 54 if (brc = BIOS(B_RDWR, 0, buf, 1, (short)fcp->curdsn, 0)) { -
libcio/scan.c
r7d0d347 r8973acd 38 38 while (maxwide--) { 39 39 40 if ((cp = index(list, ( *gsub)(0))) EQ NULL) {40 if ((cp = index(list, (int8_t)(*gsub)(0))) EQ NULL) { 41 41 42 42 (*gsub)(1); … … 106 106 gsub = getsub; 107 107 108 while ( c = *fmt++) {108 while ((c = *fmt++)) { 109 109 110 110 if (c EQ '%') { … … 180 180 *(int32_t *)(*args++) = lv; 181 181 else 182 **args++ = lv;182 **args++ = (int16_t)lv; 183 183 ++count; 184 184 } … … 220 220 221 221 for (cp = tlist ; (c = *fmt++) != ']' ; ) 222 *cp++ = c;222 *cp++ = (int8_t)c; 223 223 224 224 *cp = 0; … … 236 236 237 237 if (!dontdo) 238 cp = *args++; 238 cp = (int8_t *)*args++; 239 else 240 cp = NULL; /* fix compiler warning */ 239 241 240 242 while (maxwide--) { … … 244 246 245 247 if (lflag ? 246 (index(tlist, c) NE 0) :247 (index(tlist, c) EQ 0)) {248 (index(tlist, (int8_t)c) NE 0) : 249 (index(tlist, (int8_t)c) EQ 0)) { 248 250 249 251 (*gsub)(1); /* unget last character */ … … 252 254 253 255 if (!dontdo) 254 *cp++ = c;256 *cp++ = (int8_t)c; 255 257 } 256 258 … … 269 271 if (!dontdo) { 270 272 271 *(int8_t *)(*args++) = c;273 *(int8_t *)(*args++) = (int8_t)c; 272 274 ++count; 273 275 } -
libcio/ungetc.c
r7d0d347 r8973acd 13 13 return(EOF); 14 14 15 *--ptr->_bp = c;15 *--ptr->_bp = (int8_t)c; 16 16 17 17 return(c); -
libcio/write.c
r7d0d347 r8973acd 12 12 /* write routine dispatch table */ 13 13 14 static int16_t (*wr_tab[])(io_arg arg, int8_t*buff, int16_t len) = {14 static int16_t (*wr_tab[])(io_arg arg, void *buff, int16_t len) = { 15 15 16 16 _badfio, /* 0 - invalid entry */ … … 25 25 */ 26 26 27 int16_t _putsec(struct fcb *fp, int8_t *buf, uint16_t len)27 int16_t _putsec(struct fcb *fp, void *buf, int16_t len) 28 28 { 29 29 #if DEBUGIT … … 92 92 */ 93 93 94 int16_t _filewr( struct fcb *fp, int8_t *buffer, uint16_t len)94 int16_t _filewr(io_arg arg, void *buffer, int16_t len) 95 95 { 96 register uint16_t j, k, l; 96 struct fcb *fp; 97 int8_t *buffer8; 98 register int16_t j, k, l; 97 99 int16_t clustr; 98 register int32_t curpos; 99 100 curpos = fp->offset + (fp->curlsn << FILESHFT); /* get position */ 100 register int32_t cpos; 101 102 fp = (struct fcb *)arg; 103 buffer8 = buffer; 104 105 cpos = fp->offset + ((int32_t)fp->curlsn << FILESHFT); /* get position */ 101 106 102 107 if (fp->de.bclust EQ 0) { /* see if we need to allocate */ … … 104 109 #if DEBUGIT 105 110 if (fsdebug) 106 if (c urpos)111 if (cpos) 107 112 printf("_filewr(): ERROR - bclust EQ 0 and curpos (%ld) NE 0\n", 108 c urpos);113 cpos); 109 114 #endif 110 115 … … 115 120 } 116 121 117 fp->de.bclust = micon s(clustr);/* update FCB */122 fp->de.bclust = micon16((uint16_t)clustr); /* update FCB */ 118 123 _ptcl12(_thefat, clustr, 0x0FF8); /* update FAT */ 119 124 _fatmod = TRUE; … … 137 142 if (fsdebug) 138 143 printf("_filewr(): init pos=%ld, len=%u, curcls=%u, offset=%u\n", 139 c urpos, len, fp->curcls, fp->offset);144 cpos, len, fp->curcls, fp->offset); 140 145 #endif 141 146 … … 145 150 l = len; 146 151 147 if (_putsec(fp, buffer , l)) /* fill up the sector */152 if (_putsec(fp, buffer8, l)) /* fill up the sector */ 148 153 return(-1); 149 154 } 150 155 151 if ( k = (len - l) / BPSEC) { /* write out any full sectors */152 153 if ((j = blkwr(fp, buffer + l, k)) NE 0) {156 if ((k = (len - l) / BPSEC)) { /* write out any full sectors */ 157 158 if ((j = blkwr(fp, buffer8 + l, k)) NE 0) { 154 159 155 160 l += (k - j) * BPSEC; /* update amount written */ 156 161 157 if ((c urpos + l) > fp->curlen) /* udpate file length */158 fp->de.flen = micon l(fp->curlen = curpos + l);162 if ((cpos + l) > fp->curlen) /* udpate file length */ 163 fp->de.flen = micon32((uint32_t)(fp->curlen = cpos + l)); 159 164 160 165 #if DEBUGIT … … 172 177 if (l < len) { /* write out partial sector at end */ 173 178 174 if (_putsec(fp, buffer + l, len - l)) {175 176 if ((c urpos + l) > fp->curlen) /* update file length */177 fp->de.flen = micon l(fp->curlen = curpos + l);179 if (_putsec(fp, buffer8 + l, len - l)) { 180 181 if ((cpos + l) > fp->curlen) /* update file length */ 182 fp->de.flen = micon32((uint32_t)(fp->curlen = cpos + l)); 178 183 179 184 #if DEBUGIT … … 187 192 } 188 193 189 if ((c urpos + len) > fp->curlen) /* update file length */190 fp->de.flen = micon l(fp->curlen = curpos + len);194 if ((cpos + len) > fp->curlen) /* update file length */ 195 fp->de.flen = micon32((uint32_t)(fp->curlen = cpos + len)); 191 196 192 197 #if DEBUGIT … … 205 210 */ 206 211 207 int16_t write(int16_t fd, int8_t *buff, uint16_t len)212 int16_t write(int16_t fd, void *buff, int16_t len) 208 213 { 209 214 register struct channel *chp; -
libcio/write.x
r7d0d347 r8973acd 8 8 9 9 #include "biosdefs.h" 10 #include "fspars.h" 10 11 #include "stdint.h" 11 12 … … 16 17 */ 17 18 18 extern int16_t _filewr( struct fcb *fp, int8_t *buffer, uint16_t len);19 extern int16_t _putsec(struct fcb *fp, int8_t *buf, uint16_t len);20 extern int16_t write(int16_t fd, int8_t *buff, uint16_t len);19 extern int16_t _filewr(io_arg arg, void *buffer, int16_t len); 20 extern int16_t _putsec(struct fcb *fp, void *buf, int16_t len); 21 extern int16_t write(int16_t fd, void *buff, int16_t len); -
libcio/writern.c
r7d0d347 r8973acd 30 30 int32_t brc; /* bios return code */ 31 31 32 if ( sv = _seek(fcp)) { /* try to find the sector we want */32 if ((sv = _seek(fcp))) { /* try to find the sector we want */ 33 33 34 34 if (sv < 0) { /* seek error ? */ … … 67 67 /* write the sector */ 68 68 69 if ( brc = BIOS(B_RDWR, 1, buf, 1, (int16_t)fcp->curdsn, 0)) {69 if ((brc = BIOS(B_RDWR, 1, buf, 1, (int16_t)fcp->curdsn, 0))) { 70 70 71 71 #if DEBUGIT
Note:
See TracChangeset
for help on using the changeset viewer.