2001-07-01 22:19:33 +02:00
|
|
|
#include <sys/types.h>
|
1998-02-01 02:37:08 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#ifndef NULL
|
|
|
|
/* ANSI C */
|
|
|
|
#include <stddef.h>
|
|
|
|
#endif
|
|
|
|
#ifdef STDC_HEADERS
|
|
|
|
#include <string.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SEEK_SET
|
|
|
|
#define SEEK_SET 0
|
|
|
|
#define SEEK_CUR 1
|
|
|
|
#define SEEK_END 2
|
|
|
|
#endif
|
|
|
|
|
2001-07-06 14:09:39 +02:00
|
|
|
/* Only use fseeko/ftello if they are both there. */
|
|
|
|
|
|
|
|
#if defined (HAVE_FSEEKO) && defined (HAVE_FTELLO)
|
2002-01-15 18:27:05 +01:00
|
|
|
#define FSEEK fseeko
|
2001-07-06 14:09:39 +02:00
|
|
|
#define FTELL ftello
|
|
|
|
#else
|
|
|
|
#define FSEEK fseek
|
|
|
|
#define FTELL ftell
|
|
|
|
#endif
|
|
|
|
|
1998-02-01 02:37:08 +01:00
|
|
|
#if defined (MSDOS) && !defined (GO32)
|
|
|
|
#ifndef NON_UNIX_STDIO
|
|
|
|
#define NON_UNIX_STDIO
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef UIOLEN_int
|
|
|
|
typedef int uiolen;
|
|
|
|
#else
|
|
|
|
typedef long uiolen;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*units*/
|
|
|
|
typedef struct
|
|
|
|
{ FILE *ufd; /*0=unconnected*/
|
|
|
|
char *ufnm;
|
|
|
|
#if !(defined (MSDOS) && !defined (GO32))
|
|
|
|
long uinode;
|
|
|
|
int udev;
|
|
|
|
#endif
|
2001-07-10 22:39:40 +02:00
|
|
|
int url; /*0=sequential*/
|
1998-02-01 02:37:08 +01:00
|
|
|
flag useek; /*true=can backspace, use dir, ...*/
|
|
|
|
flag ufmt;
|
1998-05-19 12:52:03 +02:00
|
|
|
flag urw; /* (1 for can read) | (2 for can write) */
|
1998-02-01 02:37:08 +01:00
|
|
|
flag ublnk;
|
|
|
|
flag uend;
|
|
|
|
flag uwrt; /*last io was write*/
|
|
|
|
flag uscrtch;
|
|
|
|
} unit;
|
|
|
|
|
|
|
|
extern int f__init;
|
|
|
|
extern cilist *f__elist; /*active external io list*/
|
|
|
|
extern flag f__reading,f__external,f__sequential,f__formatted;
|
1998-05-19 12:52:03 +02:00
|
|
|
extern int (*f__getn)(void); /* for formatted input */
|
|
|
|
extern void (*f__putn)(int); /* for formatted output */
|
|
|
|
extern void x_putc(int);
|
1998-02-01 02:37:08 +01:00
|
|
|
extern long f__inode(char*,int*);
|
|
|
|
extern void sig_die(char*,int);
|
|
|
|
extern void f__fatal(int,char*);
|
|
|
|
extern int t_runc(alist*);
|
|
|
|
extern int f__nowreading(unit*), f__nowwriting(unit*);
|
|
|
|
extern int fk_open(int,int,ftnint);
|
|
|
|
extern int en_fio(void);
|
|
|
|
extern void f_init(void);
|
|
|
|
extern int (*f__donewrec)(void), t_putc(int), x_wSL(void);
|
|
|
|
extern void b_char(char*,char*,ftnlen), g_char(char*,ftnlen,char*);
|
|
|
|
extern int c_sfe(cilist*), z_rnew(void);
|
|
|
|
extern int isatty(int);
|
|
|
|
extern int err__fl(int,int,char*);
|
|
|
|
extern int xrd_SL(void);
|
1998-05-19 12:52:03 +02:00
|
|
|
extern int f__putbuf(int);
|
g2c.hin, [...]: Kill VOID, Void and Int.
* g2c.hin, libF77/d_cnjg.c, libF77/main.c, libF77/r_cnjg.c,
libF77/s_cat.c, libF77/s_paus.c, libF77/s_rnge.c, libF77/setarg.c,
libF77/setsig.c, libF77/signal1.h0, libI77/dfe.c, libI77/due.c,
libI77/err.c, libI77/fio.h, libI77/fmt.c, libI77/iio.c,
libI77/ilnw.c, libI77/lread.c, libI77/lwrite.c, libI77/rsfe.c,
libI77/rsli.c, libI77/rsne.c, libI77/sfe.c, libI77/sue.c,
libI77/util.c, libI77/wrtfmt.c, libI77/wsfe.c, libI77/wsle.c,
libI77/xwsne.c, libU77/date_.c: Kill VOID, Void and Int.
From-SVN: r54134
2002-06-01 03:58:10 +02:00
|
|
|
extern int (*f__doend)(void);
|
1998-02-01 02:37:08 +01:00
|
|
|
extern FILE *f__cf; /*current file*/
|
|
|
|
extern unit *f__curunit; /*current unit*/
|
|
|
|
extern unit f__units[];
|
|
|
|
#define err(f,m,s) do {if(f) {f__init &= ~2; errno= m;} else f__fatal(m,s); return(m);} while(0)
|
|
|
|
#define errfl(f,m,s) do {return err__fl((int)f,m,s);} while(0)
|
|
|
|
|
|
|
|
/*Table sizes*/
|
|
|
|
#define MXUNIT 100
|
|
|
|
|
|
|
|
extern int f__recpos; /*position in current record*/
|
|
|
|
extern int f__cursor; /* offset to move to */
|
|
|
|
extern int f__hiwater; /* so TL doesn't confuse us */
|
|
|
|
|
|
|
|
#define WRITE 1
|
|
|
|
#define READ 2
|
|
|
|
#define SEQ 3
|
|
|
|
#define DIR 4
|
|
|
|
#define FMT 5
|
|
|
|
#define UNF 6
|
|
|
|
#define EXT 7
|
|
|
|
#define INT 8
|
|
|
|
|
|
|
|
#define buf_end(x) (x->_flag & _IONBF ? x->_ptr : x->_base + BUFSIZ)
|