xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/perlio.h (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*    perlio.h
2*0Sstevel@tonic-gate  *
3*0Sstevel@tonic-gate  *    Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003,
4*0Sstevel@tonic-gate  *    by Larry Wall and others
5*0Sstevel@tonic-gate  *
6*0Sstevel@tonic-gate  *    You may distribute under the terms of either the GNU General Public
7*0Sstevel@tonic-gate  *    License or the Artistic License, as specified in the README file.
8*0Sstevel@tonic-gate  *
9*0Sstevel@tonic-gate  */
10*0Sstevel@tonic-gate 
11*0Sstevel@tonic-gate #ifndef _PERLIO_H
12*0Sstevel@tonic-gate #define _PERLIO_H
13*0Sstevel@tonic-gate /*
14*0Sstevel@tonic-gate   Interface for perl to IO functions.
15*0Sstevel@tonic-gate   There is a hierachy of Configure determined #define controls:
16*0Sstevel@tonic-gate    USE_STDIO   - forces PerlIO_xxx() to be #define-d onto stdio functions.
17*0Sstevel@tonic-gate                  This is used for x2p subdirectory and for conservative
18*0Sstevel@tonic-gate                  builds - "just like perl5.00X used to be".
19*0Sstevel@tonic-gate                  This dominates over the others.
20*0Sstevel@tonic-gate 
21*0Sstevel@tonic-gate    USE_PERLIO  - The primary Configure variable that enables PerlIO.
22*0Sstevel@tonic-gate                  If USE_PERLIO is _NOT_ set
23*0Sstevel@tonic-gate                    then USE_STDIO above will be set to be conservative.
24*0Sstevel@tonic-gate                  If USE_PERLIO is set
25*0Sstevel@tonic-gate                    then there are two modes determined by USE_SFIO:
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate    USE_SFIO    - If set causes PerlIO_xxx() to be #define-d onto sfio functions.
28*0Sstevel@tonic-gate                  A backward compatability mode for some specialist applications.
29*0Sstevel@tonic-gate 
30*0Sstevel@tonic-gate                  If USE_SFIO is not set then PerlIO_xxx() are real functions
31*0Sstevel@tonic-gate                  defined in perlio.c which implement extra functionality
32*0Sstevel@tonic-gate                  required for utf8 support.
33*0Sstevel@tonic-gate 
34*0Sstevel@tonic-gate    One further note - the table-of-functions scheme controlled
35*0Sstevel@tonic-gate    by PERL_IMPLICIT_SYS turns on USE_PERLIO so that iperlsys.h can
36*0Sstevel@tonic-gate    #define PerlIO_xxx() to go via the function table, without having
37*0Sstevel@tonic-gate    to #undef them from (say) stdio forms.
38*0Sstevel@tonic-gate 
39*0Sstevel@tonic-gate */
40*0Sstevel@tonic-gate 
41*0Sstevel@tonic-gate #if defined(PERL_IMPLICIT_SYS)
42*0Sstevel@tonic-gate #ifndef USE_PERLIO
43*0Sstevel@tonic-gate #ifndef NETWARE
44*0Sstevel@tonic-gate /* # define USE_PERLIO */
45*0Sstevel@tonic-gate #endif
46*0Sstevel@tonic-gate #endif
47*0Sstevel@tonic-gate #endif
48*0Sstevel@tonic-gate 
49*0Sstevel@tonic-gate #ifndef USE_PERLIO
50*0Sstevel@tonic-gate # define USE_STDIO
51*0Sstevel@tonic-gate #endif
52*0Sstevel@tonic-gate 
53*0Sstevel@tonic-gate #ifdef USE_STDIO
54*0Sstevel@tonic-gate #  ifndef PERLIO_IS_STDIO
55*0Sstevel@tonic-gate #      define PERLIO_IS_STDIO
56*0Sstevel@tonic-gate #  endif
57*0Sstevel@tonic-gate #endif
58*0Sstevel@tonic-gate 
59*0Sstevel@tonic-gate /* --------------------  End of Configure controls ---------------------------- */
60*0Sstevel@tonic-gate 
61*0Sstevel@tonic-gate /*
62*0Sstevel@tonic-gate  * Although we may not want stdio to be used including <stdio.h> here
63*0Sstevel@tonic-gate  * avoids issues where stdio.h has strange side effects
64*0Sstevel@tonic-gate  */
65*0Sstevel@tonic-gate #include <stdio.h>
66*0Sstevel@tonic-gate 
67*0Sstevel@tonic-gate #ifdef __BEOS__
68*0Sstevel@tonic-gate int fseeko(FILE *stream, off_t offset, int whence);
69*0Sstevel@tonic-gate off_t ftello(FILE *stream);
70*0Sstevel@tonic-gate #endif
71*0Sstevel@tonic-gate 
72*0Sstevel@tonic-gate #if defined(USE_64_BIT_STDIO) && defined(HAS_FTELLO) && !defined(USE_FTELL64)
73*0Sstevel@tonic-gate #define ftell ftello
74*0Sstevel@tonic-gate #endif
75*0Sstevel@tonic-gate 
76*0Sstevel@tonic-gate #if defined(USE_64_BIT_STDIO) && defined(HAS_FSEEKO) && !defined(USE_FSEEK64)
77*0Sstevel@tonic-gate #define fseek fseeko
78*0Sstevel@tonic-gate #endif
79*0Sstevel@tonic-gate 
80*0Sstevel@tonic-gate /* BS2000 includes are sometimes a bit non standard :-( */
81*0Sstevel@tonic-gate #if defined(POSIX_BC) && defined(O_BINARY) && !defined(O_TEXT)
82*0Sstevel@tonic-gate #undef O_BINARY
83*0Sstevel@tonic-gate #endif
84*0Sstevel@tonic-gate 
85*0Sstevel@tonic-gate #ifdef PERLIO_IS_STDIO
86*0Sstevel@tonic-gate /* #define PerlIO_xxxx() as equivalent stdio function */
87*0Sstevel@tonic-gate #include "perlsdio.h"
88*0Sstevel@tonic-gate #else				/* PERLIO_IS_STDIO */
89*0Sstevel@tonic-gate #ifdef USE_SFIO
90*0Sstevel@tonic-gate /* #define PerlIO_xxxx() as equivalent sfio function */
91*0Sstevel@tonic-gate #include "perlsfio.h"
92*0Sstevel@tonic-gate #endif				/* USE_SFIO */
93*0Sstevel@tonic-gate #endif				/* PERLIO_IS_STDIO */
94*0Sstevel@tonic-gate 
95*0Sstevel@tonic-gate #ifndef PerlIO
96*0Sstevel@tonic-gate /* ----------- PerlIO implementation ---------- */
97*0Sstevel@tonic-gate /* PerlIO not #define-d to something else - define the implementation */
98*0Sstevel@tonic-gate 
99*0Sstevel@tonic-gate typedef struct _PerlIO PerlIOl;
100*0Sstevel@tonic-gate typedef struct _PerlIO_funcs PerlIO_funcs;
101*0Sstevel@tonic-gate typedef PerlIOl *PerlIO;
102*0Sstevel@tonic-gate #define PerlIO PerlIO
103*0Sstevel@tonic-gate #define PERLIO_LAYERS 1
104*0Sstevel@tonic-gate 
105*0Sstevel@tonic-gate extern void PerlIO_define_layer(pTHX_ PerlIO_funcs *tab);
106*0Sstevel@tonic-gate extern PerlIO_funcs *PerlIO_find_layer(pTHX_ const char *name, STRLEN len,
107*0Sstevel@tonic-gate 				       int load);
108*0Sstevel@tonic-gate extern PerlIO *PerlIO_push(pTHX_ PerlIO *f, PerlIO_funcs *tab,
109*0Sstevel@tonic-gate 			   const char *mode, SV *arg);
110*0Sstevel@tonic-gate extern void PerlIO_pop(pTHX_ PerlIO *f);
111*0Sstevel@tonic-gate extern AV* PerlIO_get_layers(pTHX_ PerlIO *f);
112*0Sstevel@tonic-gate extern void PerlIO_clone(pTHX_ PerlInterpreter *proto, CLONE_PARAMS *param);
113*0Sstevel@tonic-gate 
114*0Sstevel@tonic-gate #endif				/* PerlIO */
115*0Sstevel@tonic-gate 
116*0Sstevel@tonic-gate /* ----------- End of implementation choices  ---------- */
117*0Sstevel@tonic-gate 
118*0Sstevel@tonic-gate #ifndef PERLIO_IS_STDIO
119*0Sstevel@tonic-gate /* Not using stdio _directly_ as PerlIO */
120*0Sstevel@tonic-gate 
121*0Sstevel@tonic-gate /* We now need to determine  what happens if source trys to use stdio.
122*0Sstevel@tonic-gate  * There are three cases based on PERLIO_NOT_STDIO which XS code
123*0Sstevel@tonic-gate  * can set how it wants.
124*0Sstevel@tonic-gate  */
125*0Sstevel@tonic-gate 
126*0Sstevel@tonic-gate #ifdef PERL_CORE
127*0Sstevel@tonic-gate /* Make a choice for perl core code
128*0Sstevel@tonic-gate    - currently this is set to try and catch lingering raw stdio calls.
129*0Sstevel@tonic-gate      This is a known issue with some non UNIX ports which still use
130*0Sstevel@tonic-gate      "native" stdio features.
131*0Sstevel@tonic-gate */
132*0Sstevel@tonic-gate #ifndef PERLIO_NOT_STDIO
133*0Sstevel@tonic-gate #define PERLIO_NOT_STDIO 1
134*0Sstevel@tonic-gate #endif
135*0Sstevel@tonic-gate #else
136*0Sstevel@tonic-gate #ifndef PERLIO_NOT_STDIO
137*0Sstevel@tonic-gate #define PERLIO_NOT_STDIO 0
138*0Sstevel@tonic-gate #endif
139*0Sstevel@tonic-gate #endif
140*0Sstevel@tonic-gate 
141*0Sstevel@tonic-gate #ifdef PERLIO_NOT_STDIO
142*0Sstevel@tonic-gate #if PERLIO_NOT_STDIO
143*0Sstevel@tonic-gate /*
144*0Sstevel@tonic-gate  * PERLIO_NOT_STDIO #define'd as 1
145*0Sstevel@tonic-gate  * Case 1: Strong denial of stdio - make all stdio calls (we can think of) errors
146*0Sstevel@tonic-gate  */
147*0Sstevel@tonic-gate #include "nostdio.h"
148*0Sstevel@tonic-gate #else				/* if PERLIO_NOT_STDIO */
149*0Sstevel@tonic-gate /*
150*0Sstevel@tonic-gate  * PERLIO_NOT_STDIO #define'd as 0
151*0Sstevel@tonic-gate  * Case 2: Declares that both PerlIO and stdio can be used
152*0Sstevel@tonic-gate  */
153*0Sstevel@tonic-gate #endif				/* if PERLIO_NOT_STDIO */
154*0Sstevel@tonic-gate #else				/* ifdef PERLIO_NOT_STDIO */
155*0Sstevel@tonic-gate /*
156*0Sstevel@tonic-gate  * PERLIO_NOT_STDIO not defined
157*0Sstevel@tonic-gate  * Case 3: Try and fake stdio calls as PerlIO calls
158*0Sstevel@tonic-gate  */
159*0Sstevel@tonic-gate #include "fakesdio.h"
160*0Sstevel@tonic-gate #endif				/* ifndef PERLIO_NOT_STDIO */
161*0Sstevel@tonic-gate #endif				/* PERLIO_IS_STDIO */
162*0Sstevel@tonic-gate 
163*0Sstevel@tonic-gate #define specialCopIO(sv) ((sv) == Nullsv)
164*0Sstevel@tonic-gate 
165*0Sstevel@tonic-gate /* ----------- fill in things that have not got #define'd  ---------- */
166*0Sstevel@tonic-gate 
167*0Sstevel@tonic-gate #ifndef Fpos_t
168*0Sstevel@tonic-gate #define Fpos_t Off_t
169*0Sstevel@tonic-gate #endif
170*0Sstevel@tonic-gate 
171*0Sstevel@tonic-gate #ifndef EOF
172*0Sstevel@tonic-gate #define EOF (-1)
173*0Sstevel@tonic-gate #endif
174*0Sstevel@tonic-gate 
175*0Sstevel@tonic-gate /* This is to catch case with no stdio */
176*0Sstevel@tonic-gate #ifndef BUFSIZ
177*0Sstevel@tonic-gate #define BUFSIZ 1024
178*0Sstevel@tonic-gate #endif
179*0Sstevel@tonic-gate 
180*0Sstevel@tonic-gate #ifndef SEEK_SET
181*0Sstevel@tonic-gate #define SEEK_SET 0
182*0Sstevel@tonic-gate #endif
183*0Sstevel@tonic-gate 
184*0Sstevel@tonic-gate #ifndef SEEK_CUR
185*0Sstevel@tonic-gate #define SEEK_CUR 1
186*0Sstevel@tonic-gate #endif
187*0Sstevel@tonic-gate 
188*0Sstevel@tonic-gate #ifndef SEEK_END
189*0Sstevel@tonic-gate #define SEEK_END 2
190*0Sstevel@tonic-gate #endif
191*0Sstevel@tonic-gate 
192*0Sstevel@tonic-gate #define PERLIO_DUP_CLONE	1
193*0Sstevel@tonic-gate #define PERLIO_DUP_FD		2
194*0Sstevel@tonic-gate 
195*0Sstevel@tonic-gate /* --------------------- Now prototypes for functions --------------- */
196*0Sstevel@tonic-gate 
197*0Sstevel@tonic-gate START_EXTERN_C
198*0Sstevel@tonic-gate #ifndef __attribute__format__
199*0Sstevel@tonic-gate #ifdef CHECK_FORMAT
200*0Sstevel@tonic-gate #define __attribute__format__(x,y,z) __attribute__((__format__(x,y,z)))
201*0Sstevel@tonic-gate #else
202*0Sstevel@tonic-gate #define __attribute__format__(x,y,z)
203*0Sstevel@tonic-gate #endif
204*0Sstevel@tonic-gate #endif
205*0Sstevel@tonic-gate #ifndef NEXT30_NO_ATTRIBUTE
206*0Sstevel@tonic-gate #ifndef HASATTRIBUTE		/* disable GNU-cc attribute checking? */
207*0Sstevel@tonic-gate #ifdef  __attribute__		/* Avoid possible redefinition errors */
208*0Sstevel@tonic-gate #undef  __attribute__
209*0Sstevel@tonic-gate #endif
210*0Sstevel@tonic-gate #define __attribute__(attr)
211*0Sstevel@tonic-gate #endif
212*0Sstevel@tonic-gate #endif
213*0Sstevel@tonic-gate #ifndef PerlIO_init
214*0Sstevel@tonic-gate extern void PerlIO_init(pTHX);
215*0Sstevel@tonic-gate #endif
216*0Sstevel@tonic-gate #ifndef PerlIO_stdoutf
217*0Sstevel@tonic-gate extern int PerlIO_stdoutf(const char *, ...)
218*0Sstevel@tonic-gate     __attribute__format__(__printf__, 1, 2);
219*0Sstevel@tonic-gate #endif
220*0Sstevel@tonic-gate #ifndef PerlIO_puts
221*0Sstevel@tonic-gate extern int PerlIO_puts(PerlIO *, const char *);
222*0Sstevel@tonic-gate #endif
223*0Sstevel@tonic-gate #ifndef PerlIO_open
224*0Sstevel@tonic-gate extern PerlIO *PerlIO_open(const char *, const char *);
225*0Sstevel@tonic-gate #endif
226*0Sstevel@tonic-gate #ifndef PerlIO_openn
227*0Sstevel@tonic-gate extern PerlIO *PerlIO_openn(pTHX_ const char *layers, const char *mode,
228*0Sstevel@tonic-gate 			    int fd, int imode, int perm, PerlIO *old,
229*0Sstevel@tonic-gate 			    int narg, SV **arg);
230*0Sstevel@tonic-gate #endif
231*0Sstevel@tonic-gate #ifndef PerlIO_eof
232*0Sstevel@tonic-gate extern int PerlIO_eof(PerlIO *);
233*0Sstevel@tonic-gate #endif
234*0Sstevel@tonic-gate #ifndef PerlIO_error
235*0Sstevel@tonic-gate extern int PerlIO_error(PerlIO *);
236*0Sstevel@tonic-gate #endif
237*0Sstevel@tonic-gate #ifndef PerlIO_clearerr
238*0Sstevel@tonic-gate extern void PerlIO_clearerr(PerlIO *);
239*0Sstevel@tonic-gate #endif
240*0Sstevel@tonic-gate #ifndef PerlIO_getc
241*0Sstevel@tonic-gate extern int PerlIO_getc(PerlIO *);
242*0Sstevel@tonic-gate #endif
243*0Sstevel@tonic-gate #ifndef PerlIO_putc
244*0Sstevel@tonic-gate extern int PerlIO_putc(PerlIO *, int);
245*0Sstevel@tonic-gate #endif
246*0Sstevel@tonic-gate #ifndef PerlIO_ungetc
247*0Sstevel@tonic-gate extern int PerlIO_ungetc(PerlIO *, int);
248*0Sstevel@tonic-gate #endif
249*0Sstevel@tonic-gate #ifndef PerlIO_fdopen
250*0Sstevel@tonic-gate extern PerlIO *PerlIO_fdopen(int, const char *);
251*0Sstevel@tonic-gate #endif
252*0Sstevel@tonic-gate #ifndef PerlIO_importFILE
253*0Sstevel@tonic-gate extern PerlIO *PerlIO_importFILE(FILE *, const char *);
254*0Sstevel@tonic-gate #endif
255*0Sstevel@tonic-gate #ifndef PerlIO_exportFILE
256*0Sstevel@tonic-gate extern FILE *PerlIO_exportFILE(PerlIO *, const char *);
257*0Sstevel@tonic-gate #endif
258*0Sstevel@tonic-gate #ifndef PerlIO_findFILE
259*0Sstevel@tonic-gate extern FILE *PerlIO_findFILE(PerlIO *);
260*0Sstevel@tonic-gate #endif
261*0Sstevel@tonic-gate #ifndef PerlIO_releaseFILE
262*0Sstevel@tonic-gate extern void PerlIO_releaseFILE(PerlIO *, FILE *);
263*0Sstevel@tonic-gate #endif
264*0Sstevel@tonic-gate #ifndef PerlIO_read
265*0Sstevel@tonic-gate extern SSize_t PerlIO_read(PerlIO *, void *, Size_t);
266*0Sstevel@tonic-gate #endif
267*0Sstevel@tonic-gate #ifndef PerlIO_unread
268*0Sstevel@tonic-gate extern SSize_t PerlIO_unread(PerlIO *, const void *, Size_t);
269*0Sstevel@tonic-gate #endif
270*0Sstevel@tonic-gate #ifndef PerlIO_write
271*0Sstevel@tonic-gate extern SSize_t PerlIO_write(PerlIO *, const void *, Size_t);
272*0Sstevel@tonic-gate #endif
273*0Sstevel@tonic-gate #ifndef PerlIO_setlinebuf
274*0Sstevel@tonic-gate extern void PerlIO_setlinebuf(PerlIO *);
275*0Sstevel@tonic-gate #endif
276*0Sstevel@tonic-gate #ifndef PerlIO_printf
277*0Sstevel@tonic-gate extern int PerlIO_printf(PerlIO *, const char *, ...)
278*0Sstevel@tonic-gate     __attribute__format__(__printf__, 2, 3);
279*0Sstevel@tonic-gate #endif
280*0Sstevel@tonic-gate #ifndef PerlIO_sprintf
281*0Sstevel@tonic-gate extern int PerlIO_sprintf(char *, int, const char *, ...)
282*0Sstevel@tonic-gate     __attribute__format__(__printf__, 3, 4);
283*0Sstevel@tonic-gate #endif
284*0Sstevel@tonic-gate #ifndef PerlIO_vprintf
285*0Sstevel@tonic-gate extern int PerlIO_vprintf(PerlIO *, const char *, va_list);
286*0Sstevel@tonic-gate #endif
287*0Sstevel@tonic-gate #ifndef PerlIO_tell
288*0Sstevel@tonic-gate extern Off_t PerlIO_tell(PerlIO *);
289*0Sstevel@tonic-gate #endif
290*0Sstevel@tonic-gate #ifndef PerlIO_seek
291*0Sstevel@tonic-gate extern int PerlIO_seek(PerlIO *, Off_t, int);
292*0Sstevel@tonic-gate #endif
293*0Sstevel@tonic-gate #ifndef PerlIO_rewind
294*0Sstevel@tonic-gate extern void PerlIO_rewind(PerlIO *);
295*0Sstevel@tonic-gate #endif
296*0Sstevel@tonic-gate #ifndef PerlIO_has_base
297*0Sstevel@tonic-gate extern int PerlIO_has_base(PerlIO *);
298*0Sstevel@tonic-gate #endif
299*0Sstevel@tonic-gate #ifndef PerlIO_has_cntptr
300*0Sstevel@tonic-gate extern int PerlIO_has_cntptr(PerlIO *);
301*0Sstevel@tonic-gate #endif
302*0Sstevel@tonic-gate #ifndef PerlIO_fast_gets
303*0Sstevel@tonic-gate extern int PerlIO_fast_gets(PerlIO *);
304*0Sstevel@tonic-gate #endif
305*0Sstevel@tonic-gate #ifndef PerlIO_canset_cnt
306*0Sstevel@tonic-gate extern int PerlIO_canset_cnt(PerlIO *);
307*0Sstevel@tonic-gate #endif
308*0Sstevel@tonic-gate #ifndef PerlIO_get_ptr
309*0Sstevel@tonic-gate extern STDCHAR *PerlIO_get_ptr(PerlIO *);
310*0Sstevel@tonic-gate #endif
311*0Sstevel@tonic-gate #ifndef PerlIO_get_cnt
312*0Sstevel@tonic-gate extern int PerlIO_get_cnt(PerlIO *);
313*0Sstevel@tonic-gate #endif
314*0Sstevel@tonic-gate #ifndef PerlIO_set_cnt
315*0Sstevel@tonic-gate extern void PerlIO_set_cnt(PerlIO *, int);
316*0Sstevel@tonic-gate #endif
317*0Sstevel@tonic-gate #ifndef PerlIO_set_ptrcnt
318*0Sstevel@tonic-gate extern void PerlIO_set_ptrcnt(PerlIO *, STDCHAR *, int);
319*0Sstevel@tonic-gate #endif
320*0Sstevel@tonic-gate #ifndef PerlIO_get_base
321*0Sstevel@tonic-gate extern STDCHAR *PerlIO_get_base(PerlIO *);
322*0Sstevel@tonic-gate #endif
323*0Sstevel@tonic-gate #ifndef PerlIO_get_bufsiz
324*0Sstevel@tonic-gate extern int PerlIO_get_bufsiz(PerlIO *);
325*0Sstevel@tonic-gate #endif
326*0Sstevel@tonic-gate #ifndef PerlIO_tmpfile
327*0Sstevel@tonic-gate extern PerlIO *PerlIO_tmpfile(void);
328*0Sstevel@tonic-gate #endif
329*0Sstevel@tonic-gate #ifndef PerlIO_stdin
330*0Sstevel@tonic-gate extern PerlIO *PerlIO_stdin(void);
331*0Sstevel@tonic-gate #endif
332*0Sstevel@tonic-gate #ifndef PerlIO_stdout
333*0Sstevel@tonic-gate extern PerlIO *PerlIO_stdout(void);
334*0Sstevel@tonic-gate #endif
335*0Sstevel@tonic-gate #ifndef PerlIO_stderr
336*0Sstevel@tonic-gate extern PerlIO *PerlIO_stderr(void);
337*0Sstevel@tonic-gate #endif
338*0Sstevel@tonic-gate #ifndef PerlIO_getpos
339*0Sstevel@tonic-gate extern int PerlIO_getpos(PerlIO *, SV *);
340*0Sstevel@tonic-gate #endif
341*0Sstevel@tonic-gate #ifndef PerlIO_setpos
342*0Sstevel@tonic-gate extern int PerlIO_setpos(PerlIO *, SV *);
343*0Sstevel@tonic-gate #endif
344*0Sstevel@tonic-gate #ifndef PerlIO_fdupopen
345*0Sstevel@tonic-gate extern PerlIO *PerlIO_fdupopen(pTHX_ PerlIO *, CLONE_PARAMS *, int);
346*0Sstevel@tonic-gate #endif
347*0Sstevel@tonic-gate #if !defined(PerlIO_modestr) && !defined(PERLIO_IS_STDIO)
348*0Sstevel@tonic-gate extern char *PerlIO_modestr(PerlIO *, char *buf);
349*0Sstevel@tonic-gate #endif
350*0Sstevel@tonic-gate #ifndef PerlIO_isutf8
351*0Sstevel@tonic-gate extern int PerlIO_isutf8(PerlIO *);
352*0Sstevel@tonic-gate #endif
353*0Sstevel@tonic-gate #ifndef PerlIO_apply_layers
354*0Sstevel@tonic-gate extern int PerlIO_apply_layers(pTHX_ PerlIO *f, const char *mode,
355*0Sstevel@tonic-gate 			       const char *names);
356*0Sstevel@tonic-gate #endif
357*0Sstevel@tonic-gate #ifndef PerlIO_binmode
358*0Sstevel@tonic-gate extern int PerlIO_binmode(pTHX_ PerlIO *f, int iotype, int omode,
359*0Sstevel@tonic-gate 			  const char *names);
360*0Sstevel@tonic-gate #endif
361*0Sstevel@tonic-gate #ifndef PerlIO_getname
362*0Sstevel@tonic-gate extern char *PerlIO_getname(PerlIO *, char *);
363*0Sstevel@tonic-gate #endif
364*0Sstevel@tonic-gate 
365*0Sstevel@tonic-gate extern void PerlIO_destruct(pTHX);
366*0Sstevel@tonic-gate 
367*0Sstevel@tonic-gate extern int PerlIO_intmode2str(int rawmode, char *mode, int *writing);
368*0Sstevel@tonic-gate 
369*0Sstevel@tonic-gate #ifdef PERLIO_LAYERS
370*0Sstevel@tonic-gate extern void PerlIO_cleanup(pTHX);
371*0Sstevel@tonic-gate 
372*0Sstevel@tonic-gate extern void PerlIO_debug(const char *fmt, ...);
373*0Sstevel@tonic-gate typedef struct PerlIO_list_s PerlIO_list_t;
374*0Sstevel@tonic-gate 
375*0Sstevel@tonic-gate 
376*0Sstevel@tonic-gate #endif
377*0Sstevel@tonic-gate 
378*0Sstevel@tonic-gate END_EXTERN_C
379*0Sstevel@tonic-gate #endif				/* _PERLIO_H */
380