*
*/
-#ifndef _PERLIO_H
-#define _PERLIO_H
+#ifndef PERLIO_H_
+#define PERLIO_H_
/*
Interface for perl to IO functions.
There is a hierarchy of Configure determined #define controls:
- USE_STDIO - forces PerlIO_xxx() to be #define-d onto stdio functions.
- This is used for conservative
- builds - "just like perl5.00X used to be".
- This dominates over the others.
+ USE_STDIO - No longer available via Configure. Formerly forced
+ PerlIO_xxx() to be #define-d onto stdio functions.
+ Now generates compile-time error.
USE_PERLIO - The primary Configure variable that enables PerlIO.
- If USE_PERLIO is _NOT_ set
- then USE_STDIO above will be set to be conservative.
PerlIO_xxx() are real functions
defined in perlio.c which implement extra functionality
required for utf8 support.
- One further note - the table-of-functions scheme controlled
- by PERL_IMPLICIT_SYS turns on USE_PERLIO so that iperlsys.h can
- #define PerlIO_xxx() to go via the function table, without having
- to #undef them from (say) stdio forms.
-
*/
-#if defined(PERL_IMPLICIT_SYS)
-#ifndef USE_PERLIO
-#ifndef NETWARE
-/* # define USE_PERLIO */
-#endif
-#endif
-#endif
-
#ifndef USE_PERLIO
# define USE_STDIO
#endif
#ifdef USE_STDIO
-# ifndef PERLIO_IS_STDIO
-# define PERLIO_IS_STDIO
-# endif
+# error "stdio is no longer supported as the default base layer -- use perlio."
#endif
/* -------------------- End of Configure controls ---------------------------- */
#undef O_BINARY
#endif
-#ifdef PERLIO_IS_STDIO
-/* #define PerlIO_xxxx() as equivalent stdio function */
-#include "perlsdio.h"
-#endif /* PERLIO_IS_STDIO */
-
#ifndef PerlIO
/* ----------- PerlIO implementation ---------- */
/* PerlIO not #define-d to something else - define the implementation */
#define PerlIO PerlIO
#define PERLIO_LAYERS 1
-/* PERLIO_FUNCS_CONST is now on by default for efficiency, PERLIO_FUNCS_CONST
- can be removed 1 day once stable & then PerlIO vtables are permanently RO */
-#ifdef PERLIO_FUNCS_CONST
+/*
+=for apidoc_section $io
+=for apidoc Amu||PERLIO_FUNCS_DECL|PerlIO * ftab
+Declare C<ftab> to be a PerlIO function table, that is, of type
+C<PerlIO_funcs>.
+
+=for apidoc Ay|PerlIO_funcs *|PERLIO_FUNCS_CAST|PerlIO * func
+Cast the pointer C<func> to be of type S<C<PerlIO_funcs *>>.
+
+=cut
+*/
#define PERLIO_FUNCS_DECL(funcs) const PerlIO_funcs funcs
#define PERLIO_FUNCS_CAST(funcs) (PerlIO_funcs*)(funcs)
-#else
-#define PERLIO_FUNCS_DECL(funcs) PerlIO_funcs funcs
-#define PERLIO_FUNCS_CAST(funcs) (funcs)
-#endif
PERL_CALLCONV void PerlIO_define_layer(pTHX_ PerlIO_funcs *tab);
PERL_CALLCONV PerlIO_funcs *PerlIO_find_layer(pTHX_ const char *name,
STRLEN len,
- int load);
+ int load);
PERL_CALLCONV PerlIO *PerlIO_push(pTHX_ PerlIO *f, PERLIO_FUNCS_DECL(*tab),
- const char *mode, SV *arg);
+ const char *mode, SV *arg);
PERL_CALLCONV void PerlIO_pop(pTHX_ PerlIO *f);
PERL_CALLCONV AV* PerlIO_get_layers(pTHX_ PerlIO *f);
PERL_CALLCONV void PerlIO_clone(pTHX_ PerlInterpreter *proto,
/* ----------- End of implementation choices ---------- */
-#ifndef PERLIO_IS_STDIO
-/* Not using stdio _directly_ as PerlIO */
-
/* We now need to determine what happens if source trys to use stdio.
* There are three cases based on PERLIO_NOT_STDIO which XS code
* can set how it wants.
*/
-# ifdef PERL_CORE
+#ifdef PERL_CORE
/* Make a choice for perl core code
- currently this is set to try and catch lingering raw stdio calls.
This is a known issue with some non UNIX ports which still use
"native" stdio features.
*/
-# ifndef PERLIO_NOT_STDIO
-# define PERLIO_NOT_STDIO 1
-# endif
- #else
-# ifndef PERLIO_NOT_STDIO
-# define PERLIO_NOT_STDIO 0
-# endif
+# ifndef PERLIO_NOT_STDIO
+# define PERLIO_NOT_STDIO 1
+# endif
+#else
+# ifndef PERLIO_NOT_STDIO
+# define PERLIO_NOT_STDIO 0
+# endif
#endif
#ifdef PERLIO_NOT_STDIO
*/
#include "fakesdio.h"
#endif /* ifndef PERLIO_NOT_STDIO */
-#endif /* PERLIO_IS_STDIO */
/* ----------- fill in things that have not got #define'd ---------- */
#endif
#ifndef PerlIO_openn
PERL_CALLCONV PerlIO *PerlIO_openn(pTHX_ const char *layers, const char *mode,
- int fd, int imode, int perm, PerlIO *old,
- int narg, SV **arg);
+ int fd, int imode, int perm, PerlIO *old,
+ int narg, SV **arg);
#endif
#ifndef PerlIO_eof
PERL_CALLCONV int PerlIO_eof(PerlIO *);
#ifndef PerlIO_tmpfile
PERL_CALLCONV PerlIO *PerlIO_tmpfile(void);
#endif
+#ifndef PerlIO_tmpfile_flags
+PERL_CALLCONV PerlIO *PerlIO_tmpfile_flags(int flags);
+#endif
#ifndef PerlIO_stdin
PERL_CALLCONV PerlIO *PerlIO_stdin(void);
#endif
#ifndef PerlIO_fdupopen
PERL_CALLCONV PerlIO *PerlIO_fdupopen(pTHX_ PerlIO *, CLONE_PARAMS *, int);
#endif
-#if !defined(PerlIO_modestr) && !defined(PERLIO_IS_STDIO)
+#if !defined(PerlIO_modestr)
PERL_CALLCONV char *PerlIO_modestr(PerlIO *, char *buf);
#endif
#ifndef PerlIO_isutf8
#endif
#ifndef PerlIO_apply_layers
PERL_CALLCONV int PerlIO_apply_layers(pTHX_ PerlIO *f, const char *mode,
- const char *names);
+ const char *names);
#endif
#ifndef PerlIO_binmode
PERL_CALLCONV int PerlIO_binmode(pTHX_ PerlIO *f, int iotype, int omode,
- const char *names);
+ const char *names);
#endif
#ifndef PerlIO_getname
PERL_CALLCONV char *PerlIO_getname(PerlIO *, char *);
__attribute__format__(__printf__, 1, 2);
typedef struct PerlIO_list_s PerlIO_list_t;
-
#endif
END_EXTERN_C
-#endif /* _PERLIO_H */
+#endif /* PERLIO_H_ */
/*
* ex: set ts=8 sts=4 sw=4 et: