fio.h
Go to the documentation of this file.
00001 #ifndef SYSDEP_H_INCLUDED
00002 #include "sysdep1.h"
00003 #endif
00004 #include "stdio.h"
00005 #include "errno.h"
00006 #ifndef NULL
00007 /* ANSI C */
00008 #include "stddef.h"
00009 #endif
00010 
00011 #ifndef SEEK_SET
00012 #define SEEK_SET 0
00013 #define SEEK_CUR 1
00014 #define SEEK_END 2
00015 #endif
00016 
00017 #ifndef FOPEN
00018 #define FOPEN fopen
00019 #endif
00020 
00021 #ifndef FREOPEN
00022 #define FREOPEN freopen
00023 #endif
00024 
00025 #ifndef FSEEK
00026 #define FSEEK fseek
00027 #endif
00028 
00029 #ifndef FSTAT
00030 #define FSTAT fstat
00031 #endif
00032 
00033 #ifndef FTELL
00034 #define FTELL ftell
00035 #endif
00036 
00037 #ifndef OFF_T
00038 #define OFF_T long
00039 #endif
00040 
00041 #ifndef STAT_ST
00042 #define STAT_ST stat
00043 #endif
00044 
00045 #ifndef STAT
00046 #define STAT stat
00047 #endif
00048 
00049 #ifdef MSDOS
00050 #ifndef NON_UNIX_STDIO
00051 #define NON_UNIX_STDIO
00052 #endif
00053 #endif
00054 
00055 #ifdef UIOLEN_int
00056 typedef int uiolen;
00057 #else
00058 typedef long uiolen;
00059 #endif
00060 
00061 /*units*/
00062 typedef struct
00063 {       FILE *ufd;      /*0=unconnected*/
00064         char *ufnm;
00065 #ifndef MSDOS
00066         long uinode;
00067         int udev;
00068 #endif
00069         int url;        /*0=sequential*/
00070         flag useek;     /*true=can backspace, use dir, ...*/
00071         flag ufmt;
00072         flag urw;       /* (1 for can read) | (2 for can write) */
00073         flag ublnk;
00074         flag uend;
00075         flag uwrt;      /*last io was write*/
00076         flag uscrtch;
00077 } unit;
00078 
00079 #undef Void
00080 #ifdef KR_headers
00081 #define Void /*void*/
00082 extern int (*f__getn)();        /* for formatted input */
00083 extern void (*f__putn)();       /* for formatted output */
00084 extern void x_putc();
00085 extern long f__inode();
00086 extern VOID sig_die();
00087 extern int (*f__donewrec)(), t_putc(), x_wSL();
00088 extern int c_sfe(), err__fl(), xrd_SL(), f__putbuf();
00089 #else
00090 #define Void void
00091 #ifdef __cplusplus
00092 extern "C" {
00093 #endif
00094 extern int (*f__getn)(void);    /* for formatted input */
00095 extern void (*f__putn)(int);    /* for formatted output */
00096 extern void x_putc(int);
00097 extern long f__inode(char*,int*);
00098 extern void sig_die(const char*,int);
00099 extern void f__fatal(int, const char*);
00100 extern int t_runc(alist*);
00101 extern int f__nowreading(unit*), f__nowwriting(unit*);
00102 extern int fk_open(int,int,ftnint);
00103 extern int en_fio(void);
00104 extern void f_init(void);
00105 extern int (*f__donewrec)(void), t_putc(int), x_wSL(void);
00106 extern void b_char(const char*,char*,ftnlen), g_char(const char*,ftnlen,char*);
00107 extern int c_sfe(cilist*), z_rnew(void);
00108 extern int err__fl(int,int,const char*);
00109 extern int xrd_SL(void);
00110 extern int f__putbuf(int);
00111 #endif
00112 extern flag f__init;
00113 extern cilist *f__elist;        /*active external io list*/
00114 extern flag f__reading,f__external,f__sequential,f__formatted;
00115 extern int (*f__doend)(Void);
00116 extern FILE *f__cf;     /*current file*/
00117 extern unit *f__curunit;        /*current unit*/
00118 extern unit f__units[];
00119 #define err(f,m,s) {if(f) errno= m; else f__fatal(m,s); return(m);}
00120 #define errfl(f,m,s) return err__fl((int)f,m,s)
00121 
00122 /*Table sizes*/
00123 #define MXUNIT 7
00124 
00125 extern int f__recpos;   /*position in current record*/
00126 extern OFF_T f__cursor; /* offset to move to */
00127 extern OFF_T f__hiwater;        /* so TL doesn't confuse us */
00128 #ifdef __cplusplus
00129         }
00130 #endif
00131 
00132 #define WRITE   1
00133 #define READ    2
00134 #define SEQ     3
00135 #define DIR     4
00136 #define FMT     5
00137 #define UNF     6
00138 #define EXT     7
00139 #define INT     8
00140 
00141 #define buf_end(x) (x->_flag & _IONBF ? x->_ptr : x->_base + BUFSIZ)


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:50