xref: /csrg-svn/usr.bin/f77/libI77/fio.h (revision 23058)
12506Sdlw /*
2*23058Skre  * Copyright (c) 1980 Regents of the University of California.
3*23058Skre  * All rights reserved.  The Berkeley software License Agreement
4*23058Skre  * specifies the terms and conditions for redistribution.
52506Sdlw  *
6*23058Skre  *	@(#)fio.h	5.1 (Berkeley) 06/07/85
7*23058Skre  */
8*23058Skre 
9*23058Skre /*
102506Sdlw  * f77 file i/o common definitions
112506Sdlw  */
122506Sdlw 
132506Sdlw #include "fiodefs.h"
142506Sdlw 
1520985Slibs #define LOCAL		static
162506Sdlw #define err(f,n,s)	{if(f) return(errno=n); else fatal(n,s);}
172506Sdlw #define not_legal(u)	(u>=MXUNIT || u<0)
182506Sdlw #define GET(x)		if((x=(*getn)())<0) return(x)
192506Sdlw #define VAL(x)		(x!='\n'?x:' ')
202506Sdlw #define PUT(x)		{if(n=(*putn)(x)) return(n);}
212506Sdlw #define lcase(s)	((s >= 'A') && (s <= 'Z') ? s+('a'-'A') : s)
222506Sdlw 
232506Sdlw #define MAXINTLENGTH	32	/* to accomodate binary format */
242506Sdlw 
252506Sdlw long ftell();
262506Sdlw 
272506Sdlw extern int errno;
282506Sdlw extern ioflag init;
292506Sdlw extern flag reading,external,sequential,formatted;
302506Sdlw extern int (*getn)(),(*putn)(),(*ungetn)();	/*for formatted io*/
312506Sdlw extern FILE *cf;	/*current file structure*/
322506Sdlw extern unit *curunit;	/*current unit structure */
332506Sdlw extern int lunit;	/*current logical unit*/
342506Sdlw extern char *lfname;	/*current filename*/
352506Sdlw extern unit units[];	/*logical units table*/
362506Sdlw extern int recpos;		/*position in current record*/
372506Sdlw extern ftnint recnum;		/*current record number*/
382506Sdlw extern int reclen;		/* current record length */
392506Sdlw extern int (*doed)(), (*doned)();
402506Sdlw extern int (*dorevert)(), (*donewrec)(), (*doend)(), (*dotab)();
412506Sdlw extern ioflag cblank, cplus, tab, elist, signit, errflag, endflag;
422506Sdlw extern char *fmtbuf, *icptr, *icend, *fmtptr;
432506Sdlw extern int scale;
442506Sdlw extern int cursor;
452506Sdlw extern int radix;
4612019Sdlw extern struct ioiflg	ioiflg_;
47