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