Annotation of researchv9/include/fio.h, revision 1.1.1.1

1.1       root        1: /*
                      2: #ifdef mc68020
                      3: #define        GNOT
                      4: #endif
                      5: */
                      6: 
                      7: #define        FIOBSIZE        4096
                      8: 
                      9: typedef struct Fbuffer
                     10: {
                     11:        unsigned char *next;            /* next char to be used */
                     12:        unsigned char *end;             /* first invalid char */
                     13:        unsigned char *lnext;           /* previous value of next */
                     14:        char rdlast;                    /* true if last input was rdline */
                     15:        long offset;                    /* seek of next char to be read */
                     16:        unsigned char buf[FIOBSIZE];
                     17: } Fbuffer;
                     18: extern Fbuffer *Ffb[];
                     19: 
                     20: #define        FIORESET(f)     ((f)->next=(f)->lnext=(f)->end=(f)->buf, (f)->rdlast=0)
                     21: #define        FIOSET(f, fd)   if((f=Ffb[fd&=0x7f]) == 0){Finit(fd,(char *)0);f=Ffb[fd];}
                     22: /* FIOLINELEN is length of last input */
                     23: #define        FIOLINELEN(fd)  (((int)(Ffb[fd]->next - Ffb[fd]->lnext))-1)
                     24: /* FIOSEEK is lseek of next char to be processed */
                     25: #define        FIOSEEK(fd)     (Ffb[fd]->offset - (Ffb[fd]->end - Ffb[fd]->next))
                     26: 
                     27: extern void Finit();
                     28: extern char *Frdline();
                     29: extern void Fundo();
                     30: extern int Fgetc();
                     31: extern long Fread();
                     32: extern long Fseek();
                     33: 
                     34: /* COUNT is the type of counts to things like read, write, memcpy etc */
                     35: /*
                     36: #ifdef GNOT
                     37: #define        COUNT   long
                     38: #define        FIOMALLOC(n)    sbrk(n)
                     39: #define        SEEK(a,b,c)     seek(a,b,c)
                     40: #else
                     41: */
                     42: #define        COUNT   int
                     43: #define        FIOMALLOC(n)    malloc(n)
                     44: #define        SEEK(a,b,c)     lseek(a,b,c)
                     45: /*#endif*/
                     46: extern COUNT read(), write();

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.