Commit | Line | Data |
760ac839 |
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 |
19 | #else |
20 | extern void PerlIO_init _((void)); |
21 | #endif |
22 | |
76e3520e |
23 | #ifdef PERL_OBJECT |
24 | |
25 | #include "ipstdio.h" |
26 | |
27 | #define PerlIO_canset_cnt(f) 1 |
28 | #define PerlIO_has_base(f) 1 |
29 | #define PerlIO_has_cntptr(f) 1 |
30 | #define PerlIO_fast_gets(f) 1 |
31 | |
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()) |
42 | #define PerlIO_get_bufsiz(f) piStdIO->GetBufsiz((f), ErrorNo()) |
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()) |
48 | #define PerlIO_ungetc(f,c) piStdIO->Ungetc((f),(c), ErrorNo()) |
49 | #define PerlIO_fileno(f) piStdIO->Fileno((f), ErrorNo()) |
50 | #define PerlIO_fdopen(f, s) piStdIO->Fdopen((f),(s), ErrorNo()) |
51 | #define PerlIO_read(f,buf,count) (SSize_t)piStdIO->Read((f), (buf), (count), ErrorNo()) |
52 | #define PerlIO_write(f,buf,count) piStdIO->Write((f), (buf), (count), ErrorNo()) |
53 | #define PerlIO_set_cnt(f,c) piStdIO->SetCnt((f), (c), ErrorNo()) |
54 | #define PerlIO_set_ptrcnt(f,p,c) piStdIO->SetPtrCnt((f), (p), (c), ErrorNo()) |
55 | #define PerlIO_setlinebuf(f) piStdIO->Setlinebuf((f), ErrorNo()) |
56 | #define PerlIO_printf fprintf |
57 | #define PerlIO_stdoutf piStdIO->Printf |
58 | #define PerlIO_vprintf(f,fmt,a) piStdIO->Vprintf((f), ErrorNo(), (fmt),a) |
59 | #define PerlIO_tell(f) piStdIO->Tell((f), ErrorNo()) |
60 | #define PerlIO_seek(f,o,w) piStdIO->Seek((f),(o),(w), ErrorNo()) |
61 | #define PerlIO_getpos(f,p) piStdIO->Getpos((f),(p), ErrorNo()) |
62 | #define PerlIO_setpos(f,p) piStdIO->Setpos((f),(p), ErrorNo()) |
63 | #define PerlIO_rewind(f) piStdIO->Rewind((f), ErrorNo()) |
64 | #define PerlIO_tmpfile() piStdIO->Tmpfile(ErrorNo()) |
65 | #define PerlIO_init() piStdIO->Init(ErrorNo()) |
66 | #undef init_os_extras |
67 | #define init_os_extras() piStdIO->InitOSExtras(this) |
68 | |
69 | #else |
760ac839 |
70 | #include "perlsdio.h" |
76e3520e |
71 | #endif |
760ac839 |
72 | |
73 | #ifndef PERLIO_IS_STDIO |
74 | #ifdef USE_SFIO |
75 | #include "perlsfio.h" |
76 | #endif /* USE_SFIO */ |
77 | #endif /* PERLIO_IS_STDIO */ |
78 | |
79 | #ifndef EOF |
80 | #define EOF (-1) |
81 | #endif |
82 | |
83 | /* This is to catch case with no stdio */ |
84 | #ifndef BUFSIZ |
85 | #define BUFSIZ 1024 |
86 | #endif |
87 | |
88 | #ifndef SEEK_SET |
89 | #define SEEK_SET 0 |
90 | #endif |
91 | |
92 | #ifndef SEEK_CUR |
93 | #define SEEK_CUR 1 |
94 | #endif |
95 | |
96 | #ifndef SEEK_END |
97 | #define SEEK_END 2 |
98 | #endif |
99 | |
100 | #ifndef PerlIO |
101 | struct _PerlIO; |
102 | #define PerlIO struct _PerlIO |
103 | #endif /* No PerlIO */ |
104 | |
105 | #ifndef Fpos_t |
106 | #define Fpos_t long |
107 | #endif |
108 | |
109 | #ifndef NEXT30_NO_ATTRIBUTE |
110 | #ifndef HASATTRIBUTE /* disable GNU-cc attribute checking? */ |
111 | #ifdef __attribute__ /* Avoid possible redefinition errors */ |
112 | #undef __attribute__ |
113 | #endif |
114 | #define __attribute__(attr) |
f2d19c81 |
115 | #endif |
760ac839 |
116 | #endif |
117 | |
118 | #ifndef PerlIO_stdoutf |
119 | extern int PerlIO_stdoutf _((const char *,...)) |
120 | __attribute__((format (printf, 1, 2))); |
121 | #endif |
122 | #ifndef PerlIO_puts |
123 | extern int PerlIO_puts _((PerlIO *,const char *)); |
124 | #endif |
125 | #ifndef PerlIO_open |
126 | extern PerlIO * PerlIO_open _((const char *,const char *)); |
127 | #endif |
128 | #ifndef PerlIO_close |
129 | extern int PerlIO_close _((PerlIO *)); |
130 | #endif |
131 | #ifndef PerlIO_eof |
132 | extern int PerlIO_eof _((PerlIO *)); |
133 | #endif |
134 | #ifndef PerlIO_error |
135 | extern int PerlIO_error _((PerlIO *)); |
136 | #endif |
137 | #ifndef PerlIO_clearerr |
138 | extern void PerlIO_clearerr _((PerlIO *)); |
139 | #endif |
140 | #ifndef PerlIO_getc |
141 | extern int PerlIO_getc _((PerlIO *)); |
142 | #endif |
143 | #ifndef PerlIO_putc |
144 | extern int PerlIO_putc _((PerlIO *,int)); |
145 | #endif |
146 | #ifndef PerlIO_flush |
147 | extern int PerlIO_flush _((PerlIO *)); |
148 | #endif |
149 | #ifndef PerlIO_ungetc |
150 | extern int PerlIO_ungetc _((PerlIO *,int)); |
151 | #endif |
152 | #ifndef PerlIO_fileno |
153 | extern int PerlIO_fileno _((PerlIO *)); |
154 | #endif |
155 | #ifndef PerlIO_fdopen |
156 | extern PerlIO * PerlIO_fdopen _((int, const char *)); |
157 | #endif |
158 | #ifndef PerlIO_importFILE |
159 | extern PerlIO * PerlIO_importFILE _((FILE *,int)); |
160 | #endif |
161 | #ifndef PerlIO_exportFILE |
162 | extern FILE * PerlIO_exportFILE _((PerlIO *,int)); |
163 | #endif |
164 | #ifndef PerlIO_findFILE |
165 | extern FILE * PerlIO_findFILE _((PerlIO *)); |
166 | #endif |
167 | #ifndef PerlIO_releaseFILE |
168 | extern void PerlIO_releaseFILE _((PerlIO *,FILE *)); |
169 | #endif |
170 | #ifndef PerlIO_read |
5b54f415 |
171 | extern SSize_t PerlIO_read _((PerlIO *,void *,Size_t)); |
760ac839 |
172 | #endif |
173 | #ifndef PerlIO_write |
5b54f415 |
174 | extern SSize_t PerlIO_write _((PerlIO *,const void *,Size_t)); |
760ac839 |
175 | #endif |
176 | #ifndef PerlIO_setlinebuf |
f2d19c81 |
177 | extern void PerlIO_setlinebuf _((PerlIO *)); |
760ac839 |
178 | #endif |
179 | #ifndef PerlIO_printf |
180 | extern int PerlIO_printf _((PerlIO *, const char *,...)) |
f2d19c81 |
181 | __attribute__((format (printf, 2, 3))); |
760ac839 |
182 | #endif |
183 | #ifndef PerlIO_sprintf |
184 | extern int PerlIO_sprintf _((char *, int, const char *,...)) |
f2d19c81 |
185 | __attribute__((format (printf, 3, 4))); |
760ac839 |
186 | #endif |
187 | #ifndef PerlIO_vprintf |
f2d19c81 |
188 | extern int PerlIO_vprintf _((PerlIO *, const char *, va_list)); |
760ac839 |
189 | #endif |
190 | #ifndef PerlIO_tell |
191 | extern long PerlIO_tell _((PerlIO *)); |
192 | #endif |
193 | #ifndef PerlIO_seek |
194 | extern int PerlIO_seek _((PerlIO *,off_t,int)); |
195 | #endif |
196 | #ifndef PerlIO_rewind |
197 | extern void PerlIO_rewind _((PerlIO *)); |
198 | #endif |
199 | #ifndef PerlIO_has_base |
f2d19c81 |
200 | extern int PerlIO_has_base _((PerlIO *)); |
760ac839 |
201 | #endif |
202 | #ifndef PerlIO_has_cntptr |
f2d19c81 |
203 | extern int PerlIO_has_cntptr _((PerlIO *)); |
760ac839 |
204 | #endif |
205 | #ifndef PerlIO_fast_gets |
f2d19c81 |
206 | extern int PerlIO_fast_gets _((PerlIO *)); |
760ac839 |
207 | #endif |
208 | #ifndef PerlIO_canset_cnt |
f2d19c81 |
209 | extern int PerlIO_canset_cnt _((PerlIO *)); |
760ac839 |
210 | #endif |
211 | #ifndef PerlIO_get_ptr |
888911fc |
212 | extern STDCHAR * PerlIO_get_ptr _((PerlIO *)); |
760ac839 |
213 | #endif |
214 | #ifndef PerlIO_get_cnt |
f2d19c81 |
215 | extern int PerlIO_get_cnt _((PerlIO *)); |
760ac839 |
216 | #endif |
217 | #ifndef PerlIO_set_cnt |
f2d19c81 |
218 | extern void PerlIO_set_cnt _((PerlIO *,int)); |
760ac839 |
219 | #endif |
220 | #ifndef PerlIO_set_ptrcnt |
888911fc |
221 | extern void PerlIO_set_ptrcnt _((PerlIO *,STDCHAR *,int)); |
760ac839 |
222 | #endif |
223 | #ifndef PerlIO_get_base |
888911fc |
224 | extern STDCHAR * PerlIO_get_base _((PerlIO *)); |
760ac839 |
225 | #endif |
226 | #ifndef PerlIO_get_bufsiz |
f2d19c81 |
227 | extern int PerlIO_get_bufsiz _((PerlIO *)); |
760ac839 |
228 | #endif |
229 | #ifndef PerlIO_tmpfile |
230 | extern PerlIO * PerlIO_tmpfile _((void)); |
231 | #endif |
232 | #ifndef PerlIO_stdin |
233 | extern PerlIO * PerlIO_stdin _((void)); |
234 | #endif |
235 | #ifndef PerlIO_stdout |
236 | extern PerlIO * PerlIO_stdout _((void)); |
237 | #endif |
238 | #ifndef PerlIO_stderr |
239 | extern PerlIO * PerlIO_stderr _((void)); |
240 | #endif |
241 | #ifndef PerlIO_getpos |
242 | extern int PerlIO_getpos _((PerlIO *,Fpos_t *)); |
243 | #endif |
244 | #ifndef PerlIO_setpos |
245 | extern int PerlIO_setpos _((PerlIO *,const Fpos_t *)); |
f2d19c81 |
246 | #endif |
760ac839 |
247 | #endif /* Include guard */ |