Annotation of 42BSD/usr.lib/libI77/rewind.c, revision 1.1

1.1     ! root        1: /*
        !             2: char id_rewind[] = "@(#)rewind.c       1.3";
        !             3:  *
        !             4:  * rewind.c  -  f77 file rewind
        !             5:  */
        !             6: 
        !             7: #include "fio.h"
        !             8: 
        !             9: static char    rwnd[]  = "rewind";
        !            10: 
        !            11: f_rew(a) alist *a;
        !            12: {      int n;
        !            13:        unit *b;
        !            14: 
        !            15:        lfname = NULL;
        !            16:        elist = NO;
        !            17:        external = YES;                 /* for err */
        !            18:        lunit = a->aunit;
        !            19:        errflag = a->aerr;
        !            20:        if(not_legal(lunit)) err(errflag,F_ERUNIT,rwnd)
        !            21:        b = &units[lunit];
        !            22:        if(!b->ufd && (n=fk_open(READ,SEQ,FMT,(ftnint)lunit)) )
        !            23:                err(errflag,n,rwnd)
        !            24:        lfname = b->ufnm;
        !            25:        if(!b->useek) err(errflag,F_ERNOBKSP,rwnd)
        !            26:        b->uend = NO;
        !            27:        if(b->uwrt)
        !            28:                if(n=t_runc(b,errflag,rwnd)) return(n);
        !            29:        rewind(b->ufd);
        !            30:        return(OK);
        !            31: }

unix.superglobalmegacorp.com

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