Changeset 7258c6a in buchla-68k for libcio


Ignore:
Timestamp:
07/09/2017 04:45:34 PM (8 years ago)
Author:
Thomas Lopatic <thomas@…>
Branches:
master
Children:
8618599
Parents:
0292fbb
Message:

Use standard integer types.

Location:
libcio
Files:
43 edited

Legend:

Unmodified
Added
Removed
  • libcio/atoi.c

    r0292fbb r7258c6a  
    99#include "ctype.h"
    1010
    11 int atoi(char *cp)
     11int16_t atoi(int8_t *cp)
    1212{
    13         register unsigned i;
    14         register short sign;
     13        register uint16_t i;
     14        register int16_t sign;
    1515
    1616        sign = 0;
  • libcio/atol.c

    r0292fbb r7258c6a  
    99#include "ctype.h"
    1010
    11 long atol(char *cp)
     11int32_t atol(int8_t *cp)
    1212{
    13         register long n;
    14         register short sign;
     13        register int32_t n;
     14        register int16_t sign;
    1515
    1616        sign = 0;
  • libcio/blkrd.c

    r0292fbb r7258c6a  
    4040#endif
    4141
    42 extern  int     _nsic(struct fcb *fcp, struct bpb *bpp, char *fp);
     42extern  int16_t _nsic(struct fcb *fcp, struct bpb *bpp, int8_t *fp);
    4343
    44 extern  long    _berrno;                /* last file system bios error number */
     44extern  int32_t _berrno;                /* last file system bios error number */
    4545
    46 extern  unsigned        _thefat[];              /* current file allocation table */
     46extern  uint16_t        _thefat[];              /* current file allocation table */
    4747
    4848extern  struct  bpb     *_thebpb;       /* current bios parameter block */
     
    5252/* WARNING:  this ONLY works for 512 byte sectors, 9 sectors per track */
    5353
    54 extern  short   _b_tbuf[9][256];        /* the track buffer */
     54extern  int16_t _b_tbuf[9][256];        /* the track buffer */
    5555
    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 */
     56extern  int16_t _b_trak;                /* current track */
     57extern  int16_t _b_side;                /* current side */
     58extern  int16_t _b_sect;                /* current sector */
     59extern  int16_t _b_tsec;                /* current base sector of current track */
    6060
    6161#endif
     
    7373*/
    7474
    75 long _secrd(char *buf, short rec)
     75int32_t _secrd(int8_t *buf, int16_t rec)
    7676{
    77         register short  track, side, sector;
    78         long brc;
     77        register int16_t        track, side, sector;
     78        int32_t brc;
    7979
    8080        if (_thebpb->dspt NE 9)                 /* make sure we can do this */
     
    118118        }
    119119
    120         memcpy(buf, (char *)_b_tbuf[sector], 512);
     120        memcpy(buf, (int8_t *)_b_tbuf[sector], 512);
    121121        return(0L);
    122122}
     
    135135*/
    136136
    137 int blkrd(struct fcb *fcp, char *buf, int ns)
     137int16_t blkrd(struct fcb *fcp, int8_t *buf, int16_t ns)
    138138{
    139         register long   brc;            /* 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 */
    141141
    142142        if (ns < 0)             /* can't read a negative number of sectors */
     
    152152
    153153#if     TBUFFER
    154                 if (brc = _secrd(buf, (short)fcp->curdsn)) {
     154                if (brc = _secrd(buf, (int16_t)fcp->curdsn)) {
    155155#else
    156156                if (brc = BIOS(B_RDWR, 0, buf, 1, (short)fcp->curdsn, 0)) {
  • libcio/blkwr.c

    r0292fbb r7258c6a  
    2424#include "fspars.h"
    2525
    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 */
     26extern  int16_t _nsic(struct fcb *fcp, struct bpb *bpp, int8_t *fp);
     27extern  int16_t _alcnew(struct fcb *fcp);
     28extern  int16_t _newcls(void);
     29
     30extern  int32_t _berrno;                /* last file system bios error number */
    3131
    3232extern  struct  bpb     *_thebpb;       /* current bios parameter block */
    3333
    34 extern  unsigned        _thefat[];              /* current file allocation table */
    35 
    36 extern  int     _fatmod;                /* FAT modified flag */
     34extern  uint16_t        _thefat[];              /* current file allocation table */
     35
     36extern  int16_t _fatmod;                /* FAT modified flag */
    3737
    3838#if DEBUGIT
     
    4444/* WARNING:  this ONLY works for 512 byte sectors, 9 sectors per track */
    4545
    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 */
     46extern  int16_t _b_tbuf[9][256];        /* the track buffer */
     47
     48extern  int16_t _b_trak;                /* current track */
     49extern  int16_t _b_side;                /* current side */
     50extern  int16_t _b_sect;                /* current sector */
     51extern  int16_t _b_tsec;                /* base sector for current track */
    5252
    5353#endif
     
    6565*/
    6666
    67 long _secwr(char *buf, short rec)
     67int32_t _secwr(int8_t *buf, int16_t rec)
    6868{
    69         register short  track, side, sector;
     69        register int16_t        track, side, sector;
    7070
    7171        if (_thebpb->dspt NE 9)                 /* make sure we can do this */
     
    101101                return(0L);
    102102
    103         memcpy((char *)_b_tbuf[sector], buf, 512);      /* update the buffer */
     103        memcpy((int8_t *)_b_tbuf[sector], buf, 512);    /* update the buffer */
    104104
    105105#if     DEBUGIT
     
    124124*/
    125125
    126 int blkwr(struct fcb *fcp, char *buf, int ns)
     126int16_t blkwr(struct fcb *fcp, int8_t *buf, int16_t ns)
    127127{
    128         long    rc;
    129         short   clustr;
     128        int32_t rc;
     129        int16_t clustr;
    130130
    131131        while (ns > 0) {                /* write a sector at a time */
     
    141141#endif
    142142
    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)) {
    144144
    145145#if     DEBUGIT
     
    154154
    155155#if     TBUFFER
    156                                 _secwr(buf, (short)fcp->curdsn);
     156                                _secwr(buf, (int16_t)fcp->curdsn);
    157157#endif
    158158
     
    193193#endif
    194194
    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)) {
    196196
    197197#if     DEBUGIT
     
    206206
    207207#if     TBUFFER
    208                                 _secwr(buf, (short)fcp->curdsn);
     208                                _secwr(buf, (int16_t)fcp->curdsn);
    209209#endif
    210210
     
    246246#endif
    247247
    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)) {
    249249
    250250#if     DEBUGIT
     
    259259
    260260#if     TBUFFER
    261                         _secwr(buf, (short)fcp->curdsn);
     261                        _secwr(buf, (int16_t)fcp->curdsn);
    262262#endif
    263263
  • libcio/close.c

    r0292fbb r7258c6a  
    1212#include "stddefs.h"
    1313
    14 extern  int     _badfd(void);
    15 extern  int     ClsFile(struct fcb *fcp);
     14extern  int16_t _badfd(void);
     15extern  int16_t ClsFile(struct fcb *fcp);
    1616extern  void    _clsvol(void);
    1717
    18 extern  int     _fatmod, _dirmod;
     18extern  int16_t _fatmod, _dirmod;
    1919extern  struct  bpb     *_thebpb;
    2020extern  struct  dirent  _thedir[];
    21 extern  unsigned        _thefat[];
     21extern  uint16_t        _thefat[];
    2222
    2323/*
     
    7272*/
    7373
    74 int close(int fd)
     74int16_t close(int16_t fd)
    7575{
    7676        register struct channel *chp;
    77         register int rc;
     77        register int16_t rc;
    7878
    7979        if ((fd < 0) OR (fd > MAXCHAN)) {
     
    112112*/
    113113
    114 int _filecl(struct fcb *fp)
     114int16_t _filecl(struct fcb *fp)
    115115{
    116         register int rc;
     116        register int16_t rc;
    117117
    118118        rc = ClsFile(fp);               /* close the FCB */
     
    129129void _fd_cls(void)
    130130{
    131         register int fd;
     131        register int16_t fd;
    132132
    133133        for (fd = 0; fd < MAXCHAN; ++fd)
  • libcio/clusmap.c

    r0292fbb r7258c6a  
    1212#include "stddefs.h"
    1313
    14 extern  short   micons(short wi);
    15 extern  unsigned        _gtcl12(char *fat, unsigned cl);
    16 extern  long    miconl(long wi);
     14extern  int16_t micons(int16_t wi);
     15extern  uint16_t        _gtcl12(int8_t *fat, uint16_t cl);
     16extern  int32_t miconl(int32_t wi);
    1717
    1818extern  struct  bpb     *_thebpb;
    19 extern  unsigned        _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 */
     19extern  uint16_t        _thefat[];
     20
     21extern  int16_t _filecl(struct fcb *fp);
     22extern  int16_t _noper(void);
     23
     24/*
     25
     26*/
     27
     28static int8_t   *mfname[] = {   /* FCB flag names */
    2929
    3030        "?D0",  /* D0  - 0001 */
     
    5353*/
    5454
    55 static  char    *dfname[] = {
     55static  int8_t  *dfname[] = {
    5656
    5757        "RDONLY",       /* D0 - 01 */
     
    6565};
    6666
    67 static  char    *ffname[] = {
     67static  int8_t  *ffname[] = {
    6868
    6969        "BUSY  ",       /* D0 - 01 */
     
    8181*/
    8282
    83 static int waitcr(void)
    84 {
    85         char    c;
     83static int16_t waitcr(void)
     84{
     85        int8_t  c;
    8686
    8787        BIOS(B_PUTC, CON_DEV, '\007');
     
    106106*/
    107107
    108 int ClusMap(struct fcb *fcp)
    109 {
    110         int     clus, nc;
    111         long    alsize, bused, bunused;
     108int16_t ClusMap(struct fcb *fcp)
     109{
     110        int16_t clus, nc;
     111        int32_t alsize, bused, bunused;
    112112
    113113        if (!(fcp->modefl & FC_OPN)) {
     
    175175struct fcb *FCBmode(struct fcb *fcp)
    176176{
    177         register unsigned short mf;
    178         register short i;
     177        register uint16_t mf;
     178        register int16_t i;
    179179
    180180        printf("  flags:  ");
     
    254254*/
    255255
    256 void MapFAT(char *fat, short ncl, short stops)
    257 {
    258         register int i;
     256void MapFAT(int8_t *fat, int16_t ncl, int16_t stops)
     257{
     258        register int16_t i;
    259259
    260260        printf("\nCluster dump of FAT at 0x%08.8lx  (%d entries):\n",
     
    290290FILE *FILEfl(FILE *fp)
    291291{
    292         register unsigned short mf;
    293         register short i;
     292        register uint16_t mf;
     293        register int16_t i;
    294294
    295295        printf("  _flags:  ");
     
    320320void FILEpr(FILE *fp)
    321321{
    322         int     (*arg)(), ft;
    323         char    *ds, *fsn, *fse;
     322        int16_t (*arg)(), ft;
     323        int8_t  *ds, *fsn, *fse;
    324324        struct  fcb     *fcp;
    325325
     
    379379*/
    380380
    381 struct fcb *fd2fcb(short fd)
     381struct fcb *fd2fcb(int16_t fd)
    382382{
    383383        if ((fd < 0) OR (fd > MAXCHAN))
  • libcio/conin.c

    r0292fbb r7258c6a  
    1414#include "stddefs.h"
    1515
    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);
     16extern  void    *memcpy(void *vp1, void *vp2, int16_t n);
     17extern  int16_t readbuf(int16_t dev, int8_t *buf);
     18extern  void    writeln(int16_t unit, int8_t *buf);
    1919
    20 char _ConBuf[258];      /* console input buffer */
    21 int _CBused;
     20int8_t _ConBuf[258];    /* console input buffer */
     21int16_t _CBused;
    2222
    23 int _conin(char *buff, int len)
     23int16_t _conin(int8_t *buff, int16_t len)
    2424{
    25         int     nbp;
    26         register int l;
     25        int16_t         nbp;
     26        register int16_t l;
    2727
    2828        if (_ConBuf[1] EQ 0) {
  • libcio/conwr.c

    r0292fbb r7258c6a  
    1919   ============================================================================
    2020*/
    21 int _conwr(int kind, char *buff, int len)
     21int16_t _conwr(int16_t kind, int8_t *buff, int16_t len)
    2222{
    23         register int count;
     23        register int16_t count;
    2424
    2525        for (count = 0; count < len; ++count)
  • libcio/dirfns.c

    r0292fbb r7258c6a  
    99#include "biosdefs.h"
    1010
    11 extern  long    sprintf(char *str, char *fmt, ...);
     11extern  int32_t sprintf(int8_t *str, int8_t *fmt, ...);
    1212
    13 static char atrcons[] = "ADVSHR";
     13static int8_t atrcons[] = "ADVSHR";
    1414
    1515/*
     
    1919*/
    2020
    21 char *atrstr(short atr, char s[])
     21int8_t *atrstr(int16_t atr, int8_t s[])
    2222{
    23         register short  i, j;
     23        register int16_t        i, j;
    2424
    2525        i = 0x20;
     
    4242 */
    4343
    44 static char *mnames[] = {
     44static int8_t *mnames[] = {
    4545
    4646        "???",
     
    6565*/
    6666
    67 char *mname(short n)
     67int8_t *mname(int16_t n)
    6868{
    6969        return((n < 1 || n > 12) ? mnames[0] : mnames[n]);
     
    8181*/
    8282
    83 char *dtunpk(short din, short tin, short fmt, char *s)
     83int8_t *dtunpk(int16_t din, int16_t tin, int16_t fmt, int8_t *s)
    8484{
    85         register short  ftm, fdt;
     85        register int16_t        ftm, fdt;
    8686
    8787        ftm = ((tin << 8) & 0xFF00) | ((tin >> 8) & 0x00FF);
  • libcio/fgets.c

    r0292fbb r7258c6a  
    1111#define EATCHAR '\n'    /* character to be "eaten" on input */
    1212
    13 int agetc(FILE *ptr)
     13int16_t agetc(FILE *ptr)
    1414{
    15         register int c;
     15        register int16_t c;
    1616
    1717top:
     
    3333}
    3434
    35 char *gets(char *line)
     35int8_t *gets(int8_t *line)
    3636{
    37         register char *cp;
    38         register int i;
     37        register int8_t *cp;
     38        register int16_t i;
    3939
    4040        cp = line;
     
    5151}
    5252
    53 char *fgets(char *s, int n, FILE *fp)
     53int8_t *fgets(int8_t *s, int16_t n, FILE *fp)
    5454{
    55         register int c;
    56         register char *cp;
     55        register int16_t c;
     56        register int8_t *cp;
    5757
    5858        cp = s;
  • libcio/filesys.c

    r0292fbb r7258c6a  
    2929#define DE_NULL         ((struct dirent *)0L)
    3030
    31 extern  short   micons(short wi);
    32 extern  long    miconl(long wi);
    33 extern  void    _ptcl12(unsigned *fat, unsigned cl, unsigned val);
    34 extern  char    *FilName(char *s, char *p);
    35 extern  char    *FilExt(char *s, char *p);
     31extern  int16_t micons(int16_t wi);
     32extern  int32_t miconl(int32_t wi);
     33extern  void    _ptcl12(uint16_t *fat, uint16_t cl, uint16_t val);
     34extern  int8_t  *FilName(int8_t *s, int8_t *p);
     35extern  int8_t  *FilExt(int8_t *s, int8_t *p);
    3636
    3737#if DEBUGIT
     
    4444struct  dirent  *_dptr;                 /* internal directory pointer */
    4545
    46 unsigned _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 */
     46uint16_t _thefat[MAXFAT * WDPSEC];      /* file allocation table */
     47
     48int16_t _fatin;                         /* FAT has been read */
     49int16_t _dirin;                         /* directory has been read */
     50int16_t _bpbin;                         /* BPB has been read */
     51int16_t _fatmod;                        /* FAT modified flag */
     52int16_t _dirmod;                        /* directory modified flag */
     53
     54int32_t _berrno;                        /* BIOS error number */
    5555
    5656/*
     
    6666*/
    6767
    68 unsigned _cl2lsn(struct bpb *bpp, unsigned clnum)
     68uint16_t _cl2lsn(struct bpb *bpp, uint16_t clnum)
    6969{
    7070        return(bpp->datrec + (bpp->clsiz * (clnum - 2)) );
     
    7878*/
    7979
    80 unsigned _gtcl12(char *fat, unsigned cl)
    81 {
    82         register unsigned cla, clt;
     80uint16_t _gtcl12(int8_t *fat, uint16_t cl)
     81{
     82        register uint16_t cla, clt;
    8383
    8484        cla = cl + (cl >> 1);
    85         clt = ((unsigned)0xFF00 & (fat[cla+1] << 8))
    86                 | ((unsigned)0x00FF & fat[cla]);
     85        clt = ((uint16_t)0xFF00 & (fat[cla+1] << 8))
     86                | ((uint16_t)0x00FF & fat[cla]);
    8787
    8888        if (cl & 1)
    8989                clt >>= 4;
    9090
    91         clt &= (unsigned)0x0FFF;
     91        clt &= (uint16_t)0x0FFF;
    9292        return(clt);
    9393}
     
    104104*/
    105105
    106 unsigned _getfat(unsigned *bufad, unsigned nfat, struct bpb *bpp)
    107 {
    108         unsigned fatsec;
     106uint16_t _getfat(uint16_t *bufad, uint16_t nfat, struct bpb *bpp)
     107{
     108        uint16_t fatsec;
    109109
    110110        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));
    112112}
    113113
     
    123123*/
    124124
    125 int _rdfat(unsigned *bufad, struct bpb *bpp)
     125int16_t _rdfat(uint16_t *bufad, struct bpb *bpp)
    126126{
    127127        if (_getfat(bufad, bpp, 0)) {
     
    143143*/
    144144
    145 int _rdroot(unsigned *buf, struct bpb *bpp)
    146 {
    147         return(BIOS(B_RDWR, 0, (char *)buf, bpp->rdlen,
     145int16_t _rdroot(uint16_t *buf, struct bpb *bpp)
     146{
     147        return(BIOS(B_RDWR, 0, (int8_t *)buf, bpp->rdlen,
    148148                (bpp->fatrec + bpp->fsiz), 0));
    149149}
     
    162162*/
    163163
    164 int _nsic(struct fcb *fcp, struct bpb *bpp, char *fp)
    165 {
    166         register unsigned tfe;
     164int16_t _nsic(struct fcb *fcp, struct bpb *bpp, int8_t *fp)
     165{
     166        register uint16_t tfe;
    167167
    168168        /* check the FCB flags */
     
    261261struct dirent *_dsrch(struct dirent *de)
    262262{
    263         unsigned i, dl;
     263        uint16_t i, dl;
    264264        register struct dirent *dp;
    265265
     
    298298struct dirent *_dsnew(void)
    299299{
    300         unsigned i, dl;
     300        uint16_t i, dl;
    301301        register struct dirent *dp;
    302302
     
    332332*/
    333333
    334 void _deadio(struct fcb *fcp, int err)
     334void _deadio(struct fcb *fcp, int16_t err)
    335335{
    336336        fcp->clsec = 0;
     
    355355*/
    356356
    357 int _seek(struct fcb *fcp)
    358 {
    359         register unsigned acls, rcls, nc;
    360         unsigned sic, spc;
     357int16_t _seek(struct fcb *fcp)
     358{
     359        register uint16_t acls, rcls, nc;
     360        uint16_t sic, spc;
    361361
    362362        if (!(fcp->modefl & FC_OPN)) {          /* file must be open */
     
    461461*/
    462462
    463 int _ftrnc(struct dirent *dp)
    464 {
    465         register unsigned acls, ncls;
     463int16_t _ftrnc(struct dirent *dp)
     464{
     465        register uint16_t acls, ncls;
    466466
    467467#if     DEBUGIT
     
    525525*/
    526526
    527 int _newcls(void)
    528 {
    529         register int tc, i;
     527int16_t _newcls(void)
     528{
     529        register int16_t tc, i;
    530530
    531531        tc = _thebpb->numcl;
     
    548548*/
    549549
    550 int _alcnew(struct fcb *fcp)
    551 {
    552         register int ac, nc, pc;
     550int16_t _alcnew(struct fcb *fcp)
     551{
     552        register int16_t ac, nc, pc;
    553553
    554554#if     DEBUGIT
     
    639639*/
    640640
    641 int _fmake(struct fcb *fcp)
     641int16_t _fmake(struct fcb *fcp)
    642642{
    643643        register struct dirent *dp;
     
    664664*/
    665665
    666 int _opnvol(void)
    667 {
    668         register long drc;
     666int16_t _opnvol(void)
     667{
     668        register int32_t drc;
    669669
    670670        /* check for media change if we already have a BPB */
     
    750750*/
    751751
    752 int _opfcb(struct fcb *fcp)
    753 {
    754         int     rc;
     752int16_t _opfcb(struct fcb *fcp)
     753{
     754        int16_t rc;
    755755
    756756        /* check for an already open FCB */
     
    892892*/
    893893
    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;
     894int16_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;
    899899
    900900        /* clear the FCB */
    901901
    902         memset((char *)fcp, 0, sizeof (struct fcb));
     902        memset((int8_t *)fcp, 0, sizeof (struct fcb));
    903903
    904904        /* check for valid flags */
     
    10241024*/
    10251025
    1026 int ClsFile(struct fcb *fcp)
     1026int16_t ClsFile(struct fcb *fcp)
    10271027{
    10281028        register struct dirent *dp;
     
    11361136*/
    11371137
    1138 short fcbinit(char *name, struct fcb *fcp)
    1139 {
    1140         char    tmpname[9], tmpext[4];
     1138int16_t fcbinit(int8_t *name, struct fcb *fcp)
     1139{
     1140        int8_t  tmpname[9], tmpext[4];
    11411141
    11421142        return(_inifcb(fcp, FilName(name, tmpname), FilExt(name, tmpext), 0));
     
    11531153*/
    11541154
    1155 int DelFile(struct fcb *fcp)
     1155int16_t DelFile(struct fcb *fcp)
    11561156{
    11571157#if     DEBUGIT
  • libcio/filname.c

    r0292fbb r7258c6a  
    2020*/
    2121
    22 char *FilName(char *s, char *p)
     22int8_t *FilName(int8_t *s, int8_t *p)
    2323{
    24         register char   *tp;
    25         register int i;
     24        register int8_t *tp;
     25        register int16_t i;
    2626
    2727        tp = p;
     
    5959*/
    6060
    61 char *FilExt(char *s, char *p)
     61int8_t *FilExt(int8_t *s, int8_t *p)
    6262{
    63         register char c, *tp;
    64         register int i;
     63        register int8_t c, *tp;
     64        register int16_t i;
    6565
    6666        tp = p;
  • libcio/flread.c

    r0292fbb r7258c6a  
    1919*/
    2020
    21 int flread(char *buff, long len, FILE *fp)
     21int16_t flread(int8_t *buff, int32_t len, FILE *fp)
    2222{
    23         register int    ilen;
     23        register int16_t        ilen;
    2424
    2525        while (len > 0L) {
    2626
    27                 if (len GE (long)CHUNK) {
     27                if (len GE (int32_t)CHUNK) {
    2828
    2929                        if (1 NE fread(buff, CHUNK, 1, fp))
    3030                                return(EOF);
    3131
    32                         buff += (long)CHUNK;
    33                         len -= (long)CHUNK;
     32                        buff += (int32_t)CHUNK;
     33                        len -= (int32_t)CHUNK;
    3434
    3535                } else {
  • libcio/fopen.c

    r0292fbb r7258c6a  
    1111#include "stddefs.h"
    1212
    13 extern  long    lseek(int fd, long pos, int how);
     13extern  int32_t lseek(int16_t fd, int32_t pos, int16_t how);
    1414
    15 FILE *_opener(char *name, char *mode, int aflag)
     15FILE *_opener(int8_t *name, int8_t *mode, int16_t aflag)
    1616{
    1717        register FILE *fp;
    18         register int plusopt;
     18        register int16_t plusopt;
    1919
    2020        fp = Cbuffs;
     
    7070*/
    7171
    72 FILE *fopen(char *name, char *mode)
     72FILE *fopen(int8_t *name, int8_t *mode)
    7373{
    7474        return(_opener(name, mode, 0));
    7575}
    7676
    77 FILE *fopena(char *name, char *mode)
     77FILE *fopena(int8_t *name, int8_t *mode)
    7878{
    7979        return(_opener(name, mode, 0));
    8080}
    8181
    82 FILE *fopenb(char *name, char *mode)
     82FILE *fopenb(int8_t *name, int8_t *mode)
    8383{
    8484        return(_opener(name, mode, O_RAW));
  • libcio/fprintf.c

    r0292fbb r7258c6a  
    1212static FILE *Stream;
    1313
    14 extern  long    dofmt_(int (*putsub)(), char *format, va_list args);
    15 extern  int     aputc(int c, FILE *ptr);
     14extern  int32_t dofmt_(int16_t (*putsub)(), int8_t *format, va_list args);
     15extern  int16_t aputc(int16_t c, FILE *ptr);
    1616
    17         static int fpsub(int c);
     17        static int16_t fpsub(int16_t c);
    1818
    19 int fprintf(FILE *stream, char *fmt, ...)
     19int16_t fprintf(FILE *stream, int8_t *fmt, ...)
    2020{
    21         register int count;
     21        register int16_t count;
    2222        va_list aptr;
    2323
     
    2929}
    3030
    31 static int fpsub(int c)
     31static int16_t fpsub(int16_t c)
    3232{
    3333        return(aputc(c, Stream));
  • libcio/fputs.c

    r0292fbb r7258c6a  
    99#include "stddefs.h"
    1010
    11 int puts(char *str)
     11int16_t puts(int8_t *str)
    1212{
    1313        while (*str)
     
    1818}
    1919
    20 int aputc(int c, FILE *ptr)
     20int16_t aputc(int16_t c, FILE *ptr)
    2121{
    2222        c &= 127;
     
    2929}
    3030
    31 int fputs(char *s, FILE *fp)
     31int16_t fputs(int8_t *s, FILE *fp)
    3232{
    3333        while ( *s )
  • libcio/fread.c

    r0292fbb r7258c6a  
    1616*/
    1717
    18 int fread(char *buffer, unsigned size, int number, FILE *stream)
     18int16_t fread(int8_t *buffer, uint16_t size, int16_t number, FILE *stream)
    1919{
    20         int total;
    21         register int c,i;
     20        int16_t total;
     21        register int16_t c,i;
    2222
    2323        for (total = 0; total < number; ++total) {
  • libcio/fscanf.c

    r0292fbb r7258c6a  
    99#include "stddefs.h"
    1010
    11 static int scnlast;
     11static int16_t scnlast;
    1212static FILE *scnfp;
    1313
    14 static int gchar(int what)
     14static int16_t gchar(int16_t what)
    1515{
    1616        if (what EQ 0) {
     
    2626}
    2727
    28 int scanf(char *fmt, int *args)
     28int16_t scanf(int8_t *fmt, int16_t *args)
    2929{
    3030        scnfp = stdin;
     
    3333}
    3434
    35 int fscanf(FILE *fp, char *fmt, int *args)
     35int16_t fscanf(FILE *fp, int8_t *fmt, int16_t *args)
    3636{
    3737        scnfp = fp;
  • libcio/fseek.c

    r0292fbb r7258c6a  
    1111#include "stddefs.h"
    1212
    13 extern  long    lseek(int fd, long pos, int how);
     13extern  int32_t lseek(int16_t fd, int32_t pos, int16_t how);
    1414
    1515/*
     
    1919*/
    2020
    21 int fseek(FILE *fp, long pos, int mode)
     21int16_t fseek(FILE *fp, int32_t pos, int16_t mode)
    2222{
    23         register int i, lr;
    24         long curpos;
     23        register int16_t i, lr;
     24        int32_t curpos;
    2525
    2626        if (fp->_flags & _DIRTY) {
     
    3232
    3333                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;
    3535        }
    3636
  • libcio/fsinit.c

    r0292fbb r7258c6a  
    1414#include "stddefs.h"
    1515
    16 extern  int     _bpbin, _dirin, _fatin, _dirmod, _fatmod;
     16extern  int16_t _bpbin, _dirin, _fatin, _dirmod, _fatmod;
    1717
    18 int     _badfd(void);
    19 int     _noper(void);
     18int16_t _badfd(void);
     19int16_t _noper(void);
    2020
    21 char    *Stdbufs;                       /* buffer chain pointer */
     21int8_t  *Stdbufs;                       /* buffer chain pointer */
    2222
    23 char    Wrkbuf[BPSEC];                  /* sector work buffer */
     23int8_t  Wrkbuf[BPSEC];                  /* sector work buffer */
    2424
    25 long    Stdbuf[MAXDFILE][BUFSIZL];      /* standard buffers */
     25int32_t Stdbuf[MAXDFILE][BUFSIZL];      /* standard buffers */
    2626
    2727FILE Cbuffs[NSTREAMS];                  /* stream file control table */
     
    3535/* WARNING:  this ONLY works for 512 byte sectors, 9 sectors per track */
    3636
    37 short   _b_tbuf[9][256];        /* the track buffer */
     37int16_t _b_tbuf[9][256];        /* the track buffer */
    3838
    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 */
     39int16_t _b_trak;                /* current track */
     40int16_t _b_side;                /* current side */
     41int16_t _b_sect;                /* current sector */
     42int16_t _b_tsec;                /* current base sector of current track */
    4343
    4444#endif
     
    5454*/
    5555
    56 int _badfd(void)
     56int16_t _badfd(void)
    5757{
    5858        errno = EBADF;          /* set bad fd code */
     
    6666*/
    6767
    68 int _noper(void)
     68int16_t _noper(void)
    6969{
    7070        return(SUCCESS);        /* return with a non-error indication */
     
    8181*/
    8282
    83 void InitCH(struct channel *cp, char rdi, char wri, char ioi, char ski, int (*cfp)(), io_arg charg)
     83void InitCH(struct channel *cp, int8_t rdi, int8_t wri, int8_t ioi, int8_t ski, int16_t (*cfp)(), io_arg charg)
    8484{
    8585        cp->c_read  = rdi;
     
    9797*/
    9898
    99 void Init_CB(FILE *fp, char unit, char flags, long *bufad, int bufsize)
     99void Init_CB(FILE *fp, int8_t unit, int8_t flags, int32_t *bufad, int16_t bufsize)
    100100{
    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;
    104104        fp->_flags  = flags;
    105105        fp->_unit   = unit;
     
    120120void InitFS(void)
    121121{
    122         register int i;
     122        register int16_t i;
    123123
    124124        memset(_fcbtab, 0, sizeof _fcbtab);             /* clear fcb table */
    125125        memsetw(Stdbuf, 0, sizeof Stdbuf / 2);          /* clear buffers */
    126126
    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 */
    130130
    131131        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);
    133133
    134134        Stdbuf[0][0] = 0L;              /* initialize the buffer list */
    135135
    136136        for (i = 1; i < MAXDFILE; i++)
    137                 Stdbuf[i][0] = (long)Stdbuf[i-1];
     137                Stdbuf[i][0] = (int32_t)Stdbuf[i-1];
    138138
    139139        Stdbufs = Stdbuf[MAXDFILE-1];
  • libcio/fsize.c

    r0292fbb r7258c6a  
    1111#include "stddefs.h"
    1212
    13 extern  unsigned        _gtcl12(char *fat, unsigned cl);
    14 extern  int     _opnvol(void);
    15 extern  int     _filecl(struct fcb *fp);
     13extern  uint16_t        _gtcl12(int8_t *fat, uint16_t cl);
     14extern  int16_t _opnvol(void);
     15extern  int16_t _filecl(struct fcb *fp);
    1616
    17 extern  unsigned _thefat[];
     17extern  uint16_t _thefat[];
    1818
    1919extern  struct  bpb     *_thebpb;
     
    2727*/
    2828
    29 long fsize(FILE *fp, short how)
     29int32_t fsize(FILE *fp, int16_t how)
    3030{
    3131        register struct channel *chp;
     
    7070*/
    7171
    72 short dspace(short which)
     72int16_t dspace(int16_t which)
    7373{
    74         register short maxcl, clcount, nc;
     74        register int16_t maxcl, clcount, nc;
    7575
    7676        if (_opnvol())
  • libcio/fstubs.c

    r0292fbb r7258c6a  
    4040*/
    4141
    42 int readbuf(int dev, char *buf)
     42int16_t readbuf(int16_t dev, int8_t *buf)
    4343{
    4444        xtrap15();
  • libcio/ftell.c

    r0292fbb r7258c6a  
    1717#endif
    1818
    19 extern  int     _filecl(struct fcb *fp);
     19extern  int16_t _filecl(struct fcb *fp);
    2020
    2121/*
     
    2525*/
    2626
    27 long ftell(FILE *fp)
     27int32_t ftell(FILE *fp)
    2828{
    2929        register struct fcb *fcp;
    3030        register struct channel *chp;
    31         register long dpos, pos, diff;
     31        register int32_t dpos, pos, diff;
    3232
    3333        if (fp EQ (FILE *)0L) {         /* see if we point at a FILE */
     
    6969
    7070        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));
    7272        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));
    7474        else
    7575                pos = dpos;
  • libcio/fwrite.c

    r0292fbb r7258c6a  
    2020*/
    2121
    22 int fwrite(char *buffer, int size, int number, FILE *stream)
     22int16_t fwrite(int8_t *buffer, int16_t size, int16_t number, FILE *stream)
    2323{
    24         register int i, j;
     24        register int16_t i, j;
    2525
    2626        if (size < 0)           /* check size for validity */
  • libcio/getbuff.c

    r0292fbb r7258c6a  
    1111void getbuff(FILE *ptr)
    1212{
    13         char *buffer;
     13        int8_t *buffer;
    1414
    1515        if (ptr->_buflen EQ 1) {        /* see if we want the small buffer */
     
    2121        if (Stdbufs) {          /* see if we have any standard buffers left */
    2222
    23                 buffer = (char *)Stdbufs;
    24                 Stdbufs = *(long **)Stdbufs;
     23                buffer = (int8_t *)Stdbufs;
     24                Stdbufs = *(int32_t **)Stdbufs;
    2525
    2626        } else {                /* ... if not, use the small one */
  • libcio/getc.c

    r0292fbb r7258c6a  
    99#include "stddefs.h"
    1010
    11 int getc(FILE *ptr)
     11int16_t getc(FILE *ptr)
    1212{
    13         register int len;
     13        register int16_t len;
    1414
    1515        if (ptr->_bp >= ptr->_bend) {           /* see if the buffer is empty */
  • libcio/getl.c

    r0292fbb r7258c6a  
    88#include "stdio.h"
    99
    10 extern  int     getc(FILE *ptr);
     10extern  int16_t getc(FILE *ptr);
    1111
    1212/*
     
    1919*/
    2020
    21 long getl(FILE *stream)
     21int32_t getl(FILE *stream)
    2222{
    23         long temp;
    24         register char *t;
     23        int32_t temp;
     24        register int8_t *t;
    2525
    2626        t = &temp;
  • libcio/getw.c

    r0292fbb r7258c6a  
    88#include "stdio.h"
    99
    10 extern  int     getc(FILE *ptr);
     10extern  int16_t getc(FILE *ptr);
    1111
    1212/*
     
    1919*/
    2020
    21 int getw(FILE *stream)
     21int16_t getw(FILE *stream)
    2222{
    23         int temp;
    24         register char *t;
     23        int16_t temp;
     24        register int8_t *t;
    2525
    2626        t = &temp;
  • libcio/lseek.c

    r0292fbb r7258c6a  
    1313#include "stddefs.h"
    1414
    15 extern  int     _seek(struct fcb *fcp);
     15extern  int16_t _seek(struct fcb *fcp);
    1616
    1717#if     DEBUGIT
     
    1919#endif
    2020
    21 long lseek(int fd, long pos, int how)
     21int32_t lseek(int16_t fd, int32_t pos, int16_t how)
    2222{
    2323        register struct fcb *fp;
     
    9696        }
    9797
    98         fp->offset = pos & ((long)BPSEC - 1);   /* calculate sector offset */
     98        fp->offset = pos & ((int32_t)BPSEC - 1);        /* calculate sector offset */
    9999        fp->curlsn = pos >> FILESHFT;           /* calculate logical sector */
    100100
  • libcio/open.c

    r0292fbb r7258c6a  
    1212#include "stddefs.h"
    1313
    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);
     14extern  int16_t _badfd(void);
     15extern  int16_t _noper(void);
     16extern  int16_t _inifcb(struct fcb *fcp, int8_t *name, int8_t *ext, int16_t mode);
     17extern  int16_t _opfcb(struct fcb *fcp);
     18
     19extern  int8_t  *FilName(int8_t *s, int8_t *p);
     20extern  int8_t  *FilExt(int8_t *s, int8_t *p);
     21
     22int16_t _fileop(int8_t *name, int16_t flag, int16_t mode, struct channel *chp, struct devtabl *dp);
     23int16_t _filecl(struct fcb *fp);
    2424
    2525static struct device condev  = { 2, 2, 1, 0, _noper  };
     
    5555*/
    5656
    57 int open(char *name, int flag, int mode)
     57int16_t open(int8_t *name, int16_t flag, int16_t mode)
    5858{
    5959        register struct devtabl *dp;
    6060        register struct channel *chp;
    6161        register struct device  *dev;
    62         int     fd, mdmask;
     62        int16_t fd, mdmask;
    6363
    6464        /* search for a free channel */
     
    131131*/
    132132
    133 int opena(char *name, int flag, int mode)
     133int16_t opena(int8_t *name, int16_t flag, int16_t mode)
    134134{
    135135        return(open(name, flag, mode));
     
    145145*/
    146146
    147 int openb(char *name, int flag, int mode)
     147int16_t openb(int8_t *name, int16_t flag, int16_t mode)
    148148{
    149149        return(open(name, flag|O_RAW, mode));
     
    164164*/
    165165
    166 int creat(char *name, int mode)
     166int16_t creat(int8_t *name, int16_t mode)
    167167{
    168168        return(open(name, O_WRONLY|O_TRUNC|O_CREAT, mode));
     
    183183*/
    184184
    185 int creata(char *name, int mode)
     185int16_t creata(int8_t *name, int16_t mode)
    186186{
    187187        return(open(name, O_WRONLY|O_TRUNC|O_CREAT, mode));
     
    198198*/
    199199
    200 int creatb(char *name, int mode)
     200int16_t creatb(int8_t *name, int16_t mode)
    201201{
    202202        return(open(name, O_WRONLY|O_TRUNC|O_CREAT|O_RAW, mode));
     
    215215*/
    216216
    217 int _fileop(char *name, int flag, int mode, struct channel *chp, struct devtabl *dp)
     217int16_t _fileop(int8_t *name, int16_t flag, int16_t mode, struct channel *chp, struct devtabl *dp)
    218218{
    219219        register struct fcb *fp;
    220         char    tmpname[9], tmpext[4];
     220        int8_t  tmpname[9], tmpext[4];
    221221
    222222        /* search for an available fcb entry */
  • libcio/posit.c

    r0292fbb r7258c6a  
    1111#include "stddefs.h"
    1212
    13 extern  int     _seek(struct fcb *fcp);
     13extern  int16_t _seek(struct fcb *fcp);
    1414
    1515/*
     
    1919*/
    2020
    21 int posit(int fd, unsigned pos)
     21int16_t posit(int16_t fd, uint16_t pos)
    2222{
    2323        register struct fcb *fp;
  • libcio/putc.c

    r0292fbb r7258c6a  
    99#include "stddefs.h"
    1010
    11 extern  int     write(int fd, char *buff, unsigned len);
     11extern  int16_t write(int16_t fd, int8_t *buff, uint16_t len);
    1212extern  void    getbuff(FILE *ptr);
    13 extern  int     close(int fd);
     13extern  int16_t close(int16_t fd);
    1414
    15 extern int (*_clsall)();
     15extern int16_t (*_clsall)();
    1616
    17 static int (*cls_rtn)();
     17static int16_t (*cls_rtn)();
    1818
    19 int     _ClFlag;
     19int16_t _ClFlag;
    2020
    21 int     fclose(FILE *ptr);
     21int16_t fclose(FILE *ptr);
    2222
    2323/*
     
    4747*/
    4848
    49 int flush_(FILE *ptr, int data)
     49int16_t flush_(FILE *ptr, int16_t data)
    5050{
    51         register int size;
     51        register int16_t size;
    5252
    5353        if (_ClFlag EQ 0) {
     
    6060        if (ptr->_flags & _DIRTY) {     /* something in the buffer ? */
    6161
    62                 size = (int)((long)ptr->_bp - (long)ptr->_buff);
     62                size = (int16_t)((int32_t)ptr->_bp - (int32_t)ptr->_buff);
    6363
    6464                if (write(ptr->_unit, ptr->_buff, size) EQ -1) {
     
    105105*/
    106106
    107 int fflush(FILE *ptr)
     107int16_t fflush(FILE *ptr)
    108108{
    109109        return(flush_(ptr, -1));
     
    116116*/
    117117
    118 int fclose(FILE *ptr)
     118int16_t fclose(FILE *ptr)
    119119{
    120         int err;
     120        int16_t err;
    121121
    122122        err = 0;
     
    131131                if (ptr->_flags & _ALLBUF) {    /* deallocate standard buffer */
    132132
    133                         *(long **)ptr->_buff = Stdbufs;
    134                         Stdbufs = (long *)ptr->_buff;
     133                        *(int32_t **)ptr->_buff = Stdbufs;
     134                        Stdbufs = (int32_t *)ptr->_buff;
    135135                }
    136136        }
     
    150150*/
    151151
    152 int putc(int c, FILE *ptr)
     152int16_t putc(int16_t c, FILE *ptr)
    153153{
    154154        if (ptr->_bp GE ptr->_bend)
     
    164164*/
    165165
    166 int puterr(int c)
     166int16_t puterr(int16_t c)
    167167{
    168168        return(putc(c, stderr));
  • libcio/putl.c

    r0292fbb r7258c6a  
    1111#include "stddefs.h"
    1212
    13 void putl(long w, FILE *stream)
     13void putl(int32_t w, FILE *stream)
    1414{
    1515        if (putc(((w >> 24) & 0xFF), stream) < 0 )
  • libcio/putw.c

    r0292fbb r7258c6a  
    1111#include "stddefs.h"
    1212
    13 void putw(unsigned w, FILE *stream)
     13void putw(uint16_t w, FILE *stream)
    1414{
    1515        if (putc(((w >> 8) & 0xFF), stream) < 0 )
  • libcio/read.c

    r0292fbb r7258c6a  
    4646#endif
    4747
    48 extern  int     _badfd(void);
    49 extern  int     _conin(char *buff, int len);
    50 extern  int     _seek(struct fcb *fcp);
     48extern  int16_t _badfd(void);
     49extern  int16_t _conin(int8_t *buff, int16_t len);
     50extern  int16_t _seek(struct fcb *fcp);
    5151
    52 extern  void    *memcpy(void *vp1, void *vp2, int n);
     52extern  void    *memcpy(void *vp1, void *vp2, int16_t n);
    5353
    54 int     _filerd(struct fcb *fp, char *buffer, unsigned len);
     54int16_t _filerd(struct fcb *fp, int8_t *buffer, uint16_t len);
    5555
    56 static int (*t_read[])() = {
     56static int16_t (*t_read[])() = {
    5757
    5858        _badfd,         /* 0 - invalid type */
     
    7272*/
    7373
    74 int read(int fd, char *buff, unsigned len)
     74int16_t read(int16_t fd, int8_t *buff, uint16_t len)
    7575{
    7676        register struct channel *chp;
     
    9797*/
    9898
    99 int _getsec(struct fcb *fp, char *buf, unsigned len)
     99int16_t _getsec(struct fcb *fp, int8_t *buf, uint16_t len)
    100100{
    101101        if ((errno = ReadRN(fp, Wrkbuf)) NE 0)  /* get current sector */
     
    126126*/
    127127
    128 int _filerd(struct fcb *fp, char *buffer, unsigned len)
     128int16_t _filerd(struct fcb *fp, int8_t *buffer, uint16_t len)
    129129{
    130         register unsigned l;
    131         register unsigned j, k;
    132         register long curpos, newpos;
     130        register uint16_t l;
     131        register uint16_t j, k;
     132        register int32_t curpos, newpos;
    133133
    134134        l = 0;
  • libcio/readrn.c

    r0292fbb r7258c6a  
    2727
    2828#if     TBUFFER
    29 extern  long    _secrd(char *buf, short rec);
     29extern  int32_t _secrd(int8_t *buf, int16_t rec);
    3030#endif
    3131
    32 extern  long    _berrno;
    33 extern  int     _seek(struct fcb *fcp);
     32extern  int32_t _berrno;
     33extern  int16_t _seek(struct fcb *fcp);
    3434
    3535/*
     
    4444*/
    4545
    46 int ReadRN(struct fcb *fcp, char *buf)
     46int16_t ReadRN(struct fcb *fcp, int8_t *buf)
    4747{
    48         int     sv;             /* seek return code */
    49         long    brc;            /* bios return code */
     48        int16_t sv;             /* seek return code */
     49        int32_t brc;            /* bios return code */
    5050
    5151        if (sv = _seek(fcp))            /* try to find the sector we want */
     
    6868
    6969#if     TBUFFER
    70         if (brc = _secrd(buf, (short)fcp->curdsn)) {
     70        if (brc = _secrd(buf, (int16_t)fcp->curdsn)) {
    7171#else
    7272        if (brc = BIOS(B_RDWR, 0, buf, 1, (short)fcp->curdsn, 0)) {
  • libcio/rename.c

    r0292fbb r7258c6a  
    66*/
    77
    8 int rename(char *old, char *new)
     8int16_t rename(int8_t *old, int8_t *new)
    99{
    10         char buff[60];
     10        int8_t buff[60];
    1111
    1212        return(-1);             /* return an error for now */
  • libcio/scan.c

    r0292fbb r7258c6a  
    1010#include "ctype.h"
    1111
    12 static int maxwide;
    13 static int (*gsub)();
    14 
    15 extern char *index(char *str, char c);
    16 
    17 static char *scnstr;
    18 static char quit;
    19 
    20 /*
    21 
    22 */
    23 
    24 static long getnum(char *list, char *values, int base)
    25 {
    26         register long val;
    27         register char *cp;
    28         int c;
    29         int sign;
     12static int16_t maxwide;
     13static int16_t (*gsub)();
     14
     15extern int8_t *index(int8_t *str, int8_t c);
     16
     17static int8_t *scnstr;
     18static int8_t quit;
     19
     20/*
     21
     22*/
     23
     24static 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;
    3030
    3131        if (maxwide LE 0)
     
    5353
    5454                val *= base;
    55                 val += values[(long)cp - (long)list];
     55                val += values[(int32_t)cp - (int32_t)list];
    5656        }
    5757
     
    6666*/
    6767
    68 static int skipblk(void)
     68static int16_t skipblk(void)
    6969{
    7070        while (isspace((*gsub)(0)))
     
    7777}
    7878
    79 static int sgetc(int what)
     79static int16_t sgetc(int16_t what)
    8080{
    8181        if (what EQ 0) {
     
    9999*/
    100100
    101 int scanfmt(int (*getsub)(), char *fmt, int **args)
     101int16_t scanfmt(int16_t (*getsub)(), int8_t *fmt, int16_t **args)
    102102{
    103103
     
    106106#endif
    107107
    108         long lv;
    109         int c, count, dontdo, lflag, base;
    110         char *cp;
    111         char tlist[130];
    112 
    113         static char list[] = "ABCDEFabcdef9876543210";
    114 
    115         static char vals[] = {
     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[] = {
    116116
    117117                10,11,12,13,14,15,10,11,12,13,14,15,9,8,7,6,5,4,3,2,1,0
     
    198198
    199199                                        if (lflag)
    200                                                 *(long *)(*args++) = lv;
     200                                                *(int32_t *)(*args++) = lv;
    201201                                        else
    202202                                                **args++ = lv;
     
    298298                                if (!dontdo) {
    299299
    300                                         *(char *)(*args++) = c;
     300                                        *(int8_t *)(*args++) = c;
    301301                                        ++count;
    302302                                }
     
    379379*/
    380380
    381 int sscanf(char *string, char *fmt, int *args)
     381int16_t sscanf(int8_t *string, int8_t *fmt, int16_t *args)
    382382{
    383383        scnstr = string;
  • libcio/setbuf.c

    r0292fbb r7258c6a  
    88#include "stdio.h"
    99
    10 void setbuf(FILE *stream, char *buffer)
     10void setbuf(FILE *stream, int8_t *buffer)
    1111{
    1212        if (stream->_buff)
  • libcio/ungetc.c

    r0292fbb r7258c6a  
    99#include "stddefs.h"
    1010
    11 int ungetc(int c, FILE *ptr)
     11int16_t ungetc(int16_t c, FILE *ptr)
    1212{
    1313        if ((c EQ EOF) OR (ptr->_bp LE ptr->_buff))
  • libcio/unlink.c

    r0292fbb r7258c6a  
    1717#endif
    1818
    19 extern  int     DelFile(struct fcb *fcp);
     19extern  int16_t DelFile(struct fcb *fcp);
    2020
    2121/*
     
    2525*/
    2626
    27 int unlink(char *name)
     27int16_t unlink(int8_t *name)
    2828{
    2929        struct fcb delfcb;
  • libcio/write.c

    r0292fbb r7258c6a  
    1313#include "stddefs.h"
    1414
    15 int     _filewr(struct fcb *fp, char *buffer, unsigned len);
    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(unsigned *fat, unsigned cl, unsigned val);
    25 
    26 extern  long    miconl(long wi);
    27 
    28 extern  void    *memset(void *vp, char c, int n);
    29 
    30 extern  int     _fatmod;
    31 
    32 extern  unsigned        _thefat[];
     15int16_t _filewr(struct fcb *fp, int8_t *buffer, uint16_t len);
     16
     17extern  int16_t _badfd(void);
     18extern  int16_t _conwr(int16_t kind, int8_t *buff, int16_t len);
     19extern  int16_t blkwr(struct fcb *fcp, int8_t *buf, int16_t ns);
     20extern  int16_t ReadRN(struct fcb *fcp, int8_t *buf);
     21extern  int16_t WriteRN(struct fcb *fcp, int8_t *buf);
     22extern  int16_t _newcls(void);
     23extern  int16_t micons(int16_t wi);
     24extern  void    _ptcl12(uint16_t *fat, uint16_t cl, uint16_t val);
     25
     26extern  int32_t miconl(int32_t wi);
     27
     28extern  void    *memset(void *vp, int8_t c, int16_t n);
     29
     30extern  int16_t _fatmod;
     31
     32extern  uint16_t        _thefat[];
    3333
    3434extern  struct  bpb     *_thebpb;
     
    3838#endif
    3939
    40 static  int     (*wr_tab[])() = {       /* write routine dispatch table */
     40static  int16_t (*wr_tab[])() = {       /* write routine dispatch table */
    4141
    4242        _badfd,         /* 0 - invalid entry */
     
    5555*/
    5656
    57 int _putsec(struct fcb *fp, char *buf, unsigned len)
     57int16_t _putsec(struct fcb *fp, int8_t *buf, uint16_t len)
    5858{
    5959#if DEBUGIT
     
    126126*/
    127127
    128 int _filewr(struct fcb *fp, char *buffer, unsigned len)
     128int16_t _filewr(struct fcb *fp, int8_t *buffer, uint16_t len)
    129129{
    130         register unsigned j, k, l;
    131         int clustr;
    132         register long curpos;
     130        register uint16_t j, k, l;
     131        int16_t clustr;
     132        register int32_t curpos;
    133133
    134134        curpos = fp->offset + (fp->curlsn << FILESHFT); /* get position */
     
    245245*/
    246246
    247 int write(int fd, char *buff, unsigned len)
     247int16_t write(int16_t fd, int8_t *buff, uint16_t len)
    248248{
    249249        register struct channel *chp;
  • libcio/writern.c

    r0292fbb r7258c6a  
    2222#include "fspars.h"
    2323
    24 extern  long    _berrno;
    25 extern  int     _seek(struct fcb *fcp);
     24extern  int32_t _berrno;
     25extern  int16_t _seek(struct fcb *fcp);
    2626
    2727#if DEBUGIT
     
    3030
    3131#if     TBUFFER
    32 extern  long    _secwr(char *buf, short rec);
     32extern  int32_t _secwr(int8_t *buf, int16_t rec);
    3333#endif
    3434
     
    4444*/
    4545
    46 int WriteRN(struct fcb *fcp, char *buf)
     46int16_t WriteRN(struct fcb *fcp, int8_t *buf)
    4747{
    48         int     sv;             /* seek return code */
    49         long    brc;            /* bios return code */
     48        int16_t sv;             /* seek return code */
     49        int32_t brc;            /* bios return code */
    5050
    5151        if (sv = _seek(fcp)) {          /* try to find the sector we want */
     
    8686        /* write the sector */
    8787
    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)) {
    8989
    9090#if DEBUGIT
     
    9999
    100100#if     TBUFFER
    101         _secwr(buf, (short)fcp->curdsn);
     101        _secwr(buf, (int16_t)fcp->curdsn);
    102102#endif
    103103
Note: See TracChangeset for help on using the changeset viewer.