Commit | Line | Data |
---|---|---|
760ac839 LW |
1 | #ifndef H_PERLIO |
2 | #define H_PERLIO 1 | |
3 | ||
f2d19c81 | 4 | /* Clean up (or at least document) the various possible #defines. |
5 | This section attempts to match the 5.003_03 Configure variables | |
6 | onto the 5.003_02 header file values. | |
7 | I can't figure out where USE_STDIO was supposed to be set. | |
8 | --AD | |
9 | */ | |
10 | #ifndef USE_PERLIO | |
11 | # define PERLIO_IS_STDIO | |
760ac839 | 12 | #endif |
f2d19c81 | 13 | |
14 | /* Below is the 5.003_02 stuff. */ | |
15 | #ifdef USE_STDIO | |
16 | # ifndef PERLIO_IS_STDIO | |
17 | # define PERLIO_IS_STDIO | |
18 | # endif | |
760ac839 LW |
19 | #else |
20 | extern void PerlIO_init _((void)); | |
21 | #endif | |
22 | ||
76e3520e GS |
23 | #ifdef PERL_OBJECT |
24 | ||
25 | #include "ipstdio.h" | |
26 | ||
27 | #define PerlIO_canset_cnt(f) 1 | |
f7a92b15 | 28 | #define PerlIO_has_base(f) 1 |
76e3520e | 29 | #define PerlIO_has_cntptr(f) 1 |
f7a92b15 | 30 | #define PerlIO_fast_gets(f) 1 |
76e3520e | 31 | |
f7a92b15 DL |
32 | #define PerlIO_stdin() piStdIO->Stdin() |
33 | #define PerlIO_stdout() piStdIO->Stdout() | |
34 | #define PerlIO_stderr() piStdIO->Stderr() | |
35 | #define PerlIO_open(x,y) piStdIO->Open((x),(y), ErrorNo()) | |
36 | #define PerlIO_close(f) piStdIO->Close((f), ErrorNo()) | |
37 | #define PerlIO_eof(f) piStdIO->Eof((f), ErrorNo()) | |
38 | #define PerlIO_error(f) piStdIO->Error((f), ErrorNo()) | |
39 | #define PerlIO_clearerr(f) piStdIO->Clearerr((f), ErrorNo()) | |
40 | #define PerlIO_getc(f) piStdIO->Getc((f), ErrorNo()) | |
41 | #define PerlIO_get_base(f) piStdIO->GetBase((f), ErrorNo()) | |
76e3520e | 42 | #define PerlIO_get_bufsiz(f) piStdIO->GetBufsiz((f), ErrorNo()) |
f7a92b15 DL |
43 | #define PerlIO_get_cnt(f) piStdIO->GetCnt((f), ErrorNo()) |
44 | #define PerlIO_get_ptr(f) piStdIO->GetPtr((f), ErrorNo()) | |
45 | #define PerlIO_putc(f,c) piStdIO->Putc((f),(c), ErrorNo()) | |
46 | #define PerlIO_puts(f,s) piStdIO->Puts((f),(s), ErrorNo()) | |
47 | #define PerlIO_flush(f) piStdIO->Flush((f), ErrorNo()) | |
9e6b2b00 | 48 | #define PerlIO_gets(s, n, fp) piStdIO->Gets((fp), s, n, ErrorNo()) |
f7a92b15 DL |
49 | #define PerlIO_ungetc(f,c) piStdIO->Ungetc((f),(c), ErrorNo()) |
50 | #define PerlIO_fileno(f) piStdIO->Fileno((f), ErrorNo()) | |
51 | #define PerlIO_fdopen(f, s) piStdIO->Fdopen((f),(s), ErrorNo()) | |
565764a8 | 52 | #define PerlIO_reopen(p, m, f) piStdIO->Reopen((p), (m), (f), ErrorNo()) |
76e3520e GS |
53 | #define PerlIO_read(f,buf,count) (SSize_t)piStdIO->Read((f), (buf), (count), ErrorNo()) |
54 | #define PerlIO_write(f,buf,count) piStdIO->Write((f), (buf), (count), ErrorNo()) | |
f7a92b15 | 55 | #define PerlIO_setbuf(f,b) piStdIO->SetBuf((f), (b), ErrorNo()) |
565764a8 | 56 | #define PerlIO_setvbuf(f,b,t,s) piStdIO->SetVBuf((f), (b), (t), (s), ErrorNo()) |
f7a92b15 | 57 | #define PerlIO_set_cnt(f,c) piStdIO->SetCnt((f), (c), ErrorNo()) |
76e3520e GS |
58 | #define PerlIO_set_ptrcnt(f,p,c) piStdIO->SetPtrCnt((f), (p), (c), ErrorNo()) |
59 | #define PerlIO_setlinebuf(f) piStdIO->Setlinebuf((f), ErrorNo()) | |
f7a92b15 DL |
60 | #define PerlIO_printf fprintf |
61 | #define PerlIO_stdoutf piStdIO->Printf | |
62 | #define PerlIO_vprintf(f,fmt,a) piStdIO->Vprintf((f), ErrorNo(), (fmt),a) | |
63 | #define PerlIO_tell(f) piStdIO->Tell((f), ErrorNo()) | |
64 | #define PerlIO_seek(f,o,w) piStdIO->Seek((f),(o),(w), ErrorNo()) | |
65 | #define PerlIO_getpos(f,p) piStdIO->Getpos((f),(p), ErrorNo()) | |
66 | #define PerlIO_setpos(f,p) piStdIO->Setpos((f),(p), ErrorNo()) | |
67 | #define PerlIO_rewind(f) piStdIO->Rewind((f), ErrorNo()) | |
68 | #define PerlIO_tmpfile() piStdIO->Tmpfile(ErrorNo()) | |
69 | #define PerlIO_init() piStdIO->Init(ErrorNo()) | |
76e3520e | 70 | #undef init_os_extras |
f7a92b15 | 71 | #define init_os_extras() piStdIO->InitOSExtras(this) |
76e3520e GS |
72 | |
73 | #else | |
760ac839 | 74 | #include "perlsdio.h" |
76e3520e | 75 | #endif |
760ac839 LW |
76 | |
77 | #ifndef PERLIO_IS_STDIO | |
78 | #ifdef USE_SFIO | |
79 | #include "perlsfio.h" | |
80 | #endif /* USE_SFIO */ | |
81 | #endif /* PERLIO_IS_STDIO */ | |
82 | ||
83 | #ifndef EOF | |
84 | #define EOF (-1) | |
85 | #endif | |
86 | ||
87 | /* This is to catch case with no stdio */ | |
88 | #ifndef BUFSIZ | |
89 | #define BUFSIZ 1024 | |
90 | #endif | |
91 | ||
92 | #ifndef SEEK_SET | |
93 | #define SEEK_SET 0 | |
94 | #endif | |
95 | ||
96 | #ifndef SEEK_CUR | |
97 | #define SEEK_CUR 1 | |
98 | #endif | |
99 | ||
100 | #ifndef SEEK_END | |
101 | #define SEEK_END 2 | |
102 | #endif | |
103 | ||
104 | #ifndef PerlIO | |
105 | struct _PerlIO; | |
106 | #define PerlIO struct _PerlIO | |
107 | #endif /* No PerlIO */ | |
108 | ||
109 | #ifndef Fpos_t | |
110 | #define Fpos_t long | |
111 | #endif | |
112 | ||
113 | #ifndef NEXT30_NO_ATTRIBUTE | |
114 | #ifndef HASATTRIBUTE /* disable GNU-cc attribute checking? */ | |
115 | #ifdef __attribute__ /* Avoid possible redefinition errors */ | |
116 | #undef __attribute__ | |
117 | #endif | |
118 | #define __attribute__(attr) | |
f2d19c81 | 119 | #endif |
760ac839 LW |
120 | #endif |
121 | ||
122 | #ifndef PerlIO_stdoutf | |
123 | extern int PerlIO_stdoutf _((const char *,...)) | |
124 | __attribute__((format (printf, 1, 2))); | |
125 | #endif | |
126 | #ifndef PerlIO_puts | |
127 | extern int PerlIO_puts _((PerlIO *,const char *)); | |
128 | #endif | |
129 | #ifndef PerlIO_open | |
130 | extern PerlIO * PerlIO_open _((const char *,const char *)); | |
131 | #endif | |
132 | #ifndef PerlIO_close | |
133 | extern int PerlIO_close _((PerlIO *)); | |
134 | #endif | |
135 | #ifndef PerlIO_eof | |
136 | extern int PerlIO_eof _((PerlIO *)); | |
137 | #endif | |
138 | #ifndef PerlIO_error | |
139 | extern int PerlIO_error _((PerlIO *)); | |
140 | #endif | |
141 | #ifndef PerlIO_clearerr | |
142 | extern void PerlIO_clearerr _((PerlIO *)); | |
143 | #endif | |
144 | #ifndef PerlIO_getc | |
145 | extern int PerlIO_getc _((PerlIO *)); | |
146 | #endif | |
147 | #ifndef PerlIO_putc | |
148 | extern int PerlIO_putc _((PerlIO *,int)); | |
149 | #endif | |
150 | #ifndef PerlIO_flush | |
151 | extern int PerlIO_flush _((PerlIO *)); | |
152 | #endif | |
153 | #ifndef PerlIO_ungetc | |
154 | extern int PerlIO_ungetc _((PerlIO *,int)); | |
155 | #endif | |
156 | #ifndef PerlIO_fileno | |
157 | extern int PerlIO_fileno _((PerlIO *)); | |
158 | #endif | |
159 | #ifndef PerlIO_fdopen | |
160 | extern PerlIO * PerlIO_fdopen _((int, const char *)); | |
161 | #endif | |
162 | #ifndef PerlIO_importFILE | |
163 | extern PerlIO * PerlIO_importFILE _((FILE *,int)); | |
164 | #endif | |
165 | #ifndef PerlIO_exportFILE | |
166 | extern FILE * PerlIO_exportFILE _((PerlIO *,int)); | |
167 | #endif | |
168 | #ifndef PerlIO_findFILE | |
169 | extern FILE * PerlIO_findFILE _((PerlIO *)); | |
170 | #endif | |
171 | #ifndef PerlIO_releaseFILE | |
172 | extern void PerlIO_releaseFILE _((PerlIO *,FILE *)); | |
173 | #endif | |
174 | #ifndef PerlIO_read | |
5b54f415 | 175 | extern SSize_t PerlIO_read _((PerlIO *,void *,Size_t)); |
760ac839 LW |
176 | #endif |
177 | #ifndef PerlIO_write | |
5b54f415 | 178 | extern SSize_t PerlIO_write _((PerlIO *,const void *,Size_t)); |
760ac839 LW |
179 | #endif |
180 | #ifndef PerlIO_setlinebuf | |
f2d19c81 | 181 | extern void PerlIO_setlinebuf _((PerlIO *)); |
760ac839 LW |
182 | #endif |
183 | #ifndef PerlIO_printf | |
184 | extern int PerlIO_printf _((PerlIO *, const char *,...)) | |
f2d19c81 | 185 | __attribute__((format (printf, 2, 3))); |
760ac839 LW |
186 | #endif |
187 | #ifndef PerlIO_sprintf | |
188 | extern int PerlIO_sprintf _((char *, int, const char *,...)) | |
f2d19c81 | 189 | __attribute__((format (printf, 3, 4))); |
760ac839 LW |
190 | #endif |
191 | #ifndef PerlIO_vprintf | |
f2d19c81 | 192 | extern int PerlIO_vprintf _((PerlIO *, const char *, va_list)); |
760ac839 LW |
193 | #endif |
194 | #ifndef PerlIO_tell | |
195 | extern long PerlIO_tell _((PerlIO *)); | |
196 | #endif | |
197 | #ifndef PerlIO_seek | |
198 | extern int PerlIO_seek _((PerlIO *,off_t,int)); | |
199 | #endif | |
200 | #ifndef PerlIO_rewind | |
201 | extern void PerlIO_rewind _((PerlIO *)); | |
202 | #endif | |
203 | #ifndef PerlIO_has_base | |
f2d19c81 | 204 | extern int PerlIO_has_base _((PerlIO *)); |
760ac839 LW |
205 | #endif |
206 | #ifndef PerlIO_has_cntptr | |
f2d19c81 | 207 | extern int PerlIO_has_cntptr _((PerlIO *)); |
760ac839 LW |
208 | #endif |
209 | #ifndef PerlIO_fast_gets | |
f2d19c81 | 210 | extern int PerlIO_fast_gets _((PerlIO *)); |
760ac839 LW |
211 | #endif |
212 | #ifndef PerlIO_canset_cnt | |
f2d19c81 | 213 | extern int PerlIO_canset_cnt _((PerlIO *)); |
760ac839 LW |
214 | #endif |
215 | #ifndef PerlIO_get_ptr | |
888911fc | 216 | extern STDCHAR * PerlIO_get_ptr _((PerlIO *)); |
760ac839 LW |
217 | #endif |
218 | #ifndef PerlIO_get_cnt | |
f2d19c81 | 219 | extern int PerlIO_get_cnt _((PerlIO *)); |
760ac839 LW |
220 | #endif |
221 | #ifndef PerlIO_set_cnt | |
f2d19c81 | 222 | extern void PerlIO_set_cnt _((PerlIO *,int)); |
760ac839 LW |
223 | #endif |
224 | #ifndef PerlIO_set_ptrcnt | |
888911fc | 225 | extern void PerlIO_set_ptrcnt _((PerlIO *,STDCHAR *,int)); |
760ac839 LW |
226 | #endif |
227 | #ifndef PerlIO_get_base | |
888911fc | 228 | extern STDCHAR * PerlIO_get_base _((PerlIO *)); |
760ac839 LW |
229 | #endif |
230 | #ifndef PerlIO_get_bufsiz | |
f2d19c81 | 231 | extern int PerlIO_get_bufsiz _((PerlIO *)); |
760ac839 LW |
232 | #endif |
233 | #ifndef PerlIO_tmpfile | |
234 | extern PerlIO * PerlIO_tmpfile _((void)); | |
235 | #endif | |
236 | #ifndef PerlIO_stdin | |
237 | extern PerlIO * PerlIO_stdin _((void)); | |
238 | #endif | |
239 | #ifndef PerlIO_stdout | |
240 | extern PerlIO * PerlIO_stdout _((void)); | |
241 | #endif | |
242 | #ifndef PerlIO_stderr | |
243 | extern PerlIO * PerlIO_stderr _((void)); | |
244 | #endif | |
245 | #ifndef PerlIO_getpos | |
246 | extern int PerlIO_getpos _((PerlIO *,Fpos_t *)); | |
247 | #endif | |
248 | #ifndef PerlIO_setpos | |
249 | extern int PerlIO_setpos _((PerlIO *,const Fpos_t *)); | |
f2d19c81 | 250 | #endif |
760ac839 | 251 | #endif /* Include guard */ |