* that can be #defined to the system-level function (or a wrapper
* provided elsewhere).
*
- * When using C++ with -DPERL_OBJECT, this definition is in the
- * form of a set of virtual base classes which must be subclassed to
- * provide a real implementation. The Perl Object will use instances
- * of this implementation to use the system-level functionality.
- *
* GSAR 21-JUN-98
*/
*
*/
-
/*
- Interface for perl stdio functions
-*/
-
-
-/* Clean up (or at least document) the various possible #defines.
- This section attempts to match the 5.003_03 Configure variables
- onto the 5.003_02 header file values.
- I can't figure out where USE_STDIO was supposed to be set.
- --AD
+ Interface for perl stdio functions, or whatever we are Configure-d
+ to use.
*/
-#ifndef USE_PERLIO
-# define PERLIO_IS_STDIO
-#endif
+#include "perlio.h"
-/* Below is the 5.003_02 stuff. */
-#ifdef USE_STDIO
-# ifndef PERLIO_IS_STDIO
-# define PERLIO_IS_STDIO
+#ifndef Sighandler_t
+# if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
+typedef Signal_t (*Sighandler_t) (int, ...);
+# else
+typedef Signal_t (*Sighandler_t) (int);
# endif
-#else
-extern void PerlIO_init (void);
#endif
#if defined(PERL_IMPLICIT_SYS)
-#ifndef PerlIO
-typedef struct _PerlIO PerlIO;
-#endif
-
/* IPerlStdIO */
struct IPerlStdIO;
-typedef PerlIO* (*LPStdin)(struct IPerlStdIO*);
-typedef PerlIO* (*LPStdout)(struct IPerlStdIO*);
-typedef PerlIO* (*LPStderr)(struct IPerlStdIO*);
-typedef PerlIO* (*LPOpen)(struct IPerlStdIO*, const char*,
+struct IPerlStdIOInfo;
+typedef FILE* (*LPStdin)(struct IPerlStdIO*);
+typedef FILE* (*LPStdout)(struct IPerlStdIO*);
+typedef FILE* (*LPStderr)(struct IPerlStdIO*);
+typedef FILE* (*LPOpen)(struct IPerlStdIO*, const char*,
const char*);
-typedef int (*LPClose)(struct IPerlStdIO*, PerlIO*);
-typedef int (*LPEof)(struct IPerlStdIO*, PerlIO*);
-typedef int (*LPError)(struct IPerlStdIO*, PerlIO*);
-typedef void (*LPClearerr)(struct IPerlStdIO*, PerlIO*);
-typedef int (*LPGetc)(struct IPerlStdIO*, PerlIO*);
-typedef char* (*LPGetBase)(struct IPerlStdIO*, PerlIO*);
-typedef int (*LPGetBufsiz)(struct IPerlStdIO*, PerlIO*);
-typedef int (*LPGetCnt)(struct IPerlStdIO*, PerlIO*);
-typedef char* (*LPGetPtr)(struct IPerlStdIO*, PerlIO*);
-typedef char* (*LPGets)(struct IPerlStdIO*, PerlIO*, char*, int);
-typedef int (*LPPutc)(struct IPerlStdIO*, PerlIO*, int);
-typedef int (*LPPuts)(struct IPerlStdIO*, PerlIO*, const char*);
-typedef int (*LPFlush)(struct IPerlStdIO*, PerlIO*);
-typedef int (*LPUngetc)(struct IPerlStdIO*, PerlIO*,int);
-typedef int (*LPFileno)(struct IPerlStdIO*, PerlIO*);
-typedef PerlIO* (*LPFdopen)(struct IPerlStdIO*, int, const char*);
-typedef PerlIO* (*LPReopen)(struct IPerlStdIO*, const char*,
- const char*, PerlIO*);
-typedef SSize_t (*LPRead)(struct IPerlStdIO*, PerlIO*, void*, Size_t);
-typedef SSize_t (*LPWrite)(struct IPerlStdIO*, PerlIO*, const void*,
+typedef int (*LPClose)(struct IPerlStdIO*, FILE*);
+typedef int (*LPEof)(struct IPerlStdIO*, FILE*);
+typedef int (*LPError)(struct IPerlStdIO*, FILE*);
+typedef void (*LPClearerr)(struct IPerlStdIO*, FILE*);
+typedef int (*LPGetc)(struct IPerlStdIO*, FILE*);
+typedef char* (*LPGetBase)(struct IPerlStdIO*, FILE*);
+typedef int (*LPGetBufsiz)(struct IPerlStdIO*, FILE*);
+typedef int (*LPGetCnt)(struct IPerlStdIO*, FILE*);
+typedef char* (*LPGetPtr)(struct IPerlStdIO*, FILE*);
+typedef char* (*LPGets)(struct IPerlStdIO*, FILE*, char*, int);
+typedef int (*LPPutc)(struct IPerlStdIO*, FILE*, int);
+typedef int (*LPPuts)(struct IPerlStdIO*, FILE*, const char*);
+typedef int (*LPFlush)(struct IPerlStdIO*, FILE*);
+typedef int (*LPUngetc)(struct IPerlStdIO*, int,FILE*);
+typedef int (*LPFileno)(struct IPerlStdIO*, FILE*);
+typedef FILE* (*LPFdopen)(struct IPerlStdIO*, int, const char*);
+typedef FILE* (*LPReopen)(struct IPerlStdIO*, const char*,
+ const char*, FILE*);
+typedef SSize_t (*LPRead)(struct IPerlStdIO*, void*, Size_t, Size_t, FILE *);
+typedef SSize_t (*LPWrite)(struct IPerlStdIO*, const void*, Size_t, Size_t, FILE *);
+typedef void (*LPSetBuf)(struct IPerlStdIO*, FILE*, char*);
+typedef int (*LPSetVBuf)(struct IPerlStdIO*, FILE*, char*, int,
Size_t);
-typedef void (*LPSetBuf)(struct IPerlStdIO*, PerlIO*, char*);
-typedef int (*LPSetVBuf)(struct IPerlStdIO*, PerlIO*, char*, int,
- Size_t);
-typedef void (*LPSetCnt)(struct IPerlStdIO*, PerlIO*, int);
-typedef void (*LPSetPtrCnt)(struct IPerlStdIO*, PerlIO*, char*,
- int);
-typedef void (*LPSetlinebuf)(struct IPerlStdIO*, PerlIO*);
-typedef int (*LPPrintf)(struct IPerlStdIO*, PerlIO*, const char*,
+typedef void (*LPSetCnt)(struct IPerlStdIO*, FILE*, int);
+
+#ifndef NETWARE
+typedef void (*LPSetPtr)(struct IPerlStdIO*, FILE*, char*);
+#elif defined(NETWARE)
+typedef void (*LPSetPtr)(struct IPerlStdIO*, FILE*, char*, int);
+#endif
+
+typedef void (*LPSetlinebuf)(struct IPerlStdIO*, FILE*);
+typedef int (*LPPrintf)(struct IPerlStdIO*, FILE*, const char*,
...);
-typedef int (*LPVprintf)(struct IPerlStdIO*, PerlIO*, const char*,
+typedef int (*LPVprintf)(struct IPerlStdIO*, FILE*, const char*,
va_list);
-typedef long (*LPTell)(struct IPerlStdIO*, PerlIO*);
-typedef int (*LPSeek)(struct IPerlStdIO*, PerlIO*, Off_t, int);
-typedef void (*LPRewind)(struct IPerlStdIO*, PerlIO*);
-typedef PerlIO* (*LPTmpfile)(struct IPerlStdIO*);
-typedef int (*LPGetpos)(struct IPerlStdIO*, PerlIO*, Fpos_t*);
-typedef int (*LPSetpos)(struct IPerlStdIO*, PerlIO*,
+typedef Off_t (*LPTell)(struct IPerlStdIO*, FILE*);
+typedef int (*LPSeek)(struct IPerlStdIO*, FILE*, Off_t, int);
+typedef void (*LPRewind)(struct IPerlStdIO*, FILE*);
+typedef FILE* (*LPTmpfile)(struct IPerlStdIO*);
+typedef int (*LPGetpos)(struct IPerlStdIO*, FILE*, Fpos_t*);
+typedef int (*LPSetpos)(struct IPerlStdIO*, FILE*,
const Fpos_t*);
typedef void (*LPInit)(struct IPerlStdIO*);
typedef void (*LPInitOSExtras)(struct IPerlStdIO*);
+typedef FILE* (*LPFdupopen)(struct IPerlStdIO*, FILE*);
struct IPerlStdIO
{
LPSetBuf pSetBuf;
LPSetVBuf pSetVBuf;
LPSetCnt pSetCnt;
- LPSetPtrCnt pSetPtrCnt;
+ LPSetPtr pSetPtr;
LPSetlinebuf pSetlinebuf;
LPPrintf pPrintf;
LPVprintf pVprintf;
LPSetpos pSetpos;
LPInit pInit;
LPInitOSExtras pInitOSExtras;
+ LPFdupopen pFdupopen;
};
struct IPerlStdIOInfo
struct IPerlStdIO perlStdIOList;
};
+/* These do not belong here ... NI-S, 14 Nov 2000 */
+
#ifdef USE_STDIO_PTR
-# define PerlIO_has_cntptr(f) 1
-# ifdef STDIO_CNT_LVALUE
-# define PerlIO_canset_cnt(f) 1
-# ifdef STDIO_PTR_LVALUE
-# define PerlIO_fast_gets(f) 1
+# define PerlSIO_has_cntptr(f) 1
+# ifdef STDIO_PTR_LVALUE
+# ifdef STDIO_CNT_LVALUE
+# define PerlSIO_canset_cnt(f) 1
+# ifdef STDIO_PTR_LVAL_NOCHANGE_CNT
+# define PerlSIO_fast_gets(f) 1
+# endif
+# else /* STDIO_CNT_LVALUE */
+# define PerlSIO_canset_cnt(f) 0
+# endif
+# else /* STDIO_PTR_LVALUE */
+# ifdef STDIO_PTR_LVAL_SETS_CNT
+# define PerlSIO_fast_gets(f) 1
# endif
-# else
-# define PerlIO_canset_cnt(f) 0
# endif
#else /* USE_STDIO_PTR */
-# define PerlIO_has_cntptr(f) 0
-# define PerlIO_canset_cnt(f) 0
+# define PerlSIO_has_cntptr(f) 0
+# define PerlSIO_canset_cnt(f) 0
#endif /* USE_STDIO_PTR */
-#ifndef PerlIO_fast_gets
-#define PerlIO_fast_gets(f) 0
+#ifndef PerlSIO_fast_gets
+#define PerlSIO_fast_gets(f) 0
#endif
#ifdef FILE_base
-#define PerlIO_has_base(f) 1
+#define PerlSIO_has_base(f) 1
#else
-#define PerlIO_has_base(f) 0
+#define PerlSIO_has_base(f) 0
#endif
-#define PerlIO_stdin() \
+/* Now take FILE * via function table */
+
+#define PerlSIO_stdin \
(*PL_StdIO->pStdin)(PL_StdIO)
-#define PerlIO_stdout() \
+#define PerlSIO_stdout \
(*PL_StdIO->pStdout)(PL_StdIO)
-#define PerlIO_stderr() \
+#define PerlSIO_stderr \
(*PL_StdIO->pStderr)(PL_StdIO)
-#define PerlIO_open(x,y) \
+#define PerlSIO_fopen(x,y) \
(*PL_StdIO->pOpen)(PL_StdIO, (x),(y))
-#define PerlIO_close(f) \
+#define PerlSIO_fclose(f) \
(*PL_StdIO->pClose)(PL_StdIO, (f))
-#define PerlIO_eof(f) \
+#define PerlSIO_feof(f) \
(*PL_StdIO->pEof)(PL_StdIO, (f))
-#define PerlIO_error(f) \
+#define PerlSIO_ferror(f) \
(*PL_StdIO->pError)(PL_StdIO, (f))
-#define PerlIO_clearerr(f) \
+#define PerlSIO_clearerr(f) \
(*PL_StdIO->pClearerr)(PL_StdIO, (f))
-#define PerlIO_getc(f) \
+#define PerlSIO_fgetc(f) \
(*PL_StdIO->pGetc)(PL_StdIO, (f))
-#define PerlIO_get_base(f) \
+#define PerlSIO_get_base(f) \
(*PL_StdIO->pGetBase)(PL_StdIO, (f))
-#define PerlIO_get_bufsiz(f) \
+#define PerlSIO_get_bufsiz(f) \
(*PL_StdIO->pGetBufsiz)(PL_StdIO, (f))
-#define PerlIO_get_cnt(f) \
+#define PerlSIO_get_cnt(f) \
(*PL_StdIO->pGetCnt)(PL_StdIO, (f))
-#define PerlIO_get_ptr(f) \
+#define PerlSIO_get_ptr(f) \
(*PL_StdIO->pGetPtr)(PL_StdIO, (f))
-#define PerlIO_putc(f,c) \
+#define PerlSIO_fputc(f,c) \
(*PL_StdIO->pPutc)(PL_StdIO, (f),(c))
-#define PerlIO_puts(f,s) \
+#define PerlSIO_fputs(f,s) \
(*PL_StdIO->pPuts)(PL_StdIO, (f),(s))
-#define PerlIO_flush(f) \
+#define PerlSIO_fflush(f) \
(*PL_StdIO->pFlush)(PL_StdIO, (f))
-#define PerlIO_gets(s, n, fp) \
+#define PerlSIO_fgets(s, n, fp) \
(*PL_StdIO->pGets)(PL_StdIO, (fp), s, n)
-#define PerlIO_ungetc(f,c) \
- (*PL_StdIO->pUngetc)(PL_StdIO, (f),(c))
-#define PerlIO_fileno(f) \
+#define PerlSIO_ungetc(c,f) \
+ (*PL_StdIO->pUngetc)(PL_StdIO, (c),(f))
+#define PerlSIO_fileno(f) \
(*PL_StdIO->pFileno)(PL_StdIO, (f))
-#define PerlIO_fdopen(f, s) \
+#define PerlSIO_fdopen(f, s) \
(*PL_StdIO->pFdopen)(PL_StdIO, (f),(s))
-#define PerlIO_reopen(p, m, f) \
+#define PerlSIO_freopen(p, m, f) \
(*PL_StdIO->pReopen)(PL_StdIO, (p), (m), (f))
-#define PerlIO_read(f,buf,count) \
- (SSize_t)(*PL_StdIO->pRead)(PL_StdIO, (f), (buf), (count))
-#define PerlIO_write(f,buf,count) \
- (*PL_StdIO->pWrite)(PL_StdIO, (f), (buf), (count))
-#define PerlIO_setbuf(f,b) \
+#define PerlSIO_fread(buf,sz,count,f) \
+ (*PL_StdIO->pRead)(PL_StdIO, (buf), (sz), (count), (f))
+#define PerlSIO_fwrite(buf,sz,count,f) \
+ (*PL_StdIO->pWrite)(PL_StdIO, (buf), (sz), (count), (f))
+#define PerlSIO_setbuf(f,b) \
(*PL_StdIO->pSetBuf)(PL_StdIO, (f), (b))
-#define PerlIO_setvbuf(f,b,t,s) \
+#define PerlSIO_setvbuf(f,b,t,s) \
(*PL_StdIO->pSetVBuf)(PL_StdIO, (f),(b),(t),(s))
-#define PerlIO_set_cnt(f,c) \
+#define PerlSIO_set_cnt(f,c) \
(*PL_StdIO->pSetCnt)(PL_StdIO, (f), (c))
-#define PerlIO_set_ptrcnt(f,p,c) \
- (*PL_StdIO->pSetPtrCnt)(PL_StdIO, (f), (p), (c))
-#define PerlIO_setlinebuf(f) \
+#define PerlSIO_set_ptr(f,p) \
+ (*PL_StdIO->pSetPtr)(PL_StdIO, (f), (p))
+#define PerlSIO_setlinebuf(f) \
(*PL_StdIO->pSetlinebuf)(PL_StdIO, (f))
-#define PerlIO_printf Perl_fprintf_nocontext
-#define PerlIO_stdoutf *PL_StdIO->pPrintf
-#define PerlIO_vprintf(f,fmt,a) \
- (*PL_StdIO->pVprintf)(PL_StdIO, (f),(fmt),a)
-#define PerlIO_tell(f) \
+#define PerlSIO_printf Perl_fprintf_nocontext
+#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))
-#define PerlIO_seek(f,o,w) \
+#define PerlSIO_fseek(f,o,w) \
(*PL_StdIO->pSeek)(PL_StdIO, (f),(o),(w))
-#define PerlIO_getpos(f,p) \
+#define PerlSIO_fgetpos(f,p) \
(*PL_StdIO->pGetpos)(PL_StdIO, (f),(p))
-#define PerlIO_setpos(f,p) \
+#define PerlSIO_fsetpos(f,p) \
(*PL_StdIO->pSetpos)(PL_StdIO, (f),(p))
-#define PerlIO_rewind(f) \
+#define PerlSIO_rewind(f) \
(*PL_StdIO->pRewind)(PL_StdIO, (f))
-#define PerlIO_tmpfile() \
+#define PerlSIO_tmpfile() \
(*PL_StdIO->pTmpfile)(PL_StdIO)
-#define PerlIO_init() \
+#define PerlSIO_init() \
(*PL_StdIO->pInit)(PL_StdIO)
#undef init_os_extras
#define init_os_extras() \
(*PL_StdIO->pInitOSExtras)(PL_StdIO)
+#define PerlSIO_fdupopen(f) \
+ (*PL_StdIO->pFdupopen)(PL_StdIO, (f))
#else /* PERL_IMPLICIT_SYS */
-#include "perlsdio.h"
-
-#endif /* PERL_IMPLICIT_SYS */
-
-#ifndef PERLIO_IS_STDIO
-#ifdef USE_SFIO
-#include "perlsfio.h"
-#endif /* USE_SFIO */
-#endif /* PERLIO_IS_STDIO */
-
-#ifndef EOF
-#define EOF (-1)
-#endif
-
-/* This is to catch case with no stdio */
-#ifndef BUFSIZ
-#define BUFSIZ 1024
-#endif
-
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#endif
-
-#ifndef SEEK_CUR
-#define SEEK_CUR 1
-#endif
-
-#ifndef SEEK_END
-#define SEEK_END 2
-#endif
-
-#ifndef PerlIO
-struct _PerlIO;
-#define PerlIO struct _PerlIO
-#endif /* No PerlIO */
-
-#ifndef Fpos_t
-#define Fpos_t long
-#endif
-
-#ifndef NEXT30_NO_ATTRIBUTE
-#ifndef HASATTRIBUTE /* disable GNU-cc attribute checking? */
-#ifdef __attribute__ /* Avoid possible redefinition errors */
-#undef __attribute__
-#endif
-#define __attribute__(attr)
-#endif
-#endif
-
-#ifndef PerlIO_stdoutf
-extern int PerlIO_stdoutf (const char *,...)
- __attribute__((format (printf, 1, 2)));
-#endif
-#ifndef PerlIO_puts
-extern int PerlIO_puts (PerlIO *,const char *);
-#endif
-#ifndef PerlIO_open
-extern PerlIO * PerlIO_open (const char *,const char *);
-#endif
-#ifndef PerlIO_close
-extern int PerlIO_close (PerlIO *);
-#endif
-#ifndef PerlIO_eof
-extern int PerlIO_eof (PerlIO *);
-#endif
-#ifndef PerlIO_error
-extern int PerlIO_error (PerlIO *);
-#endif
-#ifndef PerlIO_clearerr
-extern void PerlIO_clearerr (PerlIO *);
-#endif
-#ifndef PerlIO_getc
-extern int PerlIO_getc (PerlIO *);
-#endif
-#ifndef PerlIO_putc
-extern int PerlIO_putc (PerlIO *,int);
-#endif
-#ifndef PerlIO_flush
-extern int PerlIO_flush (PerlIO *);
-#endif
-#ifndef PerlIO_ungetc
-extern int PerlIO_ungetc (PerlIO *,int);
-#endif
-#ifndef PerlIO_fileno
-extern int PerlIO_fileno (PerlIO *);
-#endif
-#ifndef PerlIO_fdopen
-extern PerlIO * PerlIO_fdopen (int, const char *);
-#endif
-#ifndef PerlIO_importFILE
-extern PerlIO * PerlIO_importFILE (FILE *,int);
-#endif
-#ifndef PerlIO_exportFILE
-extern FILE * PerlIO_exportFILE (PerlIO *,int);
-#endif
-#ifndef PerlIO_findFILE
-extern FILE * PerlIO_findFILE (PerlIO *);
-#endif
-#ifndef PerlIO_releaseFILE
-extern void PerlIO_releaseFILE (PerlIO *,FILE *);
-#endif
-#ifndef PerlIO_read
-extern SSize_t PerlIO_read (PerlIO *,void *,Size_t);
-#endif
-#ifndef PerlIO_write
-extern SSize_t PerlIO_write (PerlIO *,const void *,Size_t);
-#endif
-#ifndef PerlIO_setlinebuf
-extern void PerlIO_setlinebuf (PerlIO *);
-#endif
-#ifndef PerlIO_printf
-extern int PerlIO_printf (PerlIO *, const char *,...)
- __attribute__((format (printf, 2, 3)));
-#endif
-#ifndef PerlIO_sprintf
-extern int PerlIO_sprintf (char *, int, const char *,...)
- __attribute__((format (printf, 3, 4)));
-#endif
-#ifndef PerlIO_vprintf
-extern int PerlIO_vprintf (PerlIO *, const char *, va_list);
-#endif
-#ifndef PerlIO_tell
-extern Off_t PerlIO_tell (PerlIO *);
-#endif
-#ifndef PerlIO_seek
-extern int PerlIO_seek (PerlIO *, Off_t, int);
-#endif
-#ifndef PerlIO_rewind
-extern void PerlIO_rewind (PerlIO *);
-#endif
-#ifndef PerlIO_has_base
-extern int PerlIO_has_base (PerlIO *);
-#endif
-#ifndef PerlIO_has_cntptr
-extern int PerlIO_has_cntptr (PerlIO *);
-#endif
-#ifndef PerlIO_fast_gets
-extern int PerlIO_fast_gets (PerlIO *);
-#endif
-#ifndef PerlIO_canset_cnt
-extern int PerlIO_canset_cnt (PerlIO *);
-#endif
-#ifndef PerlIO_get_ptr
-extern STDCHAR * PerlIO_get_ptr (PerlIO *);
-#endif
-#ifndef PerlIO_get_cnt
-extern int PerlIO_get_cnt (PerlIO *);
-#endif
-#ifndef PerlIO_set_cnt
-extern void PerlIO_set_cnt (PerlIO *,int);
-#endif
-#ifndef PerlIO_set_ptrcnt
-extern void PerlIO_set_ptrcnt (PerlIO *,STDCHAR *,int);
-#endif
-#ifndef PerlIO_get_base
-extern STDCHAR * PerlIO_get_base (PerlIO *);
-#endif
-#ifndef PerlIO_get_bufsiz
-extern int PerlIO_get_bufsiz (PerlIO *);
-#endif
-#ifndef PerlIO_tmpfile
-extern PerlIO * PerlIO_tmpfile (void);
-#endif
-#ifndef PerlIO_stdin
-extern PerlIO * PerlIO_stdin (void);
-#endif
-#ifndef PerlIO_stdout
-extern PerlIO * PerlIO_stdout (void);
-#endif
-#ifndef PerlIO_stderr
-extern PerlIO * PerlIO_stderr (void);
+#define PerlSIO_stdin stdin
+#define PerlSIO_stdout stdout
+#define PerlSIO_stderr stderr
+#define PerlSIO_fopen(x,y) fopen(x,y)
+#ifdef __VOS__
+/* Work around VOS bug posix-979, wrongly setting errno when at end of file. */
+#define PerlSIO_fclose(f) (((errno==1025)?errno=0:0),fclose(f))
+#define PerlSIO_feof(f) (((errno==1025)?errno=0:0),feof(f))
+#define PerlSIO_ferror(f) (((errno==1025)?errno=0:0),ferror(f))
+#else
+#define PerlSIO_fclose(f) fclose(f)
+#define PerlSIO_feof(f) feof(f)
+#define PerlSIO_ferror(f) ferror(f)
#endif
-#ifndef PerlIO_getpos
-extern int PerlIO_getpos (PerlIO *,Fpos_t *);
+#define PerlSIO_clearerr(f) clearerr(f)
+#define PerlSIO_fgetc(f) fgetc(f)
+#ifdef FILE_base
+#define PerlSIO_get_base(f) FILE_base(f)
+#define PerlSIO_get_bufsiz(f) FILE_bufsiz(f)
+#else
+#define PerlSIO_get_base(f) NULL
+#define PerlSIO_get_bufsiz(f) 0
#endif
-#ifndef PerlIO_setpos
-extern int PerlIO_setpos (PerlIO *,const Fpos_t *);
+#ifdef USE_STDIO_PTR
+#define PerlSIO_get_cnt(f) FILE_cnt(f)
+#define PerlSIO_get_ptr(f) FILE_ptr(f)
+#else
+#define PerlSIO_get_cnt(f) 0
+#define PerlSIO_get_ptr(f) NULL
+#endif
+#define PerlSIO_fputc(f,c) fputc(c,f)
+#define PerlSIO_fputs(f,s) fputs(s,f)
+#define PerlSIO_fflush(f) Fflush(f)
+#define PerlSIO_fgets(s, n, fp) fgets(s,n,fp)
+#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)
+#define PerlSIO_fread(buf,sz,count,f) fread(buf,sz,count,f)
+#define PerlSIO_fwrite(buf,sz,count,f) fwrite(buf,sz,count,f)
+#define PerlSIO_setbuf(f,b) setbuf(f,b)
+#define PerlSIO_setvbuf(f,b,t,s) setvbuf(f,b,t,s)
+#if defined(USE_STDIO_PTR) && defined(STDIO_CNT_LVALUE)
+#define PerlSIO_set_cnt(f,c) FILE_cnt(f) = (c)
+#else
+#define PerlSIO_set_cnt(f,c) PerlIOProc_abort()
#endif
+#if defined(USE_STDIO_PTR) && defined(STDIO_PTR_LVALUE)
+#define PerlSIO_set_ptr(f,p) FILE_ptr(f) = ((STDCHAR*)(p))
+#else
+#define PerlSIO_set_ptr(f,p) PerlIOProc_abort()
+#endif
+#define PerlSIO_setlinebuf(f) setlinebuf(f)
+#define PerlSIO_printf fprintf
+#define PerlSIO_stdoutf printf
+#define PerlSIO_vprintf(f,fmt,a) vfprintf(f,fmt,a)
+#define PerlSIO_ftell(f) ftell(f)
+#define PerlSIO_fseek(f,o,w) fseek(f,o,w)
+#define PerlSIO_fgetpos(f,p) fgetpos(f,p)
+#define PerlSIO_fsetpos(f,p) fsetpos(f,p)
+#define PerlSIO_rewind(f) rewind(f)
+#define PerlSIO_tmpfile() tmpfile()
+#define PerlSIO_fdupopen(f) (f)
+#endif /* PERL_IMPLICIT_SYS */
/*
* Interface for directory functions
/* IPerlDir */
struct IPerlDir;
+struct IPerlDirInfo;
typedef int (*LPMakedir)(struct IPerlDir*, const char*, int);
typedef int (*LPChdir)(struct IPerlDir*, const char*);
typedef int (*LPRmdir)(struct IPerlDir*, const char*);
typedef int (*LPDirClose)(struct IPerlDir*, DIR*);
-typedef DIR* (*LPDirOpen)(struct IPerlDir*, char*);
+typedef DIR* (*LPDirOpen)(struct IPerlDir*, const char*);
typedef struct direct* (*LPDirRead)(struct IPerlDir*, DIR*);
typedef void (*LPDirRewind)(struct IPerlDir*, DIR*);
typedef void (*LPDirSeek)(struct IPerlDir*, DIR*, long);
typedef long (*LPDirTell)(struct IPerlDir*, DIR*);
+#ifdef WIN32
+typedef char* (*LPDirMapPathA)(struct IPerlDir*, const char*);
+typedef WCHAR* (*LPDirMapPathW)(struct IPerlDir*, const WCHAR*);
+#endif
struct IPerlDir
{
LPDirRewind pRewind;
LPDirSeek pSeek;
LPDirTell pTell;
+#ifdef WIN32
+ LPDirMapPathA pMapPathA;
+ LPDirMapPathW pMapPathW;
+#endif
};
struct IPerlDirInfo
(*PL_Dir->pSeek)(PL_Dir, (dir), (loc))
#define PerlDir_tell(dir) \
(*PL_Dir->pTell)(PL_Dir, (dir))
+#ifdef WIN32
+#define PerlDir_mapA(dir) \
+ (*PL_Dir->pMapPathA)(PL_Dir, (dir))
+#define PerlDir_mapW(dir) \
+ (*PL_Dir->pMapPathW)(PL_Dir, (dir))
+#endif
#else /* PERL_IMPLICIT_SYS */
#define PerlDir_mkdir(name, mode) Mkdir((name), (mode))
#ifdef VMS
-# define PerlDir_chdir(n) chdir(((n) && *(n)) ? (n) : "SYS$LOGIN")
-#else
+# define PerlDir_chdir(n) Chdir((n))
+#else
# define PerlDir_chdir(name) chdir((name))
#endif
#define PerlDir_rmdir(name) rmdir((name))
#define PerlDir_rewind(dir) rewinddir((dir))
#define PerlDir_seek(dir, loc) seekdir((dir), (loc))
#define PerlDir_tell(dir) telldir((dir))
+#ifdef WIN32
+#define PerlDir_mapA(dir) dir
+#define PerlDir_mapW(dir) dir
+#endif
#endif /* PERL_IMPLICIT_SYS */
/* IPerlEnv */
struct IPerlEnv;
+struct IPerlEnvInfo;
typedef char* (*LPEnvGetenv)(struct IPerlEnv*, const char*);
typedef int (*LPEnvPutenv)(struct IPerlEnv*, const char*);
-typedef char * (*LPEnvGetenv_len)(struct IPerlEnv*,
+typedef char* (*LPEnvGetenv_len)(struct IPerlEnv*,
const char *varname, unsigned long *len);
typedef int (*LPEnvUname)(struct IPerlEnv*, struct utsname *name);
typedef void (*LPEnvClearenv)(struct IPerlEnv*);
-typedef unsigned long (*LPEnvOsID)(struct IPerlEnv*);
+typedef void* (*LPEnvGetChildenv)(struct IPerlEnv*);
+typedef void (*LPEnvFreeChildenv)(struct IPerlEnv*, void* env);
+typedef char* (*LPEnvGetChilddir)(struct IPerlEnv*);
+typedef void (*LPEnvFreeChilddir)(struct IPerlEnv*, char* dir);
#ifdef HAS_ENVGETENV
-typedef char * (*LPENVGetenv)(struct IPerlEnv*, const char *varname);
-typedef char * (*LPENVGetenv_len)(struct IPerlEnv*,
+typedef char* (*LPENVGetenv)(struct IPerlEnv*, const char *varname);
+typedef char* (*LPENVGetenv_len)(struct IPerlEnv*,
const char *varname, unsigned long *len);
#endif
#ifdef WIN32
-typedef char* (*LPEnvLibPath)(struct IPerlEnv*, char*);
-typedef char* (*LPEnvSiteLibPath)(struct IPerlEnv*, char*);
+typedef unsigned long (*LPEnvOsID)(struct IPerlEnv*);
+typedef char* (*LPEnvLibPath)(struct IPerlEnv*, const char*);
+typedef char* (*LPEnvSiteLibPath)(struct IPerlEnv*, const char*);
+typedef char* (*LPEnvVendorLibPath)(struct IPerlEnv*, const char*);
+typedef void (*LPEnvGetChildIO)(struct IPerlEnv*, child_IO_table*);
#endif
struct IPerlEnv
LPEnvGetenv_len pGetenv_len;
LPEnvUname pEnvUname;
LPEnvClearenv pClearenv;
+ LPEnvGetChildenv pGetChildenv;
+ LPEnvFreeChildenv pFreeChildenv;
+ LPEnvGetChilddir pGetChilddir;
+ LPEnvFreeChilddir pFreeChilddir;
#ifdef HAS_ENVGETENV
LPENVGetenv pENVGetenv;
LPENVGetenv_len pENVGetenv_len;
LPEnvOsID pEnvOsID;
LPEnvLibPath pLibPath;
LPEnvSiteLibPath pSiteLibPath;
+ LPEnvVendorLibPath pVendorLibPath;
+ LPEnvGetChildIO pGetChildIO;
#endif
};
(*PL_Env->pGetenv)(PL_Env,(str))
#define PerlEnv_getenv_len(str,l) \
(*PL_Env->pGetenv_len)(PL_Env,(str), (l))
-#define PerlEnv_Clear() \
- (*PL_Env->pClearenv)(PL_Env)
-#define PerlEnv_Clear() \
+#define PerlEnv_clearenv() \
(*PL_Env->pClearenv)(PL_Env)
+#define PerlEnv_get_childenv() \
+ (*PL_Env->pGetChildenv)(PL_Env)
+#define PerlEnv_free_childenv(e) \
+ (*PL_Env->pFreeChildenv)(PL_Env, (e))
+#define PerlEnv_get_childdir() \
+ (*PL_Env->pGetChilddir)(PL_Env)
+#define PerlEnv_free_childdir(d) \
+ (*PL_Env->pFreeChilddir)(PL_Env, (d))
#ifdef HAS_ENVGETENV
# define PerlEnv_ENVgetenv(str) \
(*PL_Env->pENVGetenv)(PL_Env,(str))
(*PL_Env->pLibPath)(PL_Env,(str))
#define PerlEnv_sitelib_path(str) \
(*PL_Env->pSiteLibPath)(PL_Env,(str))
+#define PerlEnv_vendorlib_path(str) \
+ (*PL_Env->pVendorLibPath)(PL_Env,(str))
+#define PerlEnv_get_child_IO(ptr) \
+ (*PL_Env->pGetChildIO)(PL_Env, ptr)
#endif
#else /* PERL_IMPLICIT_SYS */
#ifdef WIN32
#define PerlEnv_os_id() win32_os_id()
+#define PerlEnv_lib_path(str) win32_get_privlib(str)
+#define PerlEnv_sitelib_path(str) win32_get_sitelib(str)
+#define PerlEnv_vendorlib_path(str) win32_get_vendorlib(str)
+#define PerlEnv_get_child_IO(ptr) win32_get_child_IO(ptr)
+#define PerlEnv_clearenv() win32_clearenv()
+#define PerlEnv_get_childenv() win32_get_childenv()
+#define PerlEnv_free_childenv(e) win32_free_childenv((e))
+#define PerlEnv_get_childdir() win32_get_childdir()
+#define PerlEnv_free_childdir(d) win32_free_childdir((d))
+#else
+#define PerlEnv_clearenv() clearenv()
+#define PerlEnv_get_childenv() get_childenv()
+#define PerlEnv_free_childenv(e) free_childenv((e))
+#define PerlEnv_get_childdir() get_childdir()
+#define PerlEnv_free_childdir(d) free_childdir((d))
#endif
#endif /* PERL_IMPLICIT_SYS */
/* IPerlLIO */
struct IPerlLIO;
+struct IPerlLIOInfo;
typedef int (*LPLIOAccess)(struct IPerlLIO*, const char*, int);
typedef int (*LPLIOChmod)(struct IPerlLIO*, const char*, int);
typedef int (*LPLIOChown)(struct IPerlLIO*, const char*, uid_t,
gid_t);
-typedef int (*LPLIOChsize)(struct IPerlLIO*, int, long);
+typedef int (*LPLIOChsize)(struct IPerlLIO*, int, Off_t);
typedef int (*LPLIOClose)(struct IPerlLIO*, int);
typedef int (*LPLIODup)(struct IPerlLIO*, int);
typedef int (*LPLIODup2)(struct IPerlLIO*, int, int);
typedef int (*LPLIOFlock)(struct IPerlLIO*, int, int);
-typedef int (*LPLIOFileStat)(struct IPerlLIO*, int, struct stat*);
+typedef int (*LPLIOFileStat)(struct IPerlLIO*, int, Stat_t*);
typedef int (*LPLIOIOCtl)(struct IPerlLIO*, int, unsigned int,
char*);
typedef int (*LPLIOIsatty)(struct IPerlLIO*, int);
-typedef long (*LPLIOLseek)(struct IPerlLIO*, int, long, int);
+typedef int (*LPLIOLink)(struct IPerlLIO*, const char*,
+ const char *);
+typedef Off_t (*LPLIOLseek)(struct IPerlLIO*, int, Off_t, int);
typedef int (*LPLIOLstat)(struct IPerlLIO*, const char*,
- struct stat*);
+ Stat_t*);
typedef char* (*LPLIOMktemp)(struct IPerlLIO*, char*);
typedef int (*LPLIOOpen)(struct IPerlLIO*, const char*, int);
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*);
+ Stat_t*);
typedef char* (*LPLIOTmpnam)(struct IPerlLIO*, char*);
typedef int (*LPLIOUmask)(struct IPerlLIO*, int);
typedef int (*LPLIOUnlink)(struct IPerlLIO*, const char*);
-typedef int (*LPLIOUtime)(struct IPerlLIO*, char*, struct utimbuf*);
+typedef int (*LPLIOUtime)(struct IPerlLIO*, const char*, struct utimbuf*);
typedef int (*LPLIOWrite)(struct IPerlLIO*, int, const void*,
unsigned int);
LPLIOFileStat pFileStat;
LPLIOIOCtl pIOCtl;
LPLIOIsatty pIsatty;
+ LPLIOLink pLink;
LPLIOLseek pLseek;
LPLIOLstat pLstat;
LPLIOMktemp pMktemp;
(*PL_LIO->pIOCtl)(PL_LIO, (fd), (u), (buf))
#define PerlLIO_isatty(fd) \
(*PL_LIO->pIsatty)(PL_LIO, (fd))
+#define PerlLIO_link(oldname, newname) \
+ (*PL_LIO->pLink)(PL_LIO, (oldname), (newname))
#define PerlLIO_lseek(fd, offset, mode) \
(*PL_LIO->pLseek)(PL_LIO, (fd), (offset), (mode))
#define PerlLIO_lstat(name, buf) \
#define PerlLIO_access(file, mode) access((file), (mode))
#define PerlLIO_chmod(file, mode) chmod((file), (mode))
#define PerlLIO_chown(file, owner, grp) chown((file), (owner), (grp))
-#define PerlLIO_chsize(fd, size) chsize((fd), (size))
+#if defined(HAS_TRUNCATE)
+# define PerlLIO_chsize(fd, size) ftruncate((fd), (size))
+#elif defined(HAS_CHSIZE)
+# define PerlLIO_chsize(fd, size) chsize((fd), (size))
+#else
+# define PerlLIO_chsize(fd, size) my_chsize((fd), (size))
+#endif
#define PerlLIO_close(fd) close((fd))
#define PerlLIO_dup(fd) dup((fd))
#define PerlLIO_dup2(fd1, fd2) dup2((fd1), (fd2))
#define PerlLIO_fstat(fd, buf) Fstat((fd), (buf))
#define PerlLIO_ioctl(fd, u, buf) ioctl((fd), (u), (buf))
#define PerlLIO_isatty(fd) isatty((fd))
+#define PerlLIO_link(oldname, newname) link((oldname), (newname))
#define PerlLIO_lseek(fd, offset, mode) lseek((fd), (offset), (mode))
#define PerlLIO_stat(name, buf) Stat((name), (buf))
#ifdef HAS_LSTAT
/* IPerlMem */
struct IPerlMem;
+struct IPerlMemInfo;
typedef void* (*LPMemMalloc)(struct IPerlMem*, size_t);
typedef void* (*LPMemRealloc)(struct IPerlMem*, void*, size_t);
typedef void (*LPMemFree)(struct IPerlMem*, void*);
+typedef void* (*LPMemCalloc)(struct IPerlMem*, size_t, size_t);
+typedef void (*LPMemGetLock)(struct IPerlMem*);
+typedef void (*LPMemFreeLock)(struct IPerlMem*);
+typedef int (*LPMemIsLocked)(struct IPerlMem*);
struct IPerlMem
{
LPMemMalloc pMalloc;
LPMemRealloc pRealloc;
LPMemFree pFree;
+ LPMemCalloc pCalloc;
+ LPMemGetLock pGetLock;
+ LPMemFreeLock pFreeLock;
+ LPMemIsLocked pIsLocked;
};
struct IPerlMemInfo
struct IPerlMem perlMemList;
};
+/* Interpreter specific memory macros */
#define PerlMem_malloc(size) \
(*PL_Mem->pMalloc)(PL_Mem, (size))
#define PerlMem_realloc(buf, size) \
(*PL_Mem->pRealloc)(PL_Mem, (buf), (size))
#define PerlMem_free(buf) \
(*PL_Mem->pFree)(PL_Mem, (buf))
+#define PerlMem_calloc(num, size) \
+ (*PL_Mem->pCalloc)(PL_Mem, (num), (size))
+#define PerlMem_get_lock() \
+ (*PL_Mem->pGetLock)(PL_Mem)
+#define PerlMem_free_lock() \
+ (*PL_Mem->pFreeLock)(PL_Mem)
+#define PerlMem_is_locked() \
+ (*PL_Mem->pIsLocked)(PL_Mem)
+
+/* Shared memory macros */
+#ifdef NETWARE
+
+#define PerlMemShared_malloc(size) \
+ (*PL_Mem->pMalloc)(PL_Mem, (size))
+#define PerlMemShared_realloc(buf, size) \
+ (*PL_Mem->pRealloc)(PL_Mem, (buf), (size))
+#define PerlMemShared_free(buf) \
+ (*PL_Mem->pFree)(PL_Mem, (buf))
+#define PerlMemShared_calloc(num, size) \
+ (*PL_Mem->pCalloc)(PL_Mem, (num), (size))
+#define PerlMemShared_get_lock() \
+ (*PL_Mem->pGetLock)(PL_Mem)
+#define PerlMemShared_free_lock() \
+ (*PL_Mem->pFreeLock)(PL_Mem)
+#define PerlMemShared_is_locked() \
+ (*PL_Mem->pIsLocked)(PL_Mem)
+
+#else
+
+#define PerlMemShared_malloc(size) \
+ (*PL_MemShared->pMalloc)(PL_MemShared, (size))
+#define PerlMemShared_realloc(buf, size) \
+ (*PL_MemShared->pRealloc)(PL_MemShared, (buf), (size))
+#define PerlMemShared_free(buf) \
+ (*PL_MemShared->pFree)(PL_MemShared, (buf))
+#define PerlMemShared_calloc(num, size) \
+ (*PL_MemShared->pCalloc)(PL_MemShared, (num), (size))
+#define PerlMemShared_get_lock() \
+ (*PL_MemShared->pGetLock)(PL_MemShared)
+#define PerlMemShared_free_lock() \
+ (*PL_MemShared->pFreeLock)(PL_MemShared)
+#define PerlMemShared_is_locked() \
+ (*PL_MemShared->pIsLocked)(PL_MemShared)
+
+#endif
+
+/* Parse tree memory macros */
+#define PerlMemParse_malloc(size) \
+ (*PL_MemParse->pMalloc)(PL_MemParse, (size))
+#define PerlMemParse_realloc(buf, size) \
+ (*PL_MemParse->pRealloc)(PL_MemParse, (buf), (size))
+#define PerlMemParse_free(buf) \
+ (*PL_MemParse->pFree)(PL_MemParse, (buf))
+#define PerlMemParse_calloc(num, size) \
+ (*PL_MemParse->pCalloc)(PL_MemParse, (num), (size))
+#define PerlMemParse_get_lock() \
+ (*PL_MemParse->pGetLock)(PL_MemParse)
+#define PerlMemParse_free_lock() \
+ (*PL_MemParse->pFreeLock)(PL_MemParse)
+#define PerlMemParse_is_locked() \
+ (*PL_MemParse->pIsLocked)(PL_MemParse)
+
#else /* PERL_IMPLICIT_SYS */
+/* Interpreter specific memory macros */
#define PerlMem_malloc(size) malloc((size))
#define PerlMem_realloc(buf, size) realloc((buf), (size))
#define PerlMem_free(buf) free((buf))
+#define PerlMem_calloc(num, size) calloc((num), (size))
+#define PerlMem_get_lock()
+#define PerlMem_free_lock()
+#define PerlMem_is_locked() 0
+
+/* Shared memory macros */
+#define PerlMemShared_malloc(size) malloc((size))
+#define PerlMemShared_realloc(buf, size) realloc((buf), (size))
+#define PerlMemShared_free(buf) free((buf))
+#define PerlMemShared_calloc(num, size) calloc((num), (size))
+#define PerlMemShared_get_lock()
+#define PerlMemShared_free_lock()
+#define PerlMemShared_is_locked() 0
+
+/* Parse tree memory macros */
+#define PerlMemParse_malloc(size) malloc((size))
+#define PerlMemParse_realloc(buf, size) realloc((buf), (size))
+#define PerlMemParse_free(buf) free((buf))
+#define PerlMemParse_calloc(num, size) calloc((num), (size))
+#define PerlMemParse_get_lock()
+#define PerlMemParse_free_lock()
+#define PerlMemParse_is_locked() 0
#endif /* PERL_IMPLICIT_SYS */
#if defined(PERL_IMPLICIT_SYS)
-#ifndef Sighandler_t
-typedef Signal_t (*Sighandler_t) (int);
-#endif
#ifndef jmp_buf
#include <setjmp.h>
#endif
/* IPerlProc */
struct IPerlProc;
+struct IPerlProcInfo;
typedef void (*LPProcAbort)(struct IPerlProc*);
typedef char* (*LPProcCrypt)(struct IPerlProc*, const char*,
const char*);
-typedef void (*LPProcExit)(struct IPerlProc*, int);
-typedef void (*LPProc_Exit)(struct IPerlProc*, int);
+typedef void (*LPProcExit)(struct IPerlProc*, int)
+ __attribute__noreturn__;
+typedef void (*LPProc_Exit)(struct IPerlProc*, int)
+ __attribute__noreturn__;
typedef int (*LPProcExecl)(struct IPerlProc*, const char*,
const char*, const char*, const char*,
const char*);
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);
typedef int (*LPProcWait)(struct IPerlProc*, int*);
typedef int (*LPProcWaitpid)(struct IPerlProc*, int, int*, int);
typedef Sighandler_t (*LPProcSignal)(struct IPerlProc*, int, Sighandler_t);
-typedef void* (*LPProcDynaLoader)(struct IPerlProc*, const char*);
+typedef int (*LPProcFork)(struct IPerlProc*);
+typedef int (*LPProcGetpid)(struct IPerlProc*);
#ifdef WIN32
+typedef void* (*LPProcDynaLoader)(struct IPerlProc*, const char*);
typedef void (*LPProcGetOSError)(struct IPerlProc*,
SV* sv, DWORD dwErr);
-typedef void (*LPProcFreeBuf)(struct IPerlProc*, char*);
-typedef BOOL (*LPProcDoCmd)(struct IPerlProc*, char*);
-typedef int (*LPProcSpawn)(struct IPerlProc*, char*);
typedef int (*LPProcSpawnvp)(struct IPerlProc*, int, const char*,
const char*const*);
-typedef int (*LPProcASpawn)(struct IPerlProc*, void*, void**, void**);
#endif
+typedef int (*LPProcLastHost)(struct IPerlProc*);
+typedef int (*LPProcGetTimeOfDay)(struct IPerlProc*,
+ struct timeval*, void*);
struct IPerlProc
{
LPProcWait pWait;
LPProcWaitpid pWaitpid;
LPProcSignal pSignal;
+ LPProcFork pFork;
+ LPProcGetpid pGetpid;
#ifdef WIN32
LPProcDynaLoader pDynaLoader;
LPProcGetOSError pGetOSError;
- LPProcDoCmd pDoCmd;
- LPProcSpawn pSpawn;
LPProcSpawnvp pSpawnvp;
- LPProcASpawn pASpawn;
#endif
+ LPProcLastHost pLastHost;
+ LPProcPopenList pPopenList;
+ LPProcGetTimeOfDay pGetTimeOfDay;
};
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) \
(*PL_Proc->pWaitpid)(PL_Proc, (p), (s), (f))
#define PerlProc_signal(n, h) \
(*PL_Proc->pSignal)(PL_Proc, (n), (h))
+#define PerlProc_fork() \
+ (*PL_Proc->pFork)(PL_Proc)
+#define PerlProc_getpid() \
+ (*PL_Proc->pGetpid)(PL_Proc)
#define PerlProc_setjmp(b, n) Sigsetjmp((b), (n))
#define PerlProc_longjmp(b, n) Siglongjmp((b), (n))
(*PL_Proc->pDynaLoader)(PL_Proc, (f))
#define PerlProc_GetOSError(s,e) \
(*PL_Proc->pGetOSError)(PL_Proc, (s), (e))
-#define PerlProc_Cmd(s) \
- (*PL_Proc->pDoCmd)(PL_Proc, (s))
-#define do_spawn(s) \
- (*PL_Proc->pSpawn)(PL_Proc, (s))
-#define do_spawnvp(m, c, a) \
+#define PerlProc_spawnvp(m, c, a) \
(*PL_Proc->pSpawnvp)(PL_Proc, (m), (c), (a))
-#define PerlProc_aspawn(m,c,a) \
- (*PL_Proc->pASpawn)(PL_Proc, (m), (c), (a))
#endif
+#define PerlProc_lasthost() \
+ (*PL_Proc->pLastHost)(PL_Proc)
+#define PerlProc_gettimeofday(t,z) \
+ (*PL_Proc->pGetTimeOfDay)(PL_Proc,(t),(z))
#else /* PERL_IMPLICIT_SYS */
#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))
#define PerlProc_setjmp(b, n) Sigsetjmp((b), (n))
#define PerlProc_longjmp(b, n) Siglongjmp((b), (n))
#define PerlProc_signal(n, h) signal((n), (h))
+#define PerlProc_fork() my_fork()
+#define PerlProc_getpid() getpid()
+#define PerlProc_gettimeofday(t,z) gettimeofday((t),(z))
#ifdef WIN32
#define PerlProc_DynaLoad(f) \
win32_dynaload((f))
#define PerlProc_GetOSError(s,e) \
win32_str_os_error((s), (e))
+#define PerlProc_spawnvp(m, c, a) \
+ win32_spawnvp((m), (c), (a))
+#undef PerlProc_signal
+#define PerlProc_signal(n, h) win32_signal((n), (h))
#endif
#endif /* PERL_IMPLICIT_SYS */
/* PerlSock */
struct IPerlSock;
+struct IPerlSockInfo;
typedef u_long (*LPHtonl)(struct IPerlSock*, u_long);
typedef u_short (*LPHtons)(struct IPerlSock*, u_short);
typedef u_long (*LPNtohl)(struct IPerlSock*, u_long);
typedef int (*LPSelect)(struct IPerlSock*, int, char*, char*,
char*, const struct timeval*);
typedef int (*LPSend)(struct IPerlSock*, SOCKET, const char*, int,
- int);
+ int);
typedef int (*LPSendto)(struct IPerlSock*, SOCKET, const char*,
int, int, const struct sockaddr*, int);
typedef void (*LPSethostent)(struct IPerlSock*, int);
#endif /* PERL_IMPLICIT_SYS */
-/* Mention
-
- HAS_READV
- HAS_RECVMSG
- HAS_SENDMSG
- HAS_WRITEV
- HAS_STRUCT_MSGHDR
- HAS_STRUCT_CMSGHDR
-
- here so that Configure picks them up. Perl core does not
- use them but somebody might want to extend Socket:: or IO::
- someday.
-
- Jarkko Hietaniemi November 1998
-
- */
-
#endif /* __Inc__IPerl___ */