made transparent to extension developers by the following macros:
#define var pPerl->Perl_var
#define func pPerl->Perl_func
- * these are done in ObjXSub.h
+ * these are done in objXSUB.h
This requires that the extension be compiled as C++, which means
that the code must be ANSI C and not K&R C. For K&R extensions,
please see the C API notes located in Win32/GenCAPI.pl. This script
-creates a PerlCAPI.lib that provides a K & R compatible C interface
+creates a perlCAPI.lib that provides a K & R compatible C interface
to the PERL_OBJECT.
2. Local variables and functions cannot have the same name as perl's
variables or functions since the macros will redefine these. Look for
#define PERL_OBJECT_THIS this
#define _PERL_OBJECT_THIS ,this
#define PERL_OBJECT_THIS_ this,
-#define CALLRUNOPS (this->*runops)
-#define CALLREGCOMP (this->*regcompp)
-#define CALLREGEXEC (this->*regexecp)
+#define CALLRUNOPS (this->*PL_runops)
+#define CALLREGCOMP (this->*PL_regcompp)
+#define CALLREGEXEC (this->*PL_regexecp)
#else /* !PERL_OBJECT */
#ifdef VMS
-# define STATUS_NATIVE statusvalue_vms
+# define STATUS_NATIVE PL_statusvalue_vms
# define STATUS_NATIVE_EXPORT \
- ((I32)statusvalue_vms == -1 ? 44 : statusvalue_vms)
+ ((I32)PL_statusvalue_vms == -1 ? 44 : PL_statusvalue_vms)
# define STATUS_NATIVE_SET(n) \
STMT_START { \
- statusvalue_vms = (n); \
- if ((I32)statusvalue_vms == -1) \
+ PL_statusvalue_vms = (n); \
+ if ((I32)PL_statusvalue_vms == -1) \
PL_statusvalue = -1; \
- else if (statusvalue_vms & STS$M_SUCCESS) \
+ else if (PL_statusvalue_vms & STS$M_SUCCESS) \
PL_statusvalue = 0; \
- else if ((statusvalue_vms & STS$M_SEVERITY) == 0) \
- PL_statusvalue = 1 << 8; \
+ else if ((PL_statusvalue_vms & STS$M_SEVERITY) == 0) \
+ PL_statusvalue = 1 << 8; \
else \
- PL_statusvalue = (statusvalue_vms & STS$M_SEVERITY) << 8; \
+ PL_statusvalue = (PL_statusvalue_vms & STS$M_SEVERITY) << 8; \
} STMT_END
# define STATUS_POSIX PL_statusvalue
# ifdef VMSISH_STATUS
PL_statusvalue = (n); \
if (PL_statusvalue != -1) { \
PL_statusvalue &= 0xFFFF; \
- statusvalue_vms = PL_statusvalue ? 44 : 1; \
+ PL_statusvalue_vms = PL_statusvalue ? 44 : 1; \
} \
- else statusvalue_vms = -1; \
+ else PL_statusvalue_vms = -1; \
} STMT_END
-# define STATUS_ALL_SUCCESS (PL_statusvalue = 0, statusvalue_vms = 1)
-# define STATUS_ALL_FAILURE (PL_statusvalue = 1, statusvalue_vms = 44)
+# define STATUS_ALL_SUCCESS (PL_statusvalue = 0, PL_statusvalue_vms = 1)
+# define STATUS_ALL_FAILURE (PL_statusvalue = 1, PL_statusvalue_vms = 44)
#else
# define STATUS_NATIVE STATUS_POSIX
# define STATUS_NATIVE_EXPORT STATUS_POSIX
# define PAD_SV(po) pad_sv(po)
# define RUNOPS_DEFAULT runops_debug
#else
-# define PAD_SV(po) curpad[po]
+# define PAD_SV(po) PL_curpad[po]
# define RUNOPS_DEFAULT runops_standard
#endif
#ifdef MYMALLOC
-# define MALLOC_INIT MUTEX_INIT(&malloc_mutex)
-# define MALLOC_TERM MUTEX_DESTROY(&malloc_mutex)
+# define MALLOC_INIT MUTEX_INIT(&PL_malloc_mutex)
+# define MALLOC_TERM MUTEX_DESTROY(&PL_malloc_mutex)
#else
# define MALLOC_INIT
# define MALLOC_TERM
};
#ifdef PERL_CORE
-EXT struct perl_vars Perl_Vars;
-EXT struct perl_vars *Perl_VarsPtr INIT(&Perl_Vars);
-#else
+EXT struct perl_vars PL_Vars;
+EXT struct perl_vars *PL_VarsPtr INIT(&PL_Vars);
+#else /* PERL_CORE */
#if !defined(__GNUC__) || !defined(WIN32)
EXT
-#endif
-struct perl_vars *Perl_VarsPtr;
-#define Perl_Vars (*((Perl_VarsPtr) ? Perl_VarsPtr : (Perl_VarsPtr = Perl_GetVars())))
-#endif
+#endif /* WIN32 */
+struct perl_vars *PL_VarsPtr;
+#define PL_Vars (*((PL_VarsPtr) ? PL_VarsPtr : (PL_VarsPtr = Perl_GetVars())))
+#endif /* PERL_CORE */
#endif /* PERL_GLOBAL_STRUCT */
#ifdef MULTIPLICITY
* If we don't have threads or multiple interpreters
* these include variables that would have been their struct-s
*/
-
-#define PERLVAR(var,type) EXT type var;
-#define PERLVARI(var,type,init) EXT type var INIT(init);
-#define PERLVARIC(var,type,init) EXTCONST type var INIT(init);
+
+#define PERLVAR(var,type) EXT type PL_##var;
+#define PERLVARI(var,type,init) EXT type PL_##var INIT(init);
+#define PERLVARIC(var,type,init) EXTCONST type PL_##var INIT(init);
#ifndef PERL_GLOBAL_STRUCT
#include "perlvars.h"