- Timestamp:
- 07/09/2017 04:45:34 PM (8 years ago)
- Branches:
- master
- Children:
- 8618599
- Parents:
- 0292fbb
- Location:
- libcio
- Files:
-
- 43 edited
Legend:
- Unmodified
- Added
- Removed
-
libcio/atoi.c
r0292fbb r7258c6a 9 9 #include "ctype.h" 10 10 11 int atoi(char*cp)11 int16_t atoi(int8_t *cp) 12 12 { 13 register u nsignedi;14 register short sign;13 register uint16_t i; 14 register int16_t sign; 15 15 16 16 sign = 0; -
libcio/atol.c
r0292fbb r7258c6a 9 9 #include "ctype.h" 10 10 11 long atol(char*cp)11 int32_t atol(int8_t *cp) 12 12 { 13 register longn;14 register short sign;13 register int32_t n; 14 register int16_t sign; 15 15 16 16 sign = 0; -
libcio/blkrd.c
r0292fbb r7258c6a 40 40 #endif 41 41 42 extern int _nsic(struct fcb *fcp, struct bpb *bpp, char*fp);42 extern int16_t _nsic(struct fcb *fcp, struct bpb *bpp, int8_t *fp); 43 43 44 extern long_berrno; /* last file system bios error number */44 extern int32_t _berrno; /* last file system bios error number */ 45 45 46 extern u nsigned_thefat[]; /* current file allocation table */46 extern uint16_t _thefat[]; /* current file allocation table */ 47 47 48 48 extern struct bpb *_thebpb; /* current bios parameter block */ … … 52 52 /* WARNING: this ONLY works for 512 byte sectors, 9 sectors per track */ 53 53 54 extern short _b_tbuf[9][256]; /* the track buffer */54 extern int16_t _b_tbuf[9][256]; /* the track buffer */ 55 55 56 extern short _b_trak; /* current track */57 extern short _b_side; /* current side */58 extern short _b_sect; /* current sector */59 extern short _b_tsec; /* current base sector of current track */56 extern int16_t _b_trak; /* current track */ 57 extern int16_t _b_side; /* current side */ 58 extern int16_t _b_sect; /* current sector */ 59 extern int16_t _b_tsec; /* current base sector of current track */ 60 60 61 61 #endif … … 73 73 */ 74 74 75 long _secrd(char *buf, short rec)75 int32_t _secrd(int8_t *buf, int16_t rec) 76 76 { 77 register short track, side, sector;78 longbrc;77 register int16_t track, side, sector; 78 int32_t brc; 79 79 80 80 if (_thebpb->dspt NE 9) /* make sure we can do this */ … … 118 118 } 119 119 120 memcpy(buf, ( char*)_b_tbuf[sector], 512);120 memcpy(buf, (int8_t *)_b_tbuf[sector], 512); 121 121 return(0L); 122 122 } … … 135 135 */ 136 136 137 int blkrd(struct fcb *fcp, char *buf, int ns)137 int16_t blkrd(struct fcb *fcp, int8_t *buf, int16_t ns) 138 138 { 139 register longbrc; /* bios return code */140 register int rb; /* _nsic return code */139 register int32_t brc; /* bios return code */ 140 register int16_t rb; /* _nsic return code */ 141 141 142 142 if (ns < 0) /* can't read a negative number of sectors */ … … 152 152 153 153 #if TBUFFER 154 if (brc = _secrd(buf, ( short)fcp->curdsn)) {154 if (brc = _secrd(buf, (int16_t)fcp->curdsn)) { 155 155 #else 156 156 if (brc = BIOS(B_RDWR, 0, buf, 1, (short)fcp->curdsn, 0)) { -
libcio/blkwr.c
r0292fbb r7258c6a 24 24 #include "fspars.h" 25 25 26 extern int _nsic(struct fcb *fcp, struct bpb *bpp, char*fp);27 extern int _alcnew(struct fcb *fcp);28 extern int _newcls(void);29 30 extern long_berrno; /* last file system bios error number */26 extern int16_t _nsic(struct fcb *fcp, struct bpb *bpp, int8_t *fp); 27 extern int16_t _alcnew(struct fcb *fcp); 28 extern int16_t _newcls(void); 29 30 extern int32_t _berrno; /* last file system bios error number */ 31 31 32 32 extern struct bpb *_thebpb; /* current bios parameter block */ 33 33 34 extern u nsigned_thefat[]; /* current file allocation table */35 36 extern int _fatmod; /* FAT modified flag */34 extern uint16_t _thefat[]; /* current file allocation table */ 35 36 extern int16_t _fatmod; /* FAT modified flag */ 37 37 38 38 #if DEBUGIT … … 44 44 /* WARNING: this ONLY works for 512 byte sectors, 9 sectors per track */ 45 45 46 extern short _b_tbuf[9][256]; /* the track buffer */47 48 extern short _b_trak; /* current track */49 extern short _b_side; /* current side */50 extern short _b_sect; /* current sector */51 extern short _b_tsec; /* base sector for current track */46 extern int16_t _b_tbuf[9][256]; /* the track buffer */ 47 48 extern int16_t _b_trak; /* current track */ 49 extern int16_t _b_side; /* current side */ 50 extern int16_t _b_sect; /* current sector */ 51 extern int16_t _b_tsec; /* base sector for current track */ 52 52 53 53 #endif … … 65 65 */ 66 66 67 long _secwr(char *buf, short rec)67 int32_t _secwr(int8_t *buf, int16_t rec) 68 68 { 69 register short track, side, sector;69 register int16_t track, side, sector; 70 70 71 71 if (_thebpb->dspt NE 9) /* make sure we can do this */ … … 101 101 return(0L); 102 102 103 memcpy(( char*)_b_tbuf[sector], buf, 512); /* update the buffer */103 memcpy((int8_t *)_b_tbuf[sector], buf, 512); /* update the buffer */ 104 104 105 105 #if DEBUGIT … … 124 124 */ 125 125 126 int blkwr(struct fcb *fcp, char *buf, int ns)126 int16_t blkwr(struct fcb *fcp, int8_t *buf, int16_t ns) 127 127 { 128 longrc;129 short clustr;128 int32_t rc; 129 int16_t clustr; 130 130 131 131 while (ns > 0) { /* write a sector at a time */ … … 141 141 #endif 142 142 143 if (rc = BIOS(B_RDWR, 1, buf, 1, ( short)fcp->curdsn, 0)) {143 if (rc = BIOS(B_RDWR, 1, buf, 1, (int16_t)fcp->curdsn, 0)) { 144 144 145 145 #if DEBUGIT … … 154 154 155 155 #if TBUFFER 156 _secwr(buf, ( short)fcp->curdsn);156 _secwr(buf, (int16_t)fcp->curdsn); 157 157 #endif 158 158 … … 193 193 #endif 194 194 195 if (rc = BIOS(B_RDWR, 1, buf, 1, ( short)fcp->curdsn, 0)) {195 if (rc = BIOS(B_RDWR, 1, buf, 1, (int16_t)fcp->curdsn, 0)) { 196 196 197 197 #if DEBUGIT … … 206 206 207 207 #if TBUFFER 208 _secwr(buf, ( short)fcp->curdsn);208 _secwr(buf, (int16_t)fcp->curdsn); 209 209 #endif 210 210 … … 246 246 #endif 247 247 248 if (rc = BIOS(B_RDWR, 1, buf, 1, ( short)fcp->curdsn, 0)) {248 if (rc = BIOS(B_RDWR, 1, buf, 1, (int16_t)fcp->curdsn, 0)) { 249 249 250 250 #if DEBUGIT … … 259 259 260 260 #if TBUFFER 261 _secwr(buf, ( short)fcp->curdsn);261 _secwr(buf, (int16_t)fcp->curdsn); 262 262 #endif 263 263 -
libcio/close.c
r0292fbb r7258c6a 12 12 #include "stddefs.h" 13 13 14 extern int _badfd(void);15 extern int ClsFile(struct fcb *fcp);14 extern int16_t _badfd(void); 15 extern int16_t ClsFile(struct fcb *fcp); 16 16 extern void _clsvol(void); 17 17 18 extern int _fatmod, _dirmod;18 extern int16_t _fatmod, _dirmod; 19 19 extern struct bpb *_thebpb; 20 20 extern struct dirent _thedir[]; 21 extern u nsigned_thefat[];21 extern uint16_t _thefat[]; 22 22 23 23 /* … … 72 72 */ 73 73 74 int close(int fd)74 int16_t close(int16_t fd) 75 75 { 76 76 register struct channel *chp; 77 register int rc;77 register int16_t rc; 78 78 79 79 if ((fd < 0) OR (fd > MAXCHAN)) { … … 112 112 */ 113 113 114 int _filecl(struct fcb *fp)114 int16_t _filecl(struct fcb *fp) 115 115 { 116 register int rc;116 register int16_t rc; 117 117 118 118 rc = ClsFile(fp); /* close the FCB */ … … 129 129 void _fd_cls(void) 130 130 { 131 register int fd;131 register int16_t fd; 132 132 133 133 for (fd = 0; fd < MAXCHAN; ++fd) -
libcio/clusmap.c
r0292fbb r7258c6a 12 12 #include "stddefs.h" 13 13 14 extern short micons(short wi);15 extern u nsigned _gtcl12(char *fat, unsignedcl);16 extern long miconl(longwi);14 extern int16_t micons(int16_t wi); 15 extern uint16_t _gtcl12(int8_t *fat, uint16_t cl); 16 extern int32_t miconl(int32_t wi); 17 17 18 18 extern struct bpb *_thebpb; 19 extern u nsigned_thefat[];20 21 extern int _filecl(struct fcb *fp);22 extern int _noper(void);23 24 /* 25 26 */ 27 28 static char*mfname[] = { /* FCB flag names */19 extern uint16_t _thefat[]; 20 21 extern int16_t _filecl(struct fcb *fp); 22 extern int16_t _noper(void); 23 24 /* 25 26 */ 27 28 static int8_t *mfname[] = { /* FCB flag names */ 29 29 30 30 "?D0", /* D0 - 0001 */ … … 53 53 */ 54 54 55 static char*dfname[] = {55 static int8_t *dfname[] = { 56 56 57 57 "RDONLY", /* D0 - 01 */ … … 65 65 }; 66 66 67 static char*ffname[] = {67 static int8_t *ffname[] = { 68 68 69 69 "BUSY ", /* D0 - 01 */ … … 81 81 */ 82 82 83 static int waitcr(void)84 { 85 charc;83 static int16_t waitcr(void) 84 { 85 int8_t c; 86 86 87 87 BIOS(B_PUTC, CON_DEV, '\007'); … … 106 106 */ 107 107 108 int ClusMap(struct fcb *fcp)109 { 110 int clus, nc;111 longalsize, bused, bunused;108 int16_t ClusMap(struct fcb *fcp) 109 { 110 int16_t clus, nc; 111 int32_t alsize, bused, bunused; 112 112 113 113 if (!(fcp->modefl & FC_OPN)) { … … 175 175 struct fcb *FCBmode(struct fcb *fcp) 176 176 { 177 register u nsigned short mf;178 register short i;177 register uint16_t mf; 178 register int16_t i; 179 179 180 180 printf(" flags: "); … … 254 254 */ 255 255 256 void MapFAT( char *fat, short ncl, short stops)257 { 258 register int i;256 void MapFAT(int8_t *fat, int16_t ncl, int16_t stops) 257 { 258 register int16_t i; 259 259 260 260 printf("\nCluster dump of FAT at 0x%08.8lx (%d entries):\n", … … 290 290 FILE *FILEfl(FILE *fp) 291 291 { 292 register u nsigned short mf;293 register short i;292 register uint16_t mf; 293 register int16_t i; 294 294 295 295 printf(" _flags: "); … … 320 320 void FILEpr(FILE *fp) 321 321 { 322 int (*arg)(), ft;323 char*ds, *fsn, *fse;322 int16_t (*arg)(), ft; 323 int8_t *ds, *fsn, *fse; 324 324 struct fcb *fcp; 325 325 … … 379 379 */ 380 380 381 struct fcb *fd2fcb( short fd)381 struct fcb *fd2fcb(int16_t fd) 382 382 { 383 383 if ((fd < 0) OR (fd > MAXCHAN)) -
libcio/conin.c
r0292fbb r7258c6a 14 14 #include "stddefs.h" 15 15 16 extern void *memcpy(void *vp1, void *vp2, int n);17 extern int readbuf(int dev, char*buf);18 extern void writeln(int unit, char*buf);16 extern void *memcpy(void *vp1, void *vp2, int16_t n); 17 extern int16_t readbuf(int16_t dev, int8_t *buf); 18 extern void writeln(int16_t unit, int8_t *buf); 19 19 20 char_ConBuf[258]; /* console input buffer */21 int _CBused;20 int8_t _ConBuf[258]; /* console input buffer */ 21 int16_t _CBused; 22 22 23 int _conin(char *buff, int len)23 int16_t _conin(int8_t *buff, int16_t len) 24 24 { 25 int nbp;26 register int l;25 int16_t nbp; 26 register int16_t l; 27 27 28 28 if (_ConBuf[1] EQ 0) { -
libcio/conwr.c
r0292fbb r7258c6a 19 19 ============================================================================ 20 20 */ 21 int _conwr(int kind, char *buff, int len)21 int16_t _conwr(int16_t kind, int8_t *buff, int16_t len) 22 22 { 23 register int count;23 register int16_t count; 24 24 25 25 for (count = 0; count < len; ++count) -
libcio/dirfns.c
r0292fbb r7258c6a 9 9 #include "biosdefs.h" 10 10 11 extern long sprintf(char *str, char*fmt, ...);11 extern int32_t sprintf(int8_t *str, int8_t *fmt, ...); 12 12 13 static charatrcons[] = "ADVSHR";13 static int8_t atrcons[] = "ADVSHR"; 14 14 15 15 /* … … 19 19 */ 20 20 21 char *atrstr(short atr, chars[])21 int8_t *atrstr(int16_t atr, int8_t s[]) 22 22 { 23 register short i, j;23 register int16_t i, j; 24 24 25 25 i = 0x20; … … 42 42 */ 43 43 44 static char*mnames[] = {44 static int8_t *mnames[] = { 45 45 46 46 "???", … … 65 65 */ 66 66 67 char *mname(short n)67 int8_t *mname(int16_t n) 68 68 { 69 69 return((n < 1 || n > 12) ? mnames[0] : mnames[n]); … … 81 81 */ 82 82 83 char *dtunpk(short din, short tin, short fmt, char*s)83 int8_t *dtunpk(int16_t din, int16_t tin, int16_t fmt, int8_t *s) 84 84 { 85 register short ftm, fdt;85 register int16_t ftm, fdt; 86 86 87 87 ftm = ((tin << 8) & 0xFF00) | ((tin >> 8) & 0x00FF); -
libcio/fgets.c
r0292fbb r7258c6a 11 11 #define EATCHAR '\n' /* character to be "eaten" on input */ 12 12 13 int agetc(FILE *ptr)13 int16_t agetc(FILE *ptr) 14 14 { 15 register int c;15 register int16_t c; 16 16 17 17 top: … … 33 33 } 34 34 35 char *gets(char*line)35 int8_t *gets(int8_t *line) 36 36 { 37 register char*cp;38 register int i;37 register int8_t *cp; 38 register int16_t i; 39 39 40 40 cp = line; … … 51 51 } 52 52 53 char *fgets(char *s, int n, FILE *fp)53 int8_t *fgets(int8_t *s, int16_t n, FILE *fp) 54 54 { 55 register int c;56 register char*cp;55 register int16_t c; 56 register int8_t *cp; 57 57 58 58 cp = s; -
libcio/filesys.c
r0292fbb r7258c6a 29 29 #define DE_NULL ((struct dirent *)0L) 30 30 31 extern short micons(short wi);32 extern long miconl(longwi);33 extern void _ptcl12(u nsigned *fat, unsigned cl, unsignedval);34 extern char *FilName(char *s, char*p);35 extern char *FilExt(char *s, char*p);31 extern int16_t micons(int16_t wi); 32 extern int32_t miconl(int32_t wi); 33 extern void _ptcl12(uint16_t *fat, uint16_t cl, uint16_t val); 34 extern int8_t *FilName(int8_t *s, int8_t *p); 35 extern int8_t *FilExt(int8_t *s, int8_t *p); 36 36 37 37 #if DEBUGIT … … 44 44 struct dirent *_dptr; /* internal directory pointer */ 45 45 46 u nsigned_thefat[MAXFAT * WDPSEC]; /* file allocation table */47 48 int _fatin; /* FAT has been read */49 int _dirin; /* directory has been read */50 int _bpbin; /* BPB has been read */51 int _fatmod; /* FAT modified flag */52 int _dirmod; /* directory modified flag */53 54 long_berrno; /* BIOS error number */46 uint16_t _thefat[MAXFAT * WDPSEC]; /* file allocation table */ 47 48 int16_t _fatin; /* FAT has been read */ 49 int16_t _dirin; /* directory has been read */ 50 int16_t _bpbin; /* BPB has been read */ 51 int16_t _fatmod; /* FAT modified flag */ 52 int16_t _dirmod; /* directory modified flag */ 53 54 int32_t _berrno; /* BIOS error number */ 55 55 56 56 /* … … 66 66 */ 67 67 68 u nsigned _cl2lsn(struct bpb *bpp, unsignedclnum)68 uint16_t _cl2lsn(struct bpb *bpp, uint16_t clnum) 69 69 { 70 70 return(bpp->datrec + (bpp->clsiz * (clnum - 2)) ); … … 78 78 */ 79 79 80 u nsigned _gtcl12(char *fat, unsignedcl)81 { 82 register u nsignedcla, clt;80 uint16_t _gtcl12(int8_t *fat, uint16_t cl) 81 { 82 register uint16_t cla, clt; 83 83 84 84 cla = cl + (cl >> 1); 85 clt = ((u nsigned)0xFF00 & (fat[cla+1] << 8))86 | ((u nsigned)0x00FF & fat[cla]);85 clt = ((uint16_t)0xFF00 & (fat[cla+1] << 8)) 86 | ((uint16_t)0x00FF & fat[cla]); 87 87 88 88 if (cl & 1) 89 89 clt >>= 4; 90 90 91 clt &= (u nsigned)0x0FFF;91 clt &= (uint16_t)0x0FFF; 92 92 return(clt); 93 93 } … … 104 104 */ 105 105 106 u nsigned _getfat(unsigned *bufad, unsignednfat, struct bpb *bpp)107 { 108 u nsignedfatsec;106 uint16_t _getfat(uint16_t *bufad, uint16_t nfat, struct bpb *bpp) 107 { 108 uint16_t fatsec; 109 109 110 110 fatsec = nfat ? bpp->fatrec : (bpp->fatrec - bpp->fsiz); 111 return(BIOS(B_RDWR, 0, ( char*)bufad, bpp->fsiz, fatsec, 0));111 return(BIOS(B_RDWR, 0, (int8_t *)bufad, bpp->fsiz, fatsec, 0)); 112 112 } 113 113 … … 123 123 */ 124 124 125 int _rdfat(unsigned*bufad, struct bpb *bpp)125 int16_t _rdfat(uint16_t *bufad, struct bpb *bpp) 126 126 { 127 127 if (_getfat(bufad, bpp, 0)) { … … 143 143 */ 144 144 145 int _rdroot(unsigned*buf, struct bpb *bpp)146 { 147 return(BIOS(B_RDWR, 0, ( char*)buf, bpp->rdlen,145 int16_t _rdroot(uint16_t *buf, struct bpb *bpp) 146 { 147 return(BIOS(B_RDWR, 0, (int8_t *)buf, bpp->rdlen, 148 148 (bpp->fatrec + bpp->fsiz), 0)); 149 149 } … … 162 162 */ 163 163 164 int _nsic(struct fcb *fcp, struct bpb *bpp, char*fp)165 { 166 register u nsignedtfe;164 int16_t _nsic(struct fcb *fcp, struct bpb *bpp, int8_t *fp) 165 { 166 register uint16_t tfe; 167 167 168 168 /* check the FCB flags */ … … 261 261 struct dirent *_dsrch(struct dirent *de) 262 262 { 263 u nsignedi, dl;263 uint16_t i, dl; 264 264 register struct dirent *dp; 265 265 … … 298 298 struct dirent *_dsnew(void) 299 299 { 300 u nsignedi, dl;300 uint16_t i, dl; 301 301 register struct dirent *dp; 302 302 … … 332 332 */ 333 333 334 void _deadio(struct fcb *fcp, int err)334 void _deadio(struct fcb *fcp, int16_t err) 335 335 { 336 336 fcp->clsec = 0; … … 355 355 */ 356 356 357 int _seek(struct fcb *fcp)358 { 359 register u nsignedacls, rcls, nc;360 u nsignedsic, spc;357 int16_t _seek(struct fcb *fcp) 358 { 359 register uint16_t acls, rcls, nc; 360 uint16_t sic, spc; 361 361 362 362 if (!(fcp->modefl & FC_OPN)) { /* file must be open */ … … 461 461 */ 462 462 463 int _ftrnc(struct dirent *dp)464 { 465 register u nsignedacls, ncls;463 int16_t _ftrnc(struct dirent *dp) 464 { 465 register uint16_t acls, ncls; 466 466 467 467 #if DEBUGIT … … 525 525 */ 526 526 527 int _newcls(void)528 { 529 register int tc, i;527 int16_t _newcls(void) 528 { 529 register int16_t tc, i; 530 530 531 531 tc = _thebpb->numcl; … … 548 548 */ 549 549 550 int _alcnew(struct fcb *fcp)551 { 552 register int ac, nc, pc;550 int16_t _alcnew(struct fcb *fcp) 551 { 552 register int16_t ac, nc, pc; 553 553 554 554 #if DEBUGIT … … 639 639 */ 640 640 641 int _fmake(struct fcb *fcp)641 int16_t _fmake(struct fcb *fcp) 642 642 { 643 643 register struct dirent *dp; … … 664 664 */ 665 665 666 int _opnvol(void)667 { 668 register longdrc;666 int16_t _opnvol(void) 667 { 668 register int32_t drc; 669 669 670 670 /* check for media change if we already have a BPB */ … … 750 750 */ 751 751 752 int _opfcb(struct fcb *fcp)753 { 754 int rc;752 int16_t _opfcb(struct fcb *fcp) 753 { 754 int16_t rc; 755 755 756 756 /* check for an already open FCB */ … … 892 892 */ 893 893 894 int _inifcb(struct fcb *fcp, char *name, char *ext, int mode)895 { 896 int fl;897 register int i;898 register char*s1, *s2, c;894 int16_t _inifcb(struct fcb *fcp, int8_t *name, int8_t *ext, int16_t mode) 895 { 896 int16_t fl; 897 register int16_t i; 898 register int8_t *s1, *s2, c; 899 899 900 900 /* clear the FCB */ 901 901 902 memset(( char*)fcp, 0, sizeof (struct fcb));902 memset((int8_t *)fcp, 0, sizeof (struct fcb)); 903 903 904 904 /* check for valid flags */ … … 1024 1024 */ 1025 1025 1026 int ClsFile(struct fcb *fcp)1026 int16_t ClsFile(struct fcb *fcp) 1027 1027 { 1028 1028 register struct dirent *dp; … … 1136 1136 */ 1137 1137 1138 short fcbinit(char*name, struct fcb *fcp)1139 { 1140 chartmpname[9], tmpext[4];1138 int16_t fcbinit(int8_t *name, struct fcb *fcp) 1139 { 1140 int8_t tmpname[9], tmpext[4]; 1141 1141 1142 1142 return(_inifcb(fcp, FilName(name, tmpname), FilExt(name, tmpext), 0)); … … 1153 1153 */ 1154 1154 1155 int DelFile(struct fcb *fcp)1155 int16_t DelFile(struct fcb *fcp) 1156 1156 { 1157 1157 #if DEBUGIT -
libcio/filname.c
r0292fbb r7258c6a 20 20 */ 21 21 22 char *FilName(char *s, char*p)22 int8_t *FilName(int8_t *s, int8_t *p) 23 23 { 24 register char*tp;25 register int i;24 register int8_t *tp; 25 register int16_t i; 26 26 27 27 tp = p; … … 59 59 */ 60 60 61 char *FilExt(char *s, char*p)61 int8_t *FilExt(int8_t *s, int8_t *p) 62 62 { 63 register charc, *tp;64 register int i;63 register int8_t c, *tp; 64 register int16_t i; 65 65 66 66 tp = p; -
libcio/flread.c
r0292fbb r7258c6a 19 19 */ 20 20 21 int flread(char *buff, longlen, FILE *fp)21 int16_t flread(int8_t *buff, int32_t len, FILE *fp) 22 22 { 23 register int ilen;23 register int16_t ilen; 24 24 25 25 while (len > 0L) { 26 26 27 if (len GE ( long)CHUNK) {27 if (len GE (int32_t)CHUNK) { 28 28 29 29 if (1 NE fread(buff, CHUNK, 1, fp)) 30 30 return(EOF); 31 31 32 buff += ( long)CHUNK;33 len -= ( long)CHUNK;32 buff += (int32_t)CHUNK; 33 len -= (int32_t)CHUNK; 34 34 35 35 } else { -
libcio/fopen.c
r0292fbb r7258c6a 11 11 #include "stddefs.h" 12 12 13 extern long lseek(int fd, long pos, int how);13 extern int32_t lseek(int16_t fd, int32_t pos, int16_t how); 14 14 15 FILE *_opener( char *name, char *mode, int aflag)15 FILE *_opener(int8_t *name, int8_t *mode, int16_t aflag) 16 16 { 17 17 register FILE *fp; 18 register int plusopt;18 register int16_t plusopt; 19 19 20 20 fp = Cbuffs; … … 70 70 */ 71 71 72 FILE *fopen( char *name, char*mode)72 FILE *fopen(int8_t *name, int8_t *mode) 73 73 { 74 74 return(_opener(name, mode, 0)); 75 75 } 76 76 77 FILE *fopena( char *name, char*mode)77 FILE *fopena(int8_t *name, int8_t *mode) 78 78 { 79 79 return(_opener(name, mode, 0)); 80 80 } 81 81 82 FILE *fopenb( char *name, char*mode)82 FILE *fopenb(int8_t *name, int8_t *mode) 83 83 { 84 84 return(_opener(name, mode, O_RAW)); -
libcio/fprintf.c
r0292fbb r7258c6a 12 12 static FILE *Stream; 13 13 14 extern long dofmt_(int (*putsub)(), char*format, va_list args);15 extern int aputc(int c, FILE *ptr);14 extern int32_t dofmt_(int16_t (*putsub)(), int8_t *format, va_list args); 15 extern int16_t aputc(int16_t c, FILE *ptr); 16 16 17 static int fpsub(int c);17 static int16_t fpsub(int16_t c); 18 18 19 int fprintf(FILE *stream, char*fmt, ...)19 int16_t fprintf(FILE *stream, int8_t *fmt, ...) 20 20 { 21 register int count;21 register int16_t count; 22 22 va_list aptr; 23 23 … … 29 29 } 30 30 31 static int fpsub(int c)31 static int16_t fpsub(int16_t c) 32 32 { 33 33 return(aputc(c, Stream)); -
libcio/fputs.c
r0292fbb r7258c6a 9 9 #include "stddefs.h" 10 10 11 int puts(char*str)11 int16_t puts(int8_t *str) 12 12 { 13 13 while (*str) … … 18 18 } 19 19 20 int aputc(int c, FILE *ptr)20 int16_t aputc(int16_t c, FILE *ptr) 21 21 { 22 22 c &= 127; … … 29 29 } 30 30 31 int fputs(char*s, FILE *fp)31 int16_t fputs(int8_t *s, FILE *fp) 32 32 { 33 33 while ( *s ) -
libcio/fread.c
r0292fbb r7258c6a 16 16 */ 17 17 18 int fread(char *buffer, unsigned size, int number, FILE *stream)18 int16_t fread(int8_t *buffer, uint16_t size, int16_t number, FILE *stream) 19 19 { 20 int total;21 register int c,i;20 int16_t total; 21 register int16_t c,i; 22 22 23 23 for (total = 0; total < number; ++total) { -
libcio/fscanf.c
r0292fbb r7258c6a 9 9 #include "stddefs.h" 10 10 11 static int scnlast;11 static int16_t scnlast; 12 12 static FILE *scnfp; 13 13 14 static int gchar(int what)14 static int16_t gchar(int16_t what) 15 15 { 16 16 if (what EQ 0) { … … 26 26 } 27 27 28 int scanf(char *fmt, int *args)28 int16_t scanf(int8_t *fmt, int16_t *args) 29 29 { 30 30 scnfp = stdin; … … 33 33 } 34 34 35 int fscanf(FILE *fp, char *fmt, int *args)35 int16_t fscanf(FILE *fp, int8_t *fmt, int16_t *args) 36 36 { 37 37 scnfp = fp; -
libcio/fseek.c
r0292fbb r7258c6a 11 11 #include "stddefs.h" 12 12 13 extern long lseek(int fd, long pos, int how);13 extern int32_t lseek(int16_t fd, int32_t pos, int16_t how); 14 14 15 15 /* … … 19 19 */ 20 20 21 int fseek(FILE *fp, long pos, int mode)21 int16_t fseek(FILE *fp, int32_t pos, int16_t mode) 22 22 { 23 register int i, lr;24 longcurpos;23 register int16_t i, lr; 24 int32_t curpos; 25 25 26 26 if (fp->_flags & _DIRTY) { … … 32 32 33 33 if (mode EQ 1 AND fp->_bp) 34 pos -= ( long)fp->_bend - (long)fp->_bp;34 pos -= (int32_t)fp->_bend - (int32_t)fp->_bp; 35 35 } 36 36 -
libcio/fsinit.c
r0292fbb r7258c6a 14 14 #include "stddefs.h" 15 15 16 extern int _bpbin, _dirin, _fatin, _dirmod, _fatmod;16 extern int16_t _bpbin, _dirin, _fatin, _dirmod, _fatmod; 17 17 18 int _badfd(void);19 int _noper(void);18 int16_t _badfd(void); 19 int16_t _noper(void); 20 20 21 char*Stdbufs; /* buffer chain pointer */21 int8_t *Stdbufs; /* buffer chain pointer */ 22 22 23 charWrkbuf[BPSEC]; /* sector work buffer */23 int8_t Wrkbuf[BPSEC]; /* sector work buffer */ 24 24 25 longStdbuf[MAXDFILE][BUFSIZL]; /* standard buffers */25 int32_t Stdbuf[MAXDFILE][BUFSIZL]; /* standard buffers */ 26 26 27 27 FILE Cbuffs[NSTREAMS]; /* stream file control table */ … … 35 35 /* WARNING: this ONLY works for 512 byte sectors, 9 sectors per track */ 36 36 37 short _b_tbuf[9][256]; /* the track buffer */37 int16_t _b_tbuf[9][256]; /* the track buffer */ 38 38 39 short _b_trak; /* current track */40 short _b_side; /* current side */41 short _b_sect; /* current sector */42 short _b_tsec; /* current base sector of current track */39 int16_t _b_trak; /* current track */ 40 int16_t _b_side; /* current side */ 41 int16_t _b_sect; /* current sector */ 42 int16_t _b_tsec; /* current base sector of current track */ 43 43 44 44 #endif … … 54 54 */ 55 55 56 int _badfd(void)56 int16_t _badfd(void) 57 57 { 58 58 errno = EBADF; /* set bad fd code */ … … 66 66 */ 67 67 68 int _noper(void)68 int16_t _noper(void) 69 69 { 70 70 return(SUCCESS); /* return with a non-error indication */ … … 81 81 */ 82 82 83 void InitCH(struct channel *cp, char rdi, char wri, char ioi, char ski, int (*cfp)(), io_arg charg)83 void InitCH(struct channel *cp, int8_t rdi, int8_t wri, int8_t ioi, int8_t ski, int16_t (*cfp)(), io_arg charg) 84 84 { 85 85 cp->c_read = rdi; … … 97 97 */ 98 98 99 void Init_CB(FILE *fp, char unit, char flags, long *bufad, int bufsize)99 void Init_CB(FILE *fp, int8_t unit, int8_t flags, int32_t *bufad, int16_t bufsize) 100 100 { 101 fp->_bp = ( char*)0L;102 fp->_bend = ( char*)0L;103 fp->_buff = ( char*)bufad;101 fp->_bp = (int8_t *)0L; 102 fp->_bend = (int8_t *)0L; 103 fp->_buff = (int8_t *)bufad; 104 104 fp->_flags = flags; 105 105 fp->_unit = unit; … … 120 120 void InitFS(void) 121 121 { 122 register int i;122 register int16_t i; 123 123 124 124 memset(_fcbtab, 0, sizeof _fcbtab); /* clear fcb table */ 125 125 memsetw(Stdbuf, 0, sizeof Stdbuf / 2); /* clear buffers */ 126 126 127 Init_CB(stdin, _BUSY, 0, ( char*)0L, BUFSIZ); /* stdin */128 Init_CB(stdout, _BUSY, 1, ( char*)0L, 1); /* stdout */129 Init_CB(stderr, _BUSY, 2, ( char*)0L, 1); /* stderr */127 Init_CB(stdin, _BUSY, 0, (int8_t *)0L, BUFSIZ); /* stdin */ 128 Init_CB(stdout, _BUSY, 1, (int8_t *)0L, 1); /* stdout */ 129 Init_CB(stderr, _BUSY, 2, (int8_t *)0L, 1); /* stderr */ 130 130 131 131 for (i = 3; i < NSTREAMS; i++) 132 Init_CB(&Cbuffs[i], 0, 0, ( char*)0L, 0);132 Init_CB(&Cbuffs[i], 0, 0, (int8_t *)0L, 0); 133 133 134 134 Stdbuf[0][0] = 0L; /* initialize the buffer list */ 135 135 136 136 for (i = 1; i < MAXDFILE; i++) 137 Stdbuf[i][0] = ( long)Stdbuf[i-1];137 Stdbuf[i][0] = (int32_t)Stdbuf[i-1]; 138 138 139 139 Stdbufs = Stdbuf[MAXDFILE-1]; -
libcio/fsize.c
r0292fbb r7258c6a 11 11 #include "stddefs.h" 12 12 13 extern u nsigned _gtcl12(char *fat, unsignedcl);14 extern int _opnvol(void);15 extern int _filecl(struct fcb *fp);13 extern uint16_t _gtcl12(int8_t *fat, uint16_t cl); 14 extern int16_t _opnvol(void); 15 extern int16_t _filecl(struct fcb *fp); 16 16 17 extern u nsigned_thefat[];17 extern uint16_t _thefat[]; 18 18 19 19 extern struct bpb *_thebpb; … … 27 27 */ 28 28 29 long fsize(FILE *fp, short how)29 int32_t fsize(FILE *fp, int16_t how) 30 30 { 31 31 register struct channel *chp; … … 70 70 */ 71 71 72 short dspace(short which)72 int16_t dspace(int16_t which) 73 73 { 74 register short maxcl, clcount, nc;74 register int16_t maxcl, clcount, nc; 75 75 76 76 if (_opnvol()) -
libcio/fstubs.c
r0292fbb r7258c6a 40 40 */ 41 41 42 int readbuf(int dev, char*buf)42 int16_t readbuf(int16_t dev, int8_t *buf) 43 43 { 44 44 xtrap15(); -
libcio/ftell.c
r0292fbb r7258c6a 17 17 #endif 18 18 19 extern int _filecl(struct fcb *fp);19 extern int16_t _filecl(struct fcb *fp); 20 20 21 21 /* … … 25 25 */ 26 26 27 longftell(FILE *fp)27 int32_t ftell(FILE *fp) 28 28 { 29 29 register struct fcb *fcp; 30 30 register struct channel *chp; 31 register longdpos, pos, diff;31 register int32_t dpos, pos, diff; 32 32 33 33 if (fp EQ (FILE *)0L) { /* see if we point at a FILE */ … … 69 69 70 70 if (fp->_flags & _DIRTY) /* adjust for the buffering */ 71 pos = dpos + (diff = (( long)fp->_bp - (long)fp->_buff));71 pos = dpos + (diff = ((int32_t)fp->_bp - (int32_t)fp->_buff)); 72 72 else if (fp->_bp) 73 pos = dpos - (diff = (( long)fp->_bend - (long)fp->_bp));73 pos = dpos - (diff = ((int32_t)fp->_bend - (int32_t)fp->_bp)); 74 74 else 75 75 pos = dpos; -
libcio/fwrite.c
r0292fbb r7258c6a 20 20 */ 21 21 22 int fwrite(char *buffer, int size, int number, FILE *stream)22 int16_t fwrite(int8_t *buffer, int16_t size, int16_t number, FILE *stream) 23 23 { 24 register int i, j;24 register int16_t i, j; 25 25 26 26 if (size < 0) /* check size for validity */ -
libcio/getbuff.c
r0292fbb r7258c6a 11 11 void getbuff(FILE *ptr) 12 12 { 13 char*buffer;13 int8_t *buffer; 14 14 15 15 if (ptr->_buflen EQ 1) { /* see if we want the small buffer */ … … 21 21 if (Stdbufs) { /* see if we have any standard buffers left */ 22 22 23 buffer = ( char*)Stdbufs;24 Stdbufs = *( long**)Stdbufs;23 buffer = (int8_t *)Stdbufs; 24 Stdbufs = *(int32_t **)Stdbufs; 25 25 26 26 } else { /* ... if not, use the small one */ -
libcio/getc.c
r0292fbb r7258c6a 9 9 #include "stddefs.h" 10 10 11 int getc(FILE *ptr)11 int16_t getc(FILE *ptr) 12 12 { 13 register int len;13 register int16_t len; 14 14 15 15 if (ptr->_bp >= ptr->_bend) { /* see if the buffer is empty */ -
libcio/getl.c
r0292fbb r7258c6a 8 8 #include "stdio.h" 9 9 10 extern int getc(FILE *ptr);10 extern int16_t getc(FILE *ptr); 11 11 12 12 /* … … 19 19 */ 20 20 21 longgetl(FILE *stream)21 int32_t getl(FILE *stream) 22 22 { 23 longtemp;24 register char*t;23 int32_t temp; 24 register int8_t *t; 25 25 26 26 t = &temp; -
libcio/getw.c
r0292fbb r7258c6a 8 8 #include "stdio.h" 9 9 10 extern int getc(FILE *ptr);10 extern int16_t getc(FILE *ptr); 11 11 12 12 /* … … 19 19 */ 20 20 21 int getw(FILE *stream)21 int16_t getw(FILE *stream) 22 22 { 23 int temp;24 register char*t;23 int16_t temp; 24 register int8_t *t; 25 25 26 26 t = &temp; -
libcio/lseek.c
r0292fbb r7258c6a 13 13 #include "stddefs.h" 14 14 15 extern int _seek(struct fcb *fcp);15 extern int16_t _seek(struct fcb *fcp); 16 16 17 17 #if DEBUGIT … … 19 19 #endif 20 20 21 long lseek(int fd, long pos, int how)21 int32_t lseek(int16_t fd, int32_t pos, int16_t how) 22 22 { 23 23 register struct fcb *fp; … … 96 96 } 97 97 98 fp->offset = pos & (( long)BPSEC - 1); /* calculate sector offset */98 fp->offset = pos & ((int32_t)BPSEC - 1); /* calculate sector offset */ 99 99 fp->curlsn = pos >> FILESHFT; /* calculate logical sector */ 100 100 -
libcio/open.c
r0292fbb r7258c6a 12 12 #include "stddefs.h" 13 13 14 extern int _badfd(void);15 extern int _noper(void);16 extern int _inifcb(struct fcb *fcp, char *name, char *ext, int mode);17 extern int _opfcb(struct fcb *fcp);18 19 extern char *FilName(char *s, char*p);20 extern char *FilExt(char *s, char*p);21 22 int _fileop(char *name, int flag, int mode, struct channel *chp, struct devtabl *dp);23 int _filecl(struct fcb *fp);14 extern int16_t _badfd(void); 15 extern int16_t _noper(void); 16 extern int16_t _inifcb(struct fcb *fcp, int8_t *name, int8_t *ext, int16_t mode); 17 extern int16_t _opfcb(struct fcb *fcp); 18 19 extern int8_t *FilName(int8_t *s, int8_t *p); 20 extern int8_t *FilExt(int8_t *s, int8_t *p); 21 22 int16_t _fileop(int8_t *name, int16_t flag, int16_t mode, struct channel *chp, struct devtabl *dp); 23 int16_t _filecl(struct fcb *fp); 24 24 25 25 static struct device condev = { 2, 2, 1, 0, _noper }; … … 55 55 */ 56 56 57 int open(char *name, int flag, int mode)57 int16_t open(int8_t *name, int16_t flag, int16_t mode) 58 58 { 59 59 register struct devtabl *dp; 60 60 register struct channel *chp; 61 61 register struct device *dev; 62 int fd, mdmask;62 int16_t fd, mdmask; 63 63 64 64 /* search for a free channel */ … … 131 131 */ 132 132 133 int opena(char *name, int flag, int mode)133 int16_t opena(int8_t *name, int16_t flag, int16_t mode) 134 134 { 135 135 return(open(name, flag, mode)); … … 145 145 */ 146 146 147 int openb(char *name, int flag, int mode)147 int16_t openb(int8_t *name, int16_t flag, int16_t mode) 148 148 { 149 149 return(open(name, flag|O_RAW, mode)); … … 164 164 */ 165 165 166 int creat(char *name, int mode)166 int16_t creat(int8_t *name, int16_t mode) 167 167 { 168 168 return(open(name, O_WRONLY|O_TRUNC|O_CREAT, mode)); … … 183 183 */ 184 184 185 int creata(char *name, int mode)185 int16_t creata(int8_t *name, int16_t mode) 186 186 { 187 187 return(open(name, O_WRONLY|O_TRUNC|O_CREAT, mode)); … … 198 198 */ 199 199 200 int creatb(char *name, int mode)200 int16_t creatb(int8_t *name, int16_t mode) 201 201 { 202 202 return(open(name, O_WRONLY|O_TRUNC|O_CREAT|O_RAW, mode)); … … 215 215 */ 216 216 217 int _fileop(char *name, int flag, int mode, struct channel *chp, struct devtabl *dp)217 int16_t _fileop(int8_t *name, int16_t flag, int16_t mode, struct channel *chp, struct devtabl *dp) 218 218 { 219 219 register struct fcb *fp; 220 chartmpname[9], tmpext[4];220 int8_t tmpname[9], tmpext[4]; 221 221 222 222 /* search for an available fcb entry */ -
libcio/posit.c
r0292fbb r7258c6a 11 11 #include "stddefs.h" 12 12 13 extern int _seek(struct fcb *fcp);13 extern int16_t _seek(struct fcb *fcp); 14 14 15 15 /* … … 19 19 */ 20 20 21 int posit(int fd, unsignedpos)21 int16_t posit(int16_t fd, uint16_t pos) 22 22 { 23 23 register struct fcb *fp; -
libcio/putc.c
r0292fbb r7258c6a 9 9 #include "stddefs.h" 10 10 11 extern int write(int fd, char *buff, unsignedlen);11 extern int16_t write(int16_t fd, int8_t *buff, uint16_t len); 12 12 extern void getbuff(FILE *ptr); 13 extern int close(int fd);13 extern int16_t close(int16_t fd); 14 14 15 extern int (*_clsall)();15 extern int16_t (*_clsall)(); 16 16 17 static int (*cls_rtn)();17 static int16_t (*cls_rtn)(); 18 18 19 int _ClFlag;19 int16_t _ClFlag; 20 20 21 int fclose(FILE *ptr);21 int16_t fclose(FILE *ptr); 22 22 23 23 /* … … 47 47 */ 48 48 49 int flush_(FILE *ptr, int data)49 int16_t flush_(FILE *ptr, int16_t data) 50 50 { 51 register int size;51 register int16_t size; 52 52 53 53 if (_ClFlag EQ 0) { … … 60 60 if (ptr->_flags & _DIRTY) { /* something in the buffer ? */ 61 61 62 size = (int )((long)ptr->_bp - (long)ptr->_buff);62 size = (int16_t)((int32_t)ptr->_bp - (int32_t)ptr->_buff); 63 63 64 64 if (write(ptr->_unit, ptr->_buff, size) EQ -1) { … … 105 105 */ 106 106 107 int fflush(FILE *ptr)107 int16_t fflush(FILE *ptr) 108 108 { 109 109 return(flush_(ptr, -1)); … … 116 116 */ 117 117 118 int fclose(FILE *ptr)118 int16_t fclose(FILE *ptr) 119 119 { 120 int err;120 int16_t err; 121 121 122 122 err = 0; … … 131 131 if (ptr->_flags & _ALLBUF) { /* deallocate standard buffer */ 132 132 133 *( long**)ptr->_buff = Stdbufs;134 Stdbufs = ( long*)ptr->_buff;133 *(int32_t **)ptr->_buff = Stdbufs; 134 Stdbufs = (int32_t *)ptr->_buff; 135 135 } 136 136 } … … 150 150 */ 151 151 152 int putc(int c, FILE *ptr)152 int16_t putc(int16_t c, FILE *ptr) 153 153 { 154 154 if (ptr->_bp GE ptr->_bend) … … 164 164 */ 165 165 166 int puterr(int c)166 int16_t puterr(int16_t c) 167 167 { 168 168 return(putc(c, stderr)); -
libcio/putl.c
r0292fbb r7258c6a 11 11 #include "stddefs.h" 12 12 13 void putl( longw, FILE *stream)13 void putl(int32_t w, FILE *stream) 14 14 { 15 15 if (putc(((w >> 24) & 0xFF), stream) < 0 ) -
libcio/putw.c
r0292fbb r7258c6a 11 11 #include "stddefs.h" 12 12 13 void putw(u nsignedw, FILE *stream)13 void putw(uint16_t w, FILE *stream) 14 14 { 15 15 if (putc(((w >> 8) & 0xFF), stream) < 0 ) -
libcio/read.c
r0292fbb r7258c6a 46 46 #endif 47 47 48 extern int _badfd(void);49 extern int _conin(char *buff, int len);50 extern int _seek(struct fcb *fcp);48 extern int16_t _badfd(void); 49 extern int16_t _conin(int8_t *buff, int16_t len); 50 extern int16_t _seek(struct fcb *fcp); 51 51 52 extern void *memcpy(void *vp1, void *vp2, int n);52 extern void *memcpy(void *vp1, void *vp2, int16_t n); 53 53 54 int _filerd(struct fcb *fp, char *buffer, unsignedlen);54 int16_t _filerd(struct fcb *fp, int8_t *buffer, uint16_t len); 55 55 56 static int (*t_read[])() = {56 static int16_t (*t_read[])() = { 57 57 58 58 _badfd, /* 0 - invalid type */ … … 72 72 */ 73 73 74 int read(int fd, char *buff, unsignedlen)74 int16_t read(int16_t fd, int8_t *buff, uint16_t len) 75 75 { 76 76 register struct channel *chp; … … 97 97 */ 98 98 99 int _getsec(struct fcb *fp, char *buf, unsignedlen)99 int16_t _getsec(struct fcb *fp, int8_t *buf, uint16_t len) 100 100 { 101 101 if ((errno = ReadRN(fp, Wrkbuf)) NE 0) /* get current sector */ … … 126 126 */ 127 127 128 int _filerd(struct fcb *fp, char *buffer, unsignedlen)128 int16_t _filerd(struct fcb *fp, int8_t *buffer, uint16_t len) 129 129 { 130 register u nsignedl;131 register u nsignedj, k;132 register longcurpos, newpos;130 register uint16_t l; 131 register uint16_t j, k; 132 register int32_t curpos, newpos; 133 133 134 134 l = 0; -
libcio/readrn.c
r0292fbb r7258c6a 27 27 28 28 #if TBUFFER 29 extern long _secrd(char *buf, short rec);29 extern int32_t _secrd(int8_t *buf, int16_t rec); 30 30 #endif 31 31 32 extern long_berrno;33 extern int _seek(struct fcb *fcp);32 extern int32_t _berrno; 33 extern int16_t _seek(struct fcb *fcp); 34 34 35 35 /* … … 44 44 */ 45 45 46 int ReadRN(struct fcb *fcp, char*buf)46 int16_t ReadRN(struct fcb *fcp, int8_t *buf) 47 47 { 48 int sv; /* seek return code */49 longbrc; /* bios return code */48 int16_t sv; /* seek return code */ 49 int32_t brc; /* bios return code */ 50 50 51 51 if (sv = _seek(fcp)) /* try to find the sector we want */ … … 68 68 69 69 #if TBUFFER 70 if (brc = _secrd(buf, ( short)fcp->curdsn)) {70 if (brc = _secrd(buf, (int16_t)fcp->curdsn)) { 71 71 #else 72 72 if (brc = BIOS(B_RDWR, 0, buf, 1, (short)fcp->curdsn, 0)) { -
libcio/rename.c
r0292fbb r7258c6a 6 6 */ 7 7 8 int rename(char *old, char*new)8 int16_t rename(int8_t *old, int8_t *new) 9 9 { 10 charbuff[60];10 int8_t buff[60]; 11 11 12 12 return(-1); /* return an error for now */ -
libcio/scan.c
r0292fbb r7258c6a 10 10 #include "ctype.h" 11 11 12 static int maxwide;13 static int (*gsub)();14 15 extern char *index(char *str, charc);16 17 static char*scnstr;18 static charquit;19 20 /* 21 22 */ 23 24 static long getnum(char *list, char *values, int base)25 { 26 register longval;27 register char*cp;28 int c;29 int sign;12 static int16_t maxwide; 13 static int16_t (*gsub)(); 14 15 extern int8_t *index(int8_t *str, int8_t c); 16 17 static int8_t *scnstr; 18 static int8_t quit; 19 20 /* 21 22 */ 23 24 static int32_t getnum(int8_t *list, int8_t *values, int16_t base) 25 { 26 register int32_t val; 27 register int8_t *cp; 28 int16_t c; 29 int16_t sign; 30 30 31 31 if (maxwide LE 0) … … 53 53 54 54 val *= base; 55 val += values[( long)cp - (long)list];55 val += values[(int32_t)cp - (int32_t)list]; 56 56 } 57 57 … … 66 66 */ 67 67 68 static int skipblk(void)68 static int16_t skipblk(void) 69 69 { 70 70 while (isspace((*gsub)(0))) … … 77 77 } 78 78 79 static int sgetc(int what)79 static int16_t sgetc(int16_t what) 80 80 { 81 81 if (what EQ 0) { … … 99 99 */ 100 100 101 int scanfmt(int (*getsub)(), char *fmt, int **args)101 int16_t scanfmt(int16_t (*getsub)(), int8_t *fmt, int16_t **args) 102 102 { 103 103 … … 106 106 #endif 107 107 108 longlv;109 int c, count, dontdo, lflag, base;110 char*cp;111 chartlist[130];112 113 static charlist[] = "ABCDEFabcdef9876543210";114 115 static charvals[] = {108 int32_t lv; 109 int16_t c, count, dontdo, lflag, base; 110 int8_t *cp; 111 int8_t tlist[130]; 112 113 static int8_t list[] = "ABCDEFabcdef9876543210"; 114 115 static int8_t vals[] = { 116 116 117 117 10,11,12,13,14,15,10,11,12,13,14,15,9,8,7,6,5,4,3,2,1,0 … … 198 198 199 199 if (lflag) 200 *( long*)(*args++) = lv;200 *(int32_t *)(*args++) = lv; 201 201 else 202 202 **args++ = lv; … … 298 298 if (!dontdo) { 299 299 300 *( char*)(*args++) = c;300 *(int8_t *)(*args++) = c; 301 301 ++count; 302 302 } … … 379 379 */ 380 380 381 int sscanf(char *string, char *fmt, int *args)381 int16_t sscanf(int8_t *string, int8_t *fmt, int16_t *args) 382 382 { 383 383 scnstr = string; -
libcio/setbuf.c
r0292fbb r7258c6a 8 8 #include "stdio.h" 9 9 10 void setbuf(FILE *stream, char*buffer)10 void setbuf(FILE *stream, int8_t *buffer) 11 11 { 12 12 if (stream->_buff) -
libcio/ungetc.c
r0292fbb r7258c6a 9 9 #include "stddefs.h" 10 10 11 int ungetc(int c, FILE *ptr)11 int16_t ungetc(int16_t c, FILE *ptr) 12 12 { 13 13 if ((c EQ EOF) OR (ptr->_bp LE ptr->_buff)) -
libcio/unlink.c
r0292fbb r7258c6a 17 17 #endif 18 18 19 extern int DelFile(struct fcb *fcp);19 extern int16_t DelFile(struct fcb *fcp); 20 20 21 21 /* … … 25 25 */ 26 26 27 int unlink(char*name)27 int16_t unlink(int8_t *name) 28 28 { 29 29 struct fcb delfcb; -
libcio/write.c
r0292fbb r7258c6a 13 13 #include "stddefs.h" 14 14 15 int _filewr(struct fcb *fp, char *buffer, unsignedlen);16 17 extern int _badfd(void);18 extern int _conwr(int kind, char *buff, int len);19 extern int blkwr(struct fcb *fcp, char *buf, int ns);20 extern int ReadRN(struct fcb *fcp, char*buf);21 extern int WriteRN(struct fcb *fcp, char*buf);22 extern int _newcls(void);23 extern short micons(short wi);24 extern void _ptcl12(u nsigned *fat, unsigned cl, unsignedval);25 26 extern long miconl(longwi);27 28 extern void *memset(void *vp, char c, int n);29 30 extern int _fatmod;31 32 extern u nsigned_thefat[];15 int16_t _filewr(struct fcb *fp, int8_t *buffer, uint16_t len); 16 17 extern int16_t _badfd(void); 18 extern int16_t _conwr(int16_t kind, int8_t *buff, int16_t len); 19 extern int16_t blkwr(struct fcb *fcp, int8_t *buf, int16_t ns); 20 extern int16_t ReadRN(struct fcb *fcp, int8_t *buf); 21 extern int16_t WriteRN(struct fcb *fcp, int8_t *buf); 22 extern int16_t _newcls(void); 23 extern int16_t micons(int16_t wi); 24 extern void _ptcl12(uint16_t *fat, uint16_t cl, uint16_t val); 25 26 extern int32_t miconl(int32_t wi); 27 28 extern void *memset(void *vp, int8_t c, int16_t n); 29 30 extern int16_t _fatmod; 31 32 extern uint16_t _thefat[]; 33 33 34 34 extern struct bpb *_thebpb; … … 38 38 #endif 39 39 40 static int (*wr_tab[])() = { /* write routine dispatch table */40 static int16_t (*wr_tab[])() = { /* write routine dispatch table */ 41 41 42 42 _badfd, /* 0 - invalid entry */ … … 55 55 */ 56 56 57 int _putsec(struct fcb *fp, char *buf, unsignedlen)57 int16_t _putsec(struct fcb *fp, int8_t *buf, uint16_t len) 58 58 { 59 59 #if DEBUGIT … … 126 126 */ 127 127 128 int _filewr(struct fcb *fp, char *buffer, unsignedlen)128 int16_t _filewr(struct fcb *fp, int8_t *buffer, uint16_t len) 129 129 { 130 register u nsignedj, k, l;131 int clustr;132 register longcurpos;130 register uint16_t j, k, l; 131 int16_t clustr; 132 register int32_t curpos; 133 133 134 134 curpos = fp->offset + (fp->curlsn << FILESHFT); /* get position */ … … 245 245 */ 246 246 247 int write(int fd, char *buff, unsignedlen)247 int16_t write(int16_t fd, int8_t *buff, uint16_t len) 248 248 { 249 249 register struct channel *chp; -
libcio/writern.c
r0292fbb r7258c6a 22 22 #include "fspars.h" 23 23 24 extern long_berrno;25 extern int _seek(struct fcb *fcp);24 extern int32_t _berrno; 25 extern int16_t _seek(struct fcb *fcp); 26 26 27 27 #if DEBUGIT … … 30 30 31 31 #if TBUFFER 32 extern long _secwr(char *buf, short rec);32 extern int32_t _secwr(int8_t *buf, int16_t rec); 33 33 #endif 34 34 … … 44 44 */ 45 45 46 int WriteRN(struct fcb *fcp, char*buf)46 int16_t WriteRN(struct fcb *fcp, int8_t *buf) 47 47 { 48 int sv; /* seek return code */49 longbrc; /* bios return code */48 int16_t sv; /* seek return code */ 49 int32_t brc; /* bios return code */ 50 50 51 51 if (sv = _seek(fcp)) { /* try to find the sector we want */ … … 86 86 /* write the sector */ 87 87 88 if (brc = BIOS(B_RDWR, 1, buf, 1, ( short)fcp->curdsn, 0)) {88 if (brc = BIOS(B_RDWR, 1, buf, 1, (int16_t)fcp->curdsn, 0)) { 89 89 90 90 #if DEBUGIT … … 99 99 100 100 #if TBUFFER 101 _secwr(buf, ( short)fcp->curdsn);101 _secwr(buf, (int16_t)fcp->curdsn); 102 102 #endif 103 103
Note:
See TracChangeset
for help on using the changeset viewer.