This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Various updates and fixes to some of the SysV IPC ops and their tests
[perl5.git] / perlio.h
index 8e700fe..836ff6f 100644 (file)
--- a/perlio.h
+++ b/perlio.h
@@ -8,46 +8,28 @@
  *
  */
 
-#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 */
@@ -86,15 +63,8 @@ typedef PerlIOl *PerlIO;
 #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
 #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,
@@ -111,27 +81,24 @@ 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
@@ -154,7 +121,6 @@ PERL_CALLCONV void PerlIO_clone(pTHX_ PerlInterpreter *proto,
  */
 #include "fakesdio.h"
 #endif                         /* ifndef PERLIO_NOT_STDIO */
-#endif                         /* PERLIO_IS_STDIO */
 
 /* ----------- fill in things that have not got #define'd  ---------- */
 
@@ -313,6 +279,9 @@ PERL_CALLCONV SSize_t PerlIO_get_bufsiz(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
@@ -331,7 +300,7 @@ PERL_CALLCONV int PerlIO_setpos(PerlIO *, SV *);
 #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
@@ -360,11 +329,10 @@ PERL_CALLCONV void PerlIO_debug(const char *fmt, ...)
     __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: