xref: /csrg-svn/usr.bin/f77/libI77/fio.h (revision 47943)
1*47943Sbostic /*-
2*47943Sbostic  * Copyright (c) 1980 The Regents of the University of California.
3*47943Sbostic  * All rights reserved.
42506Sdlw  *
5*47943Sbostic  * %sccs.include.proprietary.c%
623058Skre  */
723058Skre 
8*47943Sbostic #ifndef lint
9*47943Sbostic static char sccsid[] = "@(#)fio.h	5.2 (Berkeley) 04/12/91";
10*47943Sbostic #endif /* not lint */
11*47943Sbostic 
1223058Skre /*
132506Sdlw  * f77 file i/o common definitions
142506Sdlw  */
152506Sdlw 
162506Sdlw #include "fiodefs.h"
172506Sdlw 
1820985Slibs #define LOCAL		static
192506Sdlw #define err(f,n,s)	{if(f) return(errno=n); else fatal(n,s);}
202506Sdlw #define not_legal(u)	(u>=MXUNIT || u<0)
212506Sdlw #define GET(x)		if((x=(*getn)())<0) return(x)
222506Sdlw #define VAL(x)		(x!='\n'?x:' ')
232506Sdlw #define PUT(x)		{if(n=(*putn)(x)) return(n);}
242506Sdlw #define lcase(s)	((s >= 'A') && (s <= 'Z') ? s+('a'-'A') : s)
252506Sdlw 
262506Sdlw #define MAXINTLENGTH	32	/* to accomodate binary format */
272506Sdlw 
282506Sdlw long ftell();
292506Sdlw 
302506Sdlw extern int errno;
312506Sdlw extern ioflag init;
322506Sdlw extern flag reading,external,sequential,formatted;
332506Sdlw extern int (*getn)(),(*putn)(),(*ungetn)();	/*for formatted io*/
342506Sdlw extern FILE *cf;	/*current file structure*/
352506Sdlw extern unit *curunit;	/*current unit structure */
362506Sdlw extern int lunit;	/*current logical unit*/
372506Sdlw extern char *lfname;	/*current filename*/
382506Sdlw extern unit units[];	/*logical units table*/
392506Sdlw extern int recpos;		/*position in current record*/
402506Sdlw extern ftnint recnum;		/*current record number*/
412506Sdlw extern int reclen;		/* current record length */
422506Sdlw extern int (*doed)(), (*doned)();
432506Sdlw extern int (*dorevert)(), (*donewrec)(), (*doend)(), (*dotab)();
442506Sdlw extern ioflag cblank, cplus, tab, elist, signit, errflag, endflag;
452506Sdlw extern char *fmtbuf, *icptr, *icend, *fmtptr;
462506Sdlw extern int scale;
472506Sdlw extern int cursor;
482506Sdlw extern int radix;
4912019Sdlw extern struct ioiflg	ioiflg_;
50