summaryrefslogtreecommitdiff
path: root/iperlsys.h
diff options
context:
space:
mode:
Diffstat (limited to 'iperlsys.h')
-rw-r--r--iperlsys.h127
1 files changed, 122 insertions, 5 deletions
diff --git a/iperlsys.h b/iperlsys.h
index 9404d184c8..7b20d5dd5b 100644
--- a/iperlsys.h
+++ b/iperlsys.h
@@ -86,6 +86,7 @@ typedef struct _PerlIO PerlIO;
/* IPerlStdIO */
struct IPerlStdIO;
+struct IPerlStdIOInfo;
typedef PerlIO* (*LPStdin)(struct IPerlStdIO*);
typedef PerlIO* (*LPStdout)(struct IPerlStdIO*);
typedef PerlIO* (*LPStderr)(struct IPerlStdIO*);
@@ -132,6 +133,7 @@ typedef int (*LPSetpos)(struct IPerlStdIO*, PerlIO*,
const Fpos_t*);
typedef void (*LPInit)(struct IPerlStdIO*);
typedef void (*LPInitOSExtras)(struct IPerlStdIO*);
+typedef PerlIO* (*LPFdupopen)(struct IPerlStdIO*, PerlIO*);
struct IPerlStdIO
{
@@ -173,6 +175,7 @@ struct IPerlStdIO
LPSetpos pSetpos;
LPInit pInit;
LPInitOSExtras pInitOSExtras;
+ LPFdupopen pFdupopen;
};
struct IPerlStdIOInfo
@@ -283,11 +286,14 @@ struct IPerlStdIOInfo
#undef init_os_extras
#define init_os_extras() \
(*PL_StdIO->pInitOSExtras)(PL_StdIO)
+#define PerlIO_fdupopen(f) \
+ (*PL_StdIO->pFdupopen)(PL_StdIO, (f))
#else /* PERL_IMPLICIT_SYS */
#include "perlsdio.h"
#include "perl.h"
+#define PerlIO_fdupopen(f) (f)
#endif /* PERL_IMPLICIT_SYS */
@@ -338,7 +344,7 @@ struct _PerlIO;
#ifndef PerlIO_stdoutf
extern int PerlIO_stdoutf (const char *,...)
- __attribute__((format (printf, 1, 2)));
+ __attribute__((__format__ (__printf__, 1, 2)));
#endif
#ifndef PerlIO_puts
extern int PerlIO_puts (PerlIO *,const char *);
@@ -399,11 +405,11 @@ extern void PerlIO_setlinebuf (PerlIO *);
#endif
#ifndef PerlIO_printf
extern int PerlIO_printf (PerlIO *, const char *,...)
- __attribute__((format (printf, 2, 3)));
+ __attribute__((__format__ (__printf__, 2, 3)));
#endif
#ifndef PerlIO_sprintf
extern int PerlIO_sprintf (char *, int, const char *,...)
- __attribute__((format (printf, 3, 4)));
+ __attribute__((__format__ (__printf__, 3, 4)));
#endif
#ifndef PerlIO_vprintf
extern int PerlIO_vprintf (PerlIO *, const char *, va_list);
@@ -465,6 +471,9 @@ extern int PerlIO_getpos (PerlIO *,Fpos_t *);
#ifndef PerlIO_setpos
extern int PerlIO_setpos (PerlIO *,const Fpos_t *);
#endif
+#ifndef PerlIO_fdupopen
+extern PerlIO * PerlIO_fdupopen (PerlIO *);
+#endif
/*
@@ -475,6 +484,7 @@ extern int PerlIO_setpos (PerlIO *,const Fpos_t *);
/* 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*);
@@ -484,6 +494,10 @@ 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
{
@@ -496,6 +510,10 @@ struct IPerlDir
LPDirRewind pRewind;
LPDirSeek pSeek;
LPDirTell pTell;
+#ifdef WIN32
+ LPDirMapPathA pMapPathA;
+ LPDirMapPathW pMapPathW;
+#endif
};
struct IPerlDirInfo
@@ -522,6 +540,12 @@ 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 */
@@ -538,6 +562,10 @@ struct IPerlDirInfo
#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 */
@@ -549,6 +577,7 @@ struct IPerlDirInfo
/* 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*,
@@ -641,7 +670,7 @@ struct IPerlEnvInfo
#define PerlEnv_putenv(str) putenv((str))
#define PerlEnv_getenv(str) getenv((str))
#define PerlEnv_getenv_len(str,l) getenv_len((str), (l))
-#define PerlEnv_clear() clearenv()
+#define PerlEnv_clearenv() clearenv()
#define PerlEnv_get_childenv() get_childenv()
#define PerlEnv_free_childenv(e) free_childenv((e))
#define PerlEnv_get_childdir() get_childdir()
@@ -669,6 +698,7 @@ struct IPerlEnvInfo
/* 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,
@@ -836,15 +866,24 @@ struct IPerlLIOInfo
/* 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
@@ -853,18 +892,84 @@ 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 */
+#define PerlMemShared_malloc(size) \
+ (*PL_MemShared->pMalloc)(PL_Mem, (size))
+#define PerlMemShared_realloc(buf, size) \
+ (*PL_MemShared->pRealloc)(PL_Mem, (buf), (size))
+#define PerlMemShared_free(buf) \
+ (*PL_MemShared->pFree)(PL_Mem, (buf))
+#define PerlMemShared_calloc(num, size) \
+ (*PL_MemShared->pCalloc)(PL_Mem, (num), (size))
+#define PerlMemShared_get_lock() \
+ (*PL_MemShared->pGetLock)(PL_Mem)
+#define PerlMemShared_free_lock() \
+ (*PL_MemShared->pFreeLock)(PL_Mem)
+#define PerlMemShared_is_locked() \
+ (*PL_MemShared->pIsLocked)(PL_Mem)
+
+
+/* Parse tree memory macros */
+#define PerlMemParse_malloc(size) \
+ (*PL_MemParse->pMalloc)(PL_Mem, (size))
+#define PerlMemParse_realloc(buf, size) \
+ (*PL_MemParse->pRealloc)(PL_Mem, (buf), (size))
+#define PerlMemParse_free(buf) \
+ (*PL_MemParse->pFree)(PL_Mem, (buf))
+#define PerlMemParse_calloc(num, size) \
+ (*PL_MemParse->pCalloc)(PL_Mem, (num), (size))
+#define PerlMemParse_get_lock() \
+ (*PL_MemParse->pGetLock)(PL_Mem)
+#define PerlMemParse_free_lock() \
+ (*PL_MemParse->pFreeLock)(PL_Mem)
+#define PerlMemParse_is_locked() \
+ (*PL_MemParse->pIsLocked)(PL_Mem)
+
#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 */
@@ -881,6 +986,7 @@ struct IPerlMemInfo
/* IPerlProc */
struct IPerlProc;
+struct IPerlProcInfo;
typedef void (*LPProcAbort)(struct IPerlProc*);
typedef char* (*LPProcCrypt)(struct IPerlProc*, const char*,
const char*);
@@ -912,8 +1018,10 @@ typedef int (*LPProcTimes)(struct IPerlProc*, struct tms*);
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*);
@@ -951,6 +1059,8 @@ struct IPerlProc
LPProcWait pWait;
LPProcWaitpid pWaitpid;
LPProcSignal pSignal;
+ LPProcFork pFork;
+ LPProcGetpid pGetpid;
#ifdef WIN32
LPProcDynaLoader pDynaLoader;
LPProcGetOSError pGetOSError;
@@ -1017,6 +1127,10 @@ struct IPerlProcInfo
(*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))
@@ -1065,6 +1179,8 @@ struct IPerlProcInfo
#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() fork()
+#define PerlProc_getpid() getpid()
#ifdef WIN32
#define PerlProc_DynaLoad(f) \
@@ -1082,6 +1198,7 @@ struct IPerlProcInfo
/* 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);