This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate mainline (in near desperate attempt to get Win32 to build...)
[perl5.git] / iperlsys.h
index fe03f5c..081d8b2 100644 (file)
@@ -251,8 +251,8 @@ struct IPerlStdIOInfo
 #define PerlSIO_setlinebuf(f)                                          \
        (*PL_StdIO->pSetlinebuf)(PL_StdIO, (f))
 #define PerlSIO_printf         Perl_fprintf_nocontext
-#define PerlSIO_stdoutf                *PL_StdIO->pPrintf
-#define PerlSIO_vprintf(f,fmt,a)                                       \
+#define PerlSIO_stdoutf                Perl_printf_nocontext
+#define PerlSIO_vprintf(f,fmt,a)                                               \
        (*PL_StdIO->pVprintf)(PL_StdIO, (f),(fmt),a)
 #define PerlSIO_ftell(f)                                                       \
        (*PL_StdIO->pTell)(PL_StdIO, (f))
@@ -285,7 +285,7 @@ struct IPerlStdIOInfo
 #define PerlSIO_ferror(f)              ferror(f)
 #define PerlSIO_clearerr(f)            clearerr(f)
 #define PerlSIO_fgetc(f)                       fgetc(f)
-#if PerlSIO_has_base
+#ifdef FILE_base
 #define PerlSIO_get_base(f)            FILE_base(f)
 #define PerlSIO_get_bufsiz(f)          FILE_bufsiz(f)
 #else
@@ -303,7 +303,17 @@ struct IPerlStdIOInfo
 #define PerlSIO_fputs(f,s)             fputs(s,f)
 #define PerlSIO_fflush(f)              Fflush(f)
 #define PerlSIO_fgets(s, n, fp)                fgets(s,n,fp)
-#define PerlSIO_ungetc(c,f)            ungetc(c,f)
+#if defined(VMS) && defined(__DECC)
+     /* Unusual definition of ungetc() here to accomodate fast_sv_gets()'
+      * belief that it can mix getc/ungetc with reads from stdio buffer */
+     int decc$ungetc(int __c, FILE *__stream);
+#    define PerlSIO_ungetc(c,f) ((c) == EOF ? EOF : \
+            ((*(f) && !((*(f))->_flag & _IONBF) && \
+            ((*(f))->_ptr > (*(f))->_base)) ? \
+            ((*(f))->_cnt++, *(--(*(f))->_ptr) = (c)) : decc$ungetc(c,f)))
+#else
+#  define PerlSIO_ungetc(c,f)          ungetc(c,f)
+#endif
 #define PerlSIO_fileno(f)              fileno(f)
 #define PerlSIO_fdopen(f, s)           fdopen(f,s)
 #define PerlSIO_freopen(p, m, f)       freopen(p,m,f)
@@ -594,7 +604,11 @@ typedef int                (*LPLIOOpen3)(struct IPerlLIO*, const char*, int, int);
 typedef int            (*LPLIORead)(struct IPerlLIO*, int, void*, unsigned int);
 typedef int            (*LPLIORename)(struct IPerlLIO*, const char*,
                            const char*);
+#ifdef NETWARE
+typedef int            (*LPLIOSetmode)(struct IPerlLIO*, FILE*, int);
+#else
 typedef int            (*LPLIOSetmode)(struct IPerlLIO*, int, int);
+#endif /* NETWARE */
 typedef int            (*LPLIONameStat)(struct IPerlLIO*, const char*,
                            struct stat*);
 typedef char*          (*LPLIOTmpnam)(struct IPerlLIO*, char*);
@@ -880,6 +894,8 @@ typedef int         (*LPProcKillpg)(struct IPerlProc*, int, int);
 typedef int            (*LPProcPauseProc)(struct IPerlProc*);
 typedef PerlIO*                (*LPProcPopen)(struct IPerlProc*, const char*,
                            const char*);
+typedef PerlIO*                (*LPProcPopenList)(struct IPerlProc*, const char*,
+                           IV narg, SV **args);
 typedef int            (*LPProcPclose)(struct IPerlProc*, PerlIO*);
 typedef int            (*LPProcPipe)(struct IPerlProc*, int*);
 typedef int            (*LPProcSetuid)(struct IPerlProc*, uid_t);
@@ -942,6 +958,7 @@ struct IPerlProc
     LPProcASpawn       pASpawn;
 #endif
     LPProcLastHost      pLastHost;
+    LPProcPopenList    pPopenList;
 };
 
 struct IPerlProcInfo
@@ -982,6 +999,8 @@ struct IPerlProcInfo
        (*PL_Proc->pPauseProc)(PL_Proc)
 #define PerlProc_popen(c, m)                                           \
        (*PL_Proc->pPopen)(PL_Proc, (c), (m))
+#define PerlProc_popen_list(m, n, a)                                   \
+       (*PL_Proc->pPopenList)(PL_Proc, (m), (n), (a))
 #define PerlProc_pclose(f)                                             \
        (*PL_Proc->pPclose)(PL_Proc, (f))
 #define PerlProc_pipe(fd)                                              \
@@ -1043,6 +1062,7 @@ struct IPerlProcInfo
 #define PerlProc_killpg(i, a)  killpg((i), (a))
 #define PerlProc_pause()       Pause()
 #define PerlProc_popen(c, m)   my_popen((c), (m))
+#define PerlProc_popen_list(m,n,a)     my_popen_list((m),(n),(a))
 #define PerlProc_pclose(f)     my_pclose((f))
 #define PerlProc_pipe(fd)      pipe((fd))
 #define PerlProc_setuid(u)     setuid((u))