3 * Copyright (c) 1987-1994, Larry Wall
5 * You may distribute under the terms of either the GNU General Public
6 * License or the Artistic License, as specified in the README file.
15 * This file is being used for x2p stuff.
16 * Above symbol is defined via -D in 'x2p/Makefile.SH'
17 * Decouple x2p stuff from some of perls more extreme eccentricities.
23 #endif /* PERL_FOR_X2P */
26 * STMT_START { statements; } STMT_END;
27 * can be used as a single statement, as in
28 * if (x) STMT_START { ... } STMT_END; else ...
30 * Trying to select a version that gives no warnings...
32 #if !(defined(STMT_START) && defined(STMT_END))
33 # if defined(__GNUC__) && !defined(__STRICT_ANSI__)
34 # define STMT_START (void)( /* gcc supports ``({ STATEMENTS; })'' */
37 /* Now which other defined()s do we need here ??? */
38 # if (VOIDFLAGS) && (defined(sun) || defined(__sun__))
39 # define STMT_START if (1)
40 # define STMT_END else (void)0
42 # define STMT_START do
43 # define STMT_END while (0)
54 # define BYTEORDER 0x1234
57 /* Overall memory policy? */
63 * The following contortions are brought to you on behalf of all the
64 * standards, semi-standards, de facto standards, not-so-de-facto standards
65 * of the world, as well as all the other botches anyone ever thought of.
66 * The basic theory is that if we work hard enough here, the rest of the
67 * code can be a lot prettier. Well, so much for theory. Sorry, Henry...
70 /* define this once if either system, instead of cluttering up the src */
71 #if defined(MSDOS) || defined(atarist)
75 #if defined(__STDC__) || defined(vax11c) || defined(_AIX) || defined(__stdc__) || defined(__cplusplus)
79 #if defined(HASVOLATILE) || defined(STANDARD_C)
81 # define VOL // to temporarily suppress warnings
89 #define TAINT_IF(c) (tainted |= (c))
90 #define TAINT_NOT (tainted = 0)
91 #define TAINT_PROPER(s) if (tainting) taint_proper(no_security, s)
92 #define TAINT_ENV() if (tainting) taint_env()
94 /* XXX All process group stuff is handled in pp_sys.c. Should these
95 defines move there? If so, I could simplify this a lot. --AD 9/96.
97 /* Process group stuff changed from traditional BSD to POSIX.
98 perlfunc.pod documents the traditional BSD-style syntax, so we'll
99 try to preserve that, if possible.
102 # define BSD_SETPGRP(pid, pgrp) setpgid((pid), (pgrp))
104 # if defined(HAS_SETPGRP) && defined(USE_BSD_SETPGRP)
105 # define BSD_SETPGRP(pid, pgrp) setpgrp((pid), (pgrp))
107 # ifdef HAS_SETPGRP2 /* DG/UX */
108 # define BSD_SETPGRP(pid, pgrp) setpgrp2((pid), (pgrp))
112 #if defined(BSD_SETPGRP) && !defined(HAS_SETPGRP)
113 # define HAS_SETPGRP /* Well, effectively it does . . . */
116 /* getpgid isn't POSIX, but at least Solaris and Linux have it, and it makes
117 our life easier :-) so we'll try it.
120 # define BSD_GETPGRP(pid) getpgid((pid))
122 # if defined(HAS_GETPGRP) && defined(USE_BSD_GETPGRP)
123 # define BSD_GETPGRP(pid) getpgrp((pid))
125 # ifdef HAS_GETPGRP2 /* DG/UX */
126 # define BSD_GETPGRP(pid) getpgrp2((pid))
130 #if defined(BSD_GETPGRP) && !defined(HAS_GETPGRP)
131 # define HAS_GETPGRP /* Well, effectively it does . . . */
134 /* These are not exact synonyms, since setpgrp() and getpgrp() may
135 have different behaviors, but perl.h used to define USE_BSDPGRP
136 (prior to 5.003_05) so some extension might depend on it.
138 #if defined(USE_BSD_SETPGRP) || defined(USE_BSD_GETPGRP)
144 #ifndef _TYPES_ /* If types.h defines this it's easy. */
145 # ifndef major /* Does everyone's types.h define this? */
146 # include <sys/types.h>
160 # include <varargs.h>
166 #ifdef USE_NEXT_CTYPE
168 #if NX_CURRENT_COMPILER_RELEASE >= 400
169 #include <objc/NXCType.h>
170 #else /* NX_CURRENT_COMPILER_RELEASE < 400 */
171 #include <appkit/NXCType.h>
172 #endif /* NX_CURRENT_COMPILER_RELEASE >= 400 */
174 #else /* !USE_NEXT_CTYPE */
176 #endif /* USE_NEXT_CTYPE */
182 #ifdef METHOD /* Defined by OSF/1 v3.0 by ctype.h */
189 # ifdef PARAM_NEEDS_TYPES
190 # include <sys/types.h>
192 # include <sys/param.h>
196 /* Use all the "standard" definitions? */
197 #if defined(STANDARD_C) && defined(I_STDLIB)
199 #endif /* STANDARD_C */
201 /* Maybe this comes after <stdlib.h> so we don't try to change
202 the standard library prototypes?. We'll use our own in
203 proto.h instead. I guess. The patch had no explanation.
207 # define malloc Perl_malloc
208 # define realloc Perl_realloc
209 # define free Perl_free
210 # define calloc Perl_calloc
212 # define safemalloc malloc
213 # define saferealloc realloc
214 # define safefree free
215 # define safecalloc calloc
218 #define MEM_SIZE Size_t
220 #if defined(I_STRING) || defined(__cplusplus)
223 # include <strings.h>
226 #if !defined(HAS_STRCHR) && defined(HAS_INDEX) && !defined(strchr)
228 #define strrchr rindex
231 #if defined(mips) && defined(ultrix) && !defined(__STDC__)
240 # if !defined(STANDARD_C) && !defined(I_STRING) && !defined(I_MEMORY)
242 extern char * memcpy _((char*, char*, int));
248 # define memcpy(d,s,l) bcopy(s,d,l)
250 # define memcpy(d,s,l) my_bcopy(s,d,l)
253 #endif /* HAS_MEMCPY */
256 # if !defined(STANDARD_C) && !defined(I_STRING) && !defined(I_MEMORY)
258 extern char *memset _((char*, int, int));
261 # define memzero(d,l) memset(d,0,l)
265 # define memzero(d,l) bzero(d,l)
267 # define memzero(d,l) my_bzero(d,l)
270 #endif /* HAS_MEMSET */
273 # if !defined(STANDARD_C) && !defined(I_STRING) && !defined(I_MEMORY)
275 extern int memcmp _((char*, char*, int));
280 # define memcmp my_memcmp
282 #endif /* HAS_MEMCMP */
284 #if !defined(HAS_MEMMOVE) && !defined(memmove)
285 # if defined(HAS_BCOPY) && defined(HAS_SAFE_BCOPY)
286 # define memmove(d,s,l) bcopy(s,d,l)
288 # if defined(HAS_MEMCPY) && defined(HAS_SAFE_MEMCPY)
289 # define memmove(d,s,l) memcpy(d,s,l)
291 # define memmove(d,s,l) my_bcopy(s,d,l)
297 # include <netinet/in.h>
301 #include <sys/stat.h>
304 /* The stat macros for Amdahl UTS, Unisoft System V/88 (and derivatives
305 like UTekV) are broken, sometimes giving false positives. Undefine
306 them here and let the code below set them to proper values.
308 The ghs macro stands for GreenHills Software C-1.8.5 which
309 is the C compiler for sysV88 and the various derivatives.
310 This header file bug is corrected in gcc-2.5.8 and later versions.
311 --Kaveh Ghazi (ghazi@noc.rutgers.edu) 10/3/94. */
313 #if defined(uts) || (defined(m88k) && defined(ghs))
327 # ifdef I_SYS_TIME_KERNEL
330 # include <sys/time.h>
331 # ifdef I_SYS_TIME_KERNEL
337 # if defined(HAS_TIMES) && defined(I_SYS_TIMES)
338 # include <sys/times.h>
342 #if defined(HAS_STRERROR) && (!defined(HAS_MKDIR) || !defined(HAS_RMDIR))
348 # define mkfifo(path, mode) (mknod((path), (mode) | S_IFIFO, 0))
350 #endif /* !HAS_MKFIFO */
355 # include <net/errno.h>
359 # define FIXSTATUS(sts) (U_L((sts) & 0xffff))
360 # define SHIFTSTATUS(sts) ((sts) >> 8)
361 # define SETERRNO(errcode,vmserrcode) errno = (errcode)
363 # define FIXSTATUS(sts) (U_L(sts))
364 # define SHIFTSTATUS(sts) (sts)
365 # define SETERRNO(errcode,vmserrcode) STMT_START {set_errno(errcode); set_vaxc_errno(vmserrcode);} STMT_END
370 extern int errno; /* ANSI allows errno to be an lvalue expr */
376 char *strerror _((int,...));
378 char *strerror _((int));
381 # define Strerror strerror
384 # ifdef HAS_SYS_ERRLIST
386 extern char *sys_errlist[];
388 # define Strerror(e) \
389 ((e) < 0 || (e) >= sys_nerr ? "(unknown)" : sys_errlist[e])
396 # include <sys/ioctl.h>
400 #if defined(mc300) || defined(mc500) || defined(mc700) || defined(mc6000)
401 # ifdef HAS_SOCKETPAIR
402 # undef HAS_SOCKETPAIR
417 /* Configure already sets Direntry_t */
418 #if defined(I_DIRENT)
420 # if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
421 # include <sys/dir.h>
425 # include <sys/ndir.h>
429 # include <ndir.h> /* may be wrong in the future */
431 # include <sys/dir.h>
438 /* work around botch in SunOS 4.0.1 and 4.0.2 */
440 # define fputs(sv,fp) fprintf(fp,"%s",sv)
445 * The following gobbledygook brought to you on behalf of __STDC__.
446 * (I could just use #ifndef __STDC__, but this is more bulletproof
447 * in the face of half-implementations.)
452 # define S_IFMT _S_IFMT
454 # define S_IFMT 0170000
459 # define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR)
463 # define S_ISCHR(m) ((m & S_IFMT) == S_IFCHR)
468 # define S_ISBLK(m) ((m & S_IFMT) == S_IFBLK)
470 # define S_ISBLK(m) (0)
475 # define S_ISREG(m) ((m & S_IFMT) == S_IFREG)
480 # define S_ISFIFO(m) ((m & S_IFMT) == S_IFIFO)
482 # define S_ISFIFO(m) (0)
488 # define S_ISLNK(m) _S_ISLNK(m)
491 # define S_ISLNK(m) ((m & S_IFMT) == _S_IFLNK)
494 # define S_ISLNK(m) ((m & S_IFMT) == S_IFLNK)
496 # define S_ISLNK(m) (0)
504 # define S_ISSOCK(m) _S_ISSOCK(m)
507 # define S_ISSOCK(m) ((m & S_IFMT) == _S_IFSOCK)
510 # define S_ISSOCK(m) ((m & S_IFMT) == S_IFSOCK)
512 # define S_ISSOCK(m) (0)
520 # define S_IRUSR S_IREAD
521 # define S_IWUSR S_IWRITE
522 # define S_IXUSR S_IEXEC
524 # define S_IRUSR 0400
525 # define S_IWUSR 0200
526 # define S_IXUSR 0100
528 # define S_IRGRP (S_IRUSR>>3)
529 # define S_IWGRP (S_IWUSR>>3)
530 # define S_IXGRP (S_IXUSR>>3)
531 # define S_IROTH (S_IRUSR>>6)
532 # define S_IWOTH (S_IWUSR>>6)
533 # define S_IXOTH (S_IXUSR>>6)
537 # define S_ISUID 04000
541 # define S_ISGID 02000
548 #if defined(cray) || defined(gould) || defined(i860) || defined(pyr)
549 # define SLOPPYDIVIDE
552 #if defined(cray) || defined(convex) || BYTEORDER > 0xffff
560 /* XXX QUAD stuff is not currently supported on most systems.
561 Specifically, perl internals don't support long long. Among
562 the many problems is that some compilers support long long,
563 but the underlying library functions (such as sprintf) don't.
564 Some things do work (such as quad pack/unpack on convex);
565 also some systems use long long for the fpos_t typedef. That
568 The IV type is supposed to be long enough to hold any integral
570 --Andy Dougherty August 1996
578 # define Quad_t long long
584 typedef unsigned Quad_t UV;
585 # define IV_MAX PERL_QUAD_MAX
586 # define IV_MIN PERL_QUAD_MIN
587 # define UV_MAX PERL_UQUAD_MAX
588 # define UV_MIN PERL_UQUAD_MIN
591 typedef unsigned long UV;
592 # define IV_MAX PERL_LONG_MAX
593 # define IV_MIN PERL_LONG_MIN
594 # define UV_MAX PERL_ULONG_MAX
595 # define UV_MIN PERL_ULONG_MIN
598 /* Previously these definitions used hardcoded figures.
599 * It is hoped these formula are more portable, although
600 * no data one way or another is presently known to me.
601 * The "PERL_" names are used because these calculated constants
602 * do not meet the ANSI requirements for LONG_MAX, etc., which
603 * need to be constants acceptable to #if - kja
604 * define PERL_LONG_MAX 2147483647L
605 * define PERL_LONG_MIN (-LONG_MAX - 1)
606 * define PERL ULONG_MAX 4294967295L
609 #ifdef I_LIMITS /* Needed for cast_xxx() functions below. */
618 # define PERL_CHAR_MAX CHAR_MAX
620 # ifdef MAXCHAR /* Often used in <values.h> */
621 # define PERL_CHAR_MAX MAXCHAR
623 # define PERL_CHAR_MAX ((char) ((~(unsigned char)0) >> 1))
628 # define PERL_CHAR_MIN CHAR_MIN
631 # define PERL_CHAR_MIN MINCHAR
633 # define PERL_CHAR_MIN (-PERL_CHAR_MAX - ((3 & -1) == 3))
638 # define PERL_UCHAR_MAX UCHAR_MAX
641 # define PERL_UCHAR_MAX MAXUCHAR
643 # define PERL_UCHAR_MAX (~(unsigned char)0)
647 #define PERL_UCHAR_MIN 0
650 # define PERL_SHORT_MAX SHORT_MAX
652 # ifdef MAXSHORT /* Often used in <values.h> */
653 # define PERL_SHORT_MAX MAXSHORT
655 # define PERL_SHORT_MAX ((short) ((~(unsigned short)0) >> 1))
660 # define PERL_SHORT_MIN SHORT_MIN
663 # define PERL_SHORT_MIN MINSHORT
665 # define PERL_SHORT_MIN (-PERL_SHORT_MAX - ((3 & -1) == 3))
670 # define PERL_USHORT_MAX USHORT_MAX
673 # define PERL_USHORT_MAX MAXUSHORT
675 # define PERL_USHORT_MAX (~(unsigned short)0)
679 #define PERL_USHORT_MIN 0
682 # define PERL_INT_MAX INT_MAX
684 # ifdef MAXINT /* Often used in <values.h> */
685 # define PERL_INT_MAX MAXINT
687 # define PERL_INT_MAX ((int) ((~(unsigned int)0) >> 1))
692 # define PERL_INT_MIN INT_MIN
695 # define PERL_INT_MIN MININT
697 # define PERL_INT_MIN (-PERL_INT_MAX - ((3 & -1) == 3))
702 # define PERL_UINT_MAX UINT_MAX
705 # define PERL_UINT_MAX MAXUINT
707 # define PERL_UINT_MAX (~(unsigned int)0)
711 #define PERL_UINT_MIN 0
714 # define PERL_LONG_MAX LONG_MAX
716 # ifdef MAXLONG /* Often used in <values.h> */
717 # define PERL_LONG_MAX MAXLONG
719 # define PERL_LONG_MAX ((long) ((~(unsigned long)0) >> 1))
724 # define PERL_LONG_MIN LONG_MIN
727 # define PERL_LONG_MIN MINLONG
729 # define PERL_LONG_MIN (-PERL_LONG_MAX - ((3 & -1) == 3))
734 # define PERL_ULONG_MAX ULONG_MAX
737 # define PERL_ULONG_MAX MAXULONG
739 # define PERL_ULONG_MAX (~(unsigned long)0)
743 #define PERL_ULONG_MIN 0L
747 # define PERL_QUAD_MAX QUAD_MAX
749 # define PERL_QUAD_MAX ((IV) ((~(UV)0) >> 1))
753 # define PERL_QUAD_MIN QUAD_MIN
755 # define PERL_QUAD_MIN (-PERL_QUAD_MAX - ((3 & -1) == 3))
759 # define PERL_UQUAD_MAX UQUAD_MAX
761 # define PERL_UQUAD_MAX (~(UV)0)
764 # define PERL_UQUAD_MIN 0
767 typedef MEM_SIZE STRLEN;
769 typedef struct op OP;
770 typedef struct cop COP;
771 typedef struct unop UNOP;
772 typedef struct binop BINOP;
773 typedef struct listop LISTOP;
774 typedef struct logop LOGOP;
775 typedef struct condop CONDOP;
776 typedef struct pmop PMOP;
777 typedef struct svop SVOP;
778 typedef struct gvop GVOP;
779 typedef struct pvop PVOP;
780 typedef struct loop LOOP;
782 typedef struct Outrec Outrec;
783 typedef struct interpreter PerlInterpreter;
784 typedef struct ff FF;
785 typedef struct sv SV;
786 typedef struct av AV;
787 typedef struct hv HV;
788 typedef struct cv CV;
789 typedef struct regexp REGEXP;
790 typedef struct gp GP;
791 typedef struct gv GV;
792 typedef struct io IO;
793 typedef struct context CONTEXT;
794 typedef struct block BLOCK;
796 typedef struct magic MAGIC;
797 typedef struct xrv XRV;
798 typedef struct xpv XPV;
799 typedef struct xpviv XPVIV;
800 typedef struct xpvnv XPVNV;
801 typedef struct xpvmg XPVMG;
802 typedef struct xpvlv XPVLV;
803 typedef struct xpvav XPVAV;
804 typedef struct xpvhv XPVHV;
805 typedef struct xpvgv XPVGV;
806 typedef struct xpvcv XPVCV;
807 typedef struct xpvbm XPVBM;
808 typedef struct xpvfm XPVFM;
809 typedef struct xpvio XPVIO;
810 typedef struct mgvtbl MGVTBL;
811 typedef union any ANY;
815 typedef I32 (*filter_t) _((int, SV *, int));
816 #define FILTER_READ(idx, sv, len) filter_read(idx, sv, len)
817 #define FILTER_DATA(idx) (AvARRAY(rsfp_filters)[idx])
818 #define FILTER_ISREADER(idx) (idx >= AvFILL(rsfp_filters))
831 # include "./plan9/plan9ish.h"
833 # include "unixish.h"
838 /* Some unistd.h's give a prototype for pause() even though
839 HAS_PAUSE ends up undefined. This causes the #define
840 below to be rejected by the compmiler. Sigh.
845 #define Pause() sleep((32767<<16)+32767)
850 /* on BSDish systes we're safe */
851 # define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK)
853 /* otherwise guess at what's safe */
854 # define IOCPARM_LEN(x) 256
863 void (*any_dptr) _((void*));
880 /* work around some libPW problems */
885 #if defined(iAPX286) || defined(M_I286) || defined(I80286)
889 #if defined(htonl) && !defined(HAS_HTONL)
892 #if defined(htons) && !defined(HAS_HTONS)
895 #if defined(ntohl) && !defined(HAS_NTOHL)
898 #if defined(ntohs) && !defined(HAS_NTOHS)
902 #if (BYTEORDER & 0xffff) != 0x4321
908 #define htons my_swap
909 #define htonl my_htonl
910 #define ntohs my_swap
911 #define ntohl my_ntohl
914 #if (BYTEORDER & 0xffff) == 0x4321
923 * Little-endian byte order functions - 'v' for 'VAX', or 'reVerse'.
926 #if BYTEORDER != 0x1234
931 # if BYTEORDER == 0x4321
932 # define vtohl(x) ((((x)&0xFF)<<24) \
934 +(((x)&0x0000FF00)<<8) \
935 +(((x)&0x00FF0000)>>8) )
936 # define vtohs(x) ((((x)&0xFF)<<8) + (((x)>>8)&0xFF))
937 # define htovl(x) vtohl(x)
938 # define htovs(x) vtohs(x)
940 /* otherwise default to functions in util.c */
944 #define U_S(what) ((U16)(what))
945 #define U_I(what) ((unsigned int)(what))
946 #define U_L(what) ((U32)(what))
951 U32 cast_ulong _((double));
955 #define U_S(what) ((U16)cast_ulong((double)(what)))
956 #define U_I(what) ((unsigned int)cast_ulong((double)(what)))
957 #define U_L(what) (cast_ulong((double)(what)))
961 #define I_32(what) ((I32)(what))
962 #define I_V(what) ((IV)(what))
963 #define U_V(what) ((UV)(what))
968 I32 cast_i32 _((double));
969 IV cast_iv _((double));
970 UV cast_uv _((double));
974 #define I_32(what) (cast_i32((double)(what)))
975 #define I_V(what) (cast_iv((double)(what)))
976 #define U_V(what) (cast_uv((double)(what)))
990 # define TMPPATH "/tmp/perl-eXXXXXX"
994 Uid_t getuid _((void));
995 Uid_t geteuid _((void));
996 Gid_t getgid _((void));
997 Gid_t getegid _((void));
1001 #ifndef Perl_debug_log
1002 #define Perl_debug_log PerlIO_stderr()
1006 #define DEBUG(a) if (debug) a
1007 #define DEBUG_p(a) if (debug & 1) a
1008 #define DEBUG_s(a) if (debug & 2) a
1009 #define DEBUG_l(a) if (debug & 4) a
1010 #define DEBUG_t(a) if (debug & 8) a
1011 #define DEBUG_o(a) if (debug & 16) a
1012 #define DEBUG_c(a) if (debug & 32) a
1013 #define DEBUG_P(a) if (debug & 64) a
1014 #define DEBUG_m(a) if (curinterp && debug & 128) a
1015 #define DEBUG_f(a) if (debug & 256) a
1016 #define DEBUG_r(a) if (debug & 512) a
1017 #define DEBUG_x(a) if (debug & 1024) a
1018 #define DEBUG_u(a) if (debug & 2048) a
1019 #define DEBUG_L(a) if (debug & 4096) a
1020 #define DEBUG_H(a) if (debug & 8192) a
1021 #define DEBUG_X(a) if (debug & 16384) a
1022 #define DEBUG_D(a) if (debug & 32768) a
1043 #define YYMAXDEPTH 300
1045 #ifndef assert /* <assert.h> might have been included somehow */
1046 #define assert(what) DEB( { \
1048 croak("Assertion failed: file \"%s\", line %d", \
1049 __FILE__, __LINE__); \
1055 I32 (*uf_val)_((IV, SV*));
1056 I32 (*uf_set)_((IV, SV*));
1060 /* Fix these up for __STDC__ */
1062 char *mktemp _((char*));
1063 double atof _((const char*));
1067 /* All of these are in stdlib.h or time.h for ANSI C */
1069 struct tm *gmtime(), *localtime();
1070 char *strchr(), *strrchr();
1071 char *strcpy(), *strcat();
1072 #endif /* ! STANDARD_C */
1081 double exp _((double));
1082 double log _((double));
1083 double sqrt _((double));
1084 double modf _((double,double*));
1085 double sin _((double));
1086 double cos _((double));
1087 double atan2 _((double,double));
1088 double pow _((double,double));
1095 #ifdef __NeXT__ /* or whatever catches all NeXTs */
1096 char *crypt (); /* Maybe more hosts will need the unprototyped version */
1098 char *crypt _((const char*, const char*));
1100 char *getenv _((const char*));
1101 Off_t lseek _((int,Off_t,int));
1102 char *getlogin _((void));
1105 #ifdef UNLINK_ALL_VERSIONS /* Currently only makes sense for VMS */
1106 #define UNLINK unlnk
1107 I32 unlnk _((char*));
1109 #define UNLINK unlink
1112 #ifndef HAS_SETREUID
1113 # ifdef HAS_SETRESUID
1114 # define setreuid(r,e) setresuid(r,e,(Uid_t)-1)
1115 # define HAS_SETREUID
1118 #ifndef HAS_SETREGID
1119 # ifdef HAS_SETRESGID
1120 # define setregid(r,e) setresgid(r,e,(Gid_t)-1)
1121 # define HAS_SETREGID
1130 # ifndef DEBUGGING_MSTATS
1131 # define DEBUGGING_MSTATS
1139 # define PAD_SV(po) pad_sv(po)
1141 # define PAD_SV(po) curpad[po]
1149 EXT PerlInterpreter * curinterp; /* currently running interpreter */
1150 /* VMS doesn't use environ array and NeXT has problems with crt0.o globals */
1151 #if !defined(VMS) && !(defined(NeXT) && defined(__DYNAMIC__))
1152 extern char ** environ; /* environment variables supplied via exec */
1154 # if defined(NeXT) && defined(__DYNAMIC__)
1156 # include <mach-o/dyld.h>
1157 EXT char *** environ_pointer;
1158 # define environ (*environ_pointer)
1160 #endif /* environ processing */
1162 EXT int uid; /* current real user id */
1163 EXT int euid; /* current effective user id */
1164 EXT int gid; /* current real group id */
1165 EXT int egid; /* current effective group id */
1166 EXT bool nomemok; /* let malloc context handle nomem */
1167 EXT U32 an; /* malloc sequence number */
1168 EXT U32 cop_seqmax; /* statement sequence number */
1169 EXT U16 op_seqmax; /* op sequence number */
1170 EXT U32 evalseq; /* eval sequence number */
1171 EXT U32 sub_generation; /* inc to force methods to be looked up again */
1172 EXT char ** origenviron;
1174 EXT U32 * profiledata;
1175 EXT int maxo INIT(MAXO);/* Number of ops */
1176 EXT char * osname; /* operating system */
1178 EXT XPV* xiv_arenaroot; /* list of allocated xiv areas */
1179 EXT IV ** xiv_root; /* free xiv list--shared by interpreters */
1180 EXT double * xnv_root; /* free xnv list--shared by interpreters */
1181 EXT XRV * xrv_root; /* free xrv list--shared by interpreters */
1182 EXT XPV * xpv_root; /* free xpv list--shared by interpreters */
1183 EXT HE * he_root; /* free he list--shared by interpreters */
1184 EXT char * nice_chunk; /* a nice chunk of memory to reuse */
1185 EXT U32 nice_chunk_size;/* how nice the chunk of memory is */
1187 /* Stack for currently executing thread--context switch must handle this. */
1188 EXT SV ** stack_base; /* stack->array_ary */
1189 EXT SV ** stack_sp; /* stack pointer now */
1190 EXT SV ** stack_max; /* stack->array_ary + stack->array_max */
1192 /* likewise for these */
1194 EXT OP * op; /* current op--oughta be in a global register */
1196 EXT I32 * scopestack; /* blocks we've entered */
1197 EXT I32 scopestack_ix;
1198 EXT I32 scopestack_max;
1200 EXT ANY* savestack; /* to save non-local values on */
1201 EXT I32 savestack_ix;
1202 EXT I32 savestack_max;
1204 EXT OP ** retstack; /* returns we've pushed */
1205 EXT I32 retstack_ix;
1206 EXT I32 retstack_max;
1208 EXT I32 * markstack; /* stackmarks we're remembering */
1209 EXT I32 * markstack_ptr; /* stackmarks we're remembering */
1210 EXT I32 * markstack_max; /* stackmarks we're remembering */
1218 EXT char buf[2048]; /* should be longer than PATH_MAX */
1219 EXT char tokenbuf[256];
1220 EXT struct stat statbuf;
1222 EXT struct tms timesbuf;
1224 EXT STRLEN na; /* for use in SvPV when length is Not Applicable */
1226 /* for tmp use in stupid debuggers */
1231 /* handy constants */
1232 EXT char * Yes INIT("1");
1233 EXT char * No INIT("");
1234 EXT char * hexdigit INIT("0123456789abcdef0123456789ABCDEFx");
1235 EXT char * patleave INIT("\\.^$@dDwWsSbB+*?|()-nrtfeaxc0123456789[{]}");
1236 EXT char * vert INIT("|");
1238 EXT char warn_uninit[]
1239 INIT("Use of uninitialized value");
1240 EXT char warn_nosemi[]
1241 INIT("Semicolon seems to be missing");
1242 EXT char warn_reserved[]
1243 INIT("Unquoted string \"%s\" may clash with future reserved word");
1245 INIT("Unsuccessful %s on filename containing newline");
1246 EXT char no_wrongref[]
1247 INIT("Can't use %s ref as %s ref");
1248 EXT char no_symref[]
1249 INIT("Can't use string (\"%.32s\") as %s ref while \"strict refs\" in use");
1251 INIT("Can't use an undefined value as %s reference");
1253 INIT("Modification of non-creatable array value attempted, subscript %d");
1255 INIT("Modification of non-creatable hash value attempted, subscript \"%s\"");
1256 EXT char no_modify[]
1257 INIT("Modification of a read-only value attempted");
1259 INIT("Out of memory!\n");
1260 EXT char no_security[]
1261 INIT("Insecure dependency in %s%s");
1262 EXT char no_sock_func[]
1263 INIT("Unsupported socket function \"%s\" called");
1264 EXT char no_dir_func[]
1265 INIT("Unsupported directory function \"%s\" called");
1267 INIT("The %s function is unimplemented");
1268 EXT char no_myglob[]
1269 INIT("\"my\" variable %s can't be in a package");
1275 EXT char * cshname INIT(CSH);
1280 EXT char *sig_name[] = { SIG_NAME };
1281 EXT int sig_num[] = { SIG_NUM };
1282 EXT SV * psig_ptr[sizeof(sig_num)/sizeof(*sig_num)];
1283 EXT SV * psig_name[sizeof(sig_num)/sizeof(*sig_num)];
1285 EXT char *sig_name[];
1287 EXT SV * psig_ptr[];
1288 EXT SV * psig_name[];
1292 EXT unsigned char fold[] = { /* fast case folding table */
1293 0, 1, 2, 3, 4, 5, 6, 7,
1294 8, 9, 10, 11, 12, 13, 14, 15,
1295 16, 17, 18, 19, 20, 21, 22, 23,
1296 24, 25, 26, 27, 28, 29, 30, 31,
1297 32, 33, 34, 35, 36, 37, 38, 39,
1298 40, 41, 42, 43, 44, 45, 46, 47,
1299 48, 49, 50, 51, 52, 53, 54, 55,
1300 56, 57, 58, 59, 60, 61, 62, 63,
1301 64, 'a', 'b', 'c', 'd', 'e', 'f', 'g',
1302 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
1303 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
1304 'x', 'y', 'z', 91, 92, 93, 94, 95,
1305 96, 'A', 'B', 'C', 'D', 'E', 'F', 'G',
1306 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
1307 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
1308 'X', 'Y', 'Z', 123, 124, 125, 126, 127,
1309 128, 129, 130, 131, 132, 133, 134, 135,
1310 136, 137, 138, 139, 140, 141, 142, 143,
1311 144, 145, 146, 147, 148, 149, 150, 151,
1312 152, 153, 154, 155, 156, 157, 158, 159,
1313 160, 161, 162, 163, 164, 165, 166, 167,
1314 168, 169, 170, 171, 172, 173, 174, 175,
1315 176, 177, 178, 179, 180, 181, 182, 183,
1316 184, 185, 186, 187, 188, 189, 190, 191,
1317 192, 193, 194, 195, 196, 197, 198, 199,
1318 200, 201, 202, 203, 204, 205, 206, 207,
1319 208, 209, 210, 211, 212, 213, 214, 215,
1320 216, 217, 218, 219, 220, 221, 222, 223,
1321 224, 225, 226, 227, 228, 229, 230, 231,
1322 232, 233, 234, 235, 236, 237, 238, 239,
1323 240, 241, 242, 243, 244, 245, 246, 247,
1324 248, 249, 250, 251, 252, 253, 254, 255
1327 EXT unsigned char fold[];
1331 EXT unsigned char freq[] = { /* letter frequencies for mixed English/C */
1332 1, 2, 84, 151, 154, 155, 156, 157,
1333 165, 246, 250, 3, 158, 7, 18, 29,
1334 40, 51, 62, 73, 85, 96, 107, 118,
1335 129, 140, 147, 148, 149, 150, 152, 153,
1336 255, 182, 224, 205, 174, 176, 180, 217,
1337 233, 232, 236, 187, 235, 228, 234, 226,
1338 222, 219, 211, 195, 188, 193, 185, 184,
1339 191, 183, 201, 229, 181, 220, 194, 162,
1340 163, 208, 186, 202, 200, 218, 198, 179,
1341 178, 214, 166, 170, 207, 199, 209, 206,
1342 204, 160, 212, 216, 215, 192, 175, 173,
1343 243, 172, 161, 190, 203, 189, 164, 230,
1344 167, 248, 227, 244, 242, 255, 241, 231,
1345 240, 253, 169, 210, 245, 237, 249, 247,
1346 239, 168, 252, 251, 254, 238, 223, 221,
1347 213, 225, 177, 197, 171, 196, 159, 4,
1348 5, 6, 8, 9, 10, 11, 12, 13,
1349 14, 15, 16, 17, 19, 20, 21, 22,
1350 23, 24, 25, 26, 27, 28, 30, 31,
1351 32, 33, 34, 35, 36, 37, 38, 39,
1352 41, 42, 43, 44, 45, 46, 47, 48,
1353 49, 50, 52, 53, 54, 55, 56, 57,
1354 58, 59, 60, 61, 63, 64, 65, 66,
1355 67, 68, 69, 70, 71, 72, 74, 75,
1356 76, 77, 78, 79, 80, 81, 82, 83,
1357 86, 87, 88, 89, 90, 91, 92, 93,
1358 94, 95, 97, 98, 99, 100, 101, 102,
1359 103, 104, 105, 106, 108, 109, 110, 111,
1360 112, 113, 114, 115, 116, 117, 119, 120,
1361 121, 122, 123, 124, 125, 126, 127, 128,
1362 130, 131, 132, 133, 134, 135, 136, 137,
1363 138, 139, 141, 142, 143, 144, 145, 146
1366 EXT unsigned char freq[];
1371 EXT char* block_type[] = {
1380 EXT char* block_type[];
1384 /*****************************************************************************/
1385 /* This lexer/parser stuff is currently global since yacc is hard to reenter */
1386 /*****************************************************************************/
1387 /* XXX This needs to be revisited, since BEGIN makes yacc re-enter... */
1400 EXT U32 lex_state; /* next token is determined */
1401 EXT U32 lex_defer; /* state after determined token */
1402 EXT expectation lex_expect; /* expect after determined token */
1403 EXT I32 lex_brackets; /* bracket count */
1404 EXT I32 lex_formbrack; /* bracket count at outer format level */
1405 EXT I32 lex_fakebrack; /* outer bracket is mere delimiter */
1406 EXT I32 lex_casemods; /* casemod count */
1407 EXT I32 lex_dojoin; /* doing an array interpolation */
1408 EXT I32 lex_starts; /* how many interps done on level */
1409 EXT SV * lex_stuff; /* runtime pattern from m// or s/// */
1410 EXT SV * lex_repl; /* runtime replacement from s/// */
1411 EXT OP * lex_op; /* extra info to pass back on op */
1412 EXT OP * lex_inpat; /* in pattern $) and $| are special */
1413 EXT I32 lex_inwhat; /* what kind of quoting are we in */
1414 EXT char * lex_brackstack; /* what kind of brackets to pop */
1415 EXT char * lex_casestack; /* what kind of case mods in effect */
1417 /* What we know when we're in LEX_KNOWNEXT state. */
1418 EXT YYSTYPE nextval[5]; /* value of next token, if any */
1419 EXT I32 nexttype[5]; /* type of next token */
1422 EXT PerlIO * VOL rsfp INIT(Nullfp);
1425 EXT char * oldbufptr;
1426 EXT char * oldoldbufptr;
1428 EXT expectation expect INIT(XSTATE); /* how to interpret ambiguous tokens */
1429 EXT AV * rsfp_filters;
1431 EXT I32 multi_start; /* 1st line of multi-line string */
1432 EXT I32 multi_end; /* last line of multi-line string */
1433 EXT I32 multi_open; /* delimiter of said string */
1434 EXT I32 multi_close; /* delimiter of said string */
1437 EXT I32 error_count; /* how many errors so far, max 10 */
1438 EXT I32 subline; /* line this subroutine began on */
1439 EXT SV * subname; /* name of current subroutine */
1441 EXT CV * compcv; /* currently compiling subroutine */
1442 EXT AV * comppad; /* storage for lexically scoped temporaries */
1443 EXT AV * comppad_name; /* variable names for "my" variables */
1444 EXT I32 comppad_name_fill;/* last "introduced" variable offset */
1445 EXT I32 comppad_name_floor;/* start of vars in innermost block */
1446 EXT I32 min_intro_pending;/* start of vars to introduce */
1447 EXT I32 max_intro_pending;/* end of vars to introduce */
1448 EXT I32 padix; /* max used index in current "register" pad */
1449 EXT I32 padix_floor; /* how low may inner block reset padix */
1450 EXT I32 pad_reset_pending; /* reset pad on next attempted alloc */
1453 EXT I32 thisexpr; /* name id for nothing_in_common() */
1454 EXT char * last_uni; /* position of last named-unary operator */
1455 EXT char * last_lop; /* position of last list operator */
1456 EXT OPCODE last_lop_op; /* last list operator */
1457 EXT bool in_my; /* we're compiling a "my" declaration */
1459 EXT I32 cryptseen; /* has fast crypt() been initialized? */
1462 EXT U32 hints; /* various compilation flags */
1464 /* Note: the lowest 8 bits are reserved for
1465 stuffing into op->op_private */
1466 #define HINT_INTEGER 0x00000001
1467 #define HINT_STRICT_REFS 0x00000002
1469 #define HINT_BLOCK_SCOPE 0x00000100
1470 #define HINT_STRICT_SUBS 0x00000200
1471 #define HINT_STRICT_VARS 0x00000400
1472 #define HINT_STRICT_UNTIE 0x00000800
1474 /**************************************************************************/
1475 /* This regexp stuff is global since it always happens within 1 expr eval */
1476 /**************************************************************************/
1478 EXT char * regprecomp; /* uncompiled string. */
1479 EXT char * regparse; /* Input-scan pointer. */
1480 EXT char * regxend; /* End of input for compile */
1481 EXT I32 regnpar; /* () count. */
1482 EXT char * regcode; /* Code-emit pointer; ®dummy = don't. */
1483 EXT I32 regsize; /* Code size. */
1484 EXT I32 regnaughty; /* How bad is this pattern? */
1485 EXT I32 regsawback; /* Did we see \1, ...? */
1487 EXT char * reginput; /* String-input pointer. */
1488 EXT char * regbol; /* Beginning of input, for ^ check. */
1489 EXT char * regeol; /* End of input, for $ check. */
1490 EXT char ** regstartp; /* Pointer to startp array. */
1491 EXT char ** regendp; /* Ditto for endp. */
1492 EXT U32 * reglastparen; /* Similarly for lastparen. */
1493 EXT char * regtill; /* How far we are required to go. */
1494 EXT U16 regflags; /* are we folding, multilining? */
1495 EXT char regprev; /* char before regbol, \n if none */
1497 EXT bool do_undump; /* -u or dump seen? */
1500 /***********************************************/
1501 /* Global only to current interpreter instance */
1502 /***********************************************/
1507 struct interpreter {
1510 #define IINIT(x) INIT(x)
1513 /* pseudo environmental stuff */
1515 IEXT char ** Iorigargv;
1519 IEXT char * Iorigfilename;
1521 IEXT SV * Iwarnhook;
1522 IEXT SV * Iparsehook;
1524 /* Various states of an input record separator SV (rs, nrs) */
1525 #define RsSNARF(sv) (! SvOK(sv))
1526 #define RsSIMPLE(sv) (SvOK(sv) && SvCUR(sv))
1527 #define RsPARA(sv) (SvOK(sv) && ! SvCUR(sv))
1532 IEXT char Ipatchlevel[10];
1533 IEXT char ** Ilocalpatches;
1535 IEXT char * Isplitstr IINIT(" ");
1536 IEXT bool Ipreprocess;
1542 IEXT bool Idoswitches;
1544 IEXT bool Idoextract;
1545 IEXT bool Isawampersand; /* must save all match strings */
1546 IEXT bool Isawstudy; /* do fbm_instr on all strings */
1547 IEXT bool Isawi; /* study must assume case insensitive */
1550 IEXT char * Iinplace;
1551 IEXT char * Ie_tmpname;
1552 IEXT PerlIO * Ie_fp;
1554 /* This value may be raised by extensions for testing purposes */
1555 IEXT int Iperl_destruct_level; /* 0=none, 1=full, 2=full with checks */
1557 /* magical thingies */
1558 IEXT Time_t Ibasetime; /* $^T */
1559 IEXT SV * Iformfeed; /* $^L */
1560 IEXT char * Ichopset IINIT(" \n-"); /* $: */
1561 IEXT SV * Irs; /* $/ */
1562 IEXT char * Iofs; /* $, */
1563 IEXT STRLEN Iofslen;
1564 IEXT char * Iors; /* $\ */
1565 IEXT STRLEN Iorslen;
1566 IEXT char * Iofmt; /* $# */
1567 IEXT I32 Imaxsysfd IINIT(MAXSYSFD); /* top fd to pass to subprocesses */
1568 IEXT int Imultiline; /* $*--do strings hold >1 line? */
1569 IEXT U32 Istatusvalue; /* $? */
1571 IEXT struct stat Istatcache; /* _ */
1573 IEXT SV * Istatname IINIT(Nullsv);
1575 /* shortcuts to various I/O objects */
1577 IEXT GV * Ilast_in_gv;
1580 IEXT GV * Idefoutgv;
1581 IEXT GV * Iargvoutgv;
1583 /* shortcuts to regexp stuff */
1587 IEXT PMOP * Icurpm; /* what to do \ interps from */
1588 IEXT I32 * Iscreamfirst;
1589 IEXT I32 * Iscreamnext;
1590 IEXT I32 Imaxscream IINIT(-1);
1591 IEXT SV * Ilastscream;
1593 /* shortcuts to misc objects */
1596 /* shortcuts to debugging objects */
1600 IEXT SV * IDBsingle;
1602 IEXT SV * IDBsignal;
1603 IEXT AV * Ilineary; /* lines of script for debugger */
1604 IEXT AV * Idbargs; /* args to call listed by caller function */
1607 IEXT HV * Idefstash; /* main symbol table */
1608 IEXT HV * Icurstash; /* symbol table for current package */
1609 IEXT HV * Idebstash; /* symbol table for perldb package */
1610 IEXT SV * Icurstname; /* name of current package */
1611 IEXT AV * Ibeginav; /* names of BEGIN subroutines */
1612 IEXT AV * Iendav; /* names of END subroutines */
1613 IEXT HV * Istrtab; /* shared string table */
1615 /* memory management */
1616 IEXT SV ** Itmps_stack;
1617 IEXT I32 Itmps_ix IINIT(-1);
1618 IEXT I32 Itmps_floor IINIT(-1);
1620 IEXT I32 Isv_count; /* how many SV* are currently allocated */
1621 IEXT I32 Isv_objcount; /* how many objects are currently allocated */
1622 IEXT SV* Isv_root; /* storage for SVs belonging to interp */
1623 IEXT SV* Isv_arenaroot; /* list of areas for garbage collection */
1625 /* funky return mechanisms */
1626 IEXT I32 Ilastspbase;
1628 IEXT int Iforkprocess; /* so do_open |- can return proc# */
1630 /* subprocess state */
1631 IEXT AV * Ifdpid; /* keep fd-to-pid mappings for my_popen */
1632 IEXT HV * Ipidstatus; /* keep pid-to-status mappings for waitpid */
1634 /* internal state */
1635 IEXT VOL int Iin_eval; /* trap "fatal" errors? */
1636 IEXT OP * Irestartop; /* Are we propagating an error from croak? */
1637 IEXT int Idelaymagic; /* ($<,$>) = ... */
1638 IEXT bool Idirty; /* In the middle of tearing things down? */
1639 IEXT U8 Ilocalizing; /* are we processing a local() list? */
1640 IEXT bool Itainted; /* using variables controlled by $< */
1641 IEXT bool Itainting; /* doing taint checks */
1642 IEXT char * Iop_mask IINIT(NULL); /* masked operations for safe evals */
1646 IEXT I32 Idlmax IINIT(128);
1647 IEXT char * Idebname;
1648 IEXT char * Idebdelim;
1650 /* current interpreter roots */
1652 IEXT OP * Imain_root;
1653 IEXT OP * Imain_start;
1654 IEXT OP * Ieval_root;
1655 IEXT OP * Ieval_start;
1657 /* runtime control stuff */
1658 IEXT COP * VOL Icurcop IINIT(&compiling);
1659 IEXT COP * Icurcopdb IINIT(NULL);
1660 IEXT line_t Icopline IINIT(NOLINE);
1661 IEXT CONTEXT * Icxstack;
1662 IEXT I32 Icxstack_ix IINIT(-1);
1663 IEXT I32 Icxstack_max IINIT(128);
1664 IEXT Sigjmp_buf Itop_env;
1668 IEXT AV * Icurstack; /* THE STACK */
1669 IEXT AV * Imainstack; /* the stack when nothing funny is happening */
1670 IEXT SV ** Imystack_base; /* stack->array_ary */
1671 IEXT SV ** Imystack_sp; /* stack pointer now */
1672 IEXT SV ** Imystack_max; /* stack->array_ary + stack->array_max */
1674 /* format accumulators */
1675 IEXT SV * Iformtarget;
1676 IEXT SV * Ibodytarget;
1677 IEXT SV * Itoptarget;
1679 /* statics moved here for shared library purposes */
1680 IEXT SV Istrchop; /* return value from chop */
1681 IEXT int Ifilemode; /* so nextargv() can preserve mode */
1682 IEXT int Ilastfd; /* what to preserve mode on */
1683 IEXT char * Ioldname; /* what to preserve mode on */
1684 IEXT char ** IArgv; /* stuff to free from do_aexec, vfork safe */
1685 IEXT char * ICmd; /* stuff to free from do_aexec, vfork safe */
1686 IEXT OP * Isortcop; /* user defined sort routine */
1687 IEXT HV * Isortstash; /* which is in some package or other */
1688 IEXT GV * Ifirstgv; /* $a */
1689 IEXT GV * Isecondgv; /* $b */
1690 IEXT AV * Isortstack; /* temp stack during pp_sort() */
1691 IEXT AV * Isignalstack; /* temp stack during sighandler() */
1692 IEXT SV * Imystrk; /* temp key string for do_each() */
1693 IEXT I32 Idumplvl; /* indentation level on syntax tree dump */
1694 IEXT PMOP * Ioldlastpm; /* for saving regexp context during debugger */
1695 IEXT I32 Igensym; /* next symbol for getsym() to define */
1696 IEXT bool Ipreambled;
1697 IEXT AV * Ipreambleav;
1698 IEXT int Ilaststatval IINIT(-1);
1699 IEXT I32 Ilaststype IINIT(OP_STAT);
1707 struct interpreter {
1721 #define Perl_sv_setptrobj(rv,ptr,name) Perl_sv_setref_iv(rv,name,(IV)ptr)
1722 #define Perl_sv_setptrref(rv,ptr) Perl_sv_setref_iv(rv,Nullch,(IV)ptr)
1724 #define sv_setptrobj(rv,ptr,name) sv_setref_iv(rv,name,(IV)ptr)
1725 #define sv_setptrref(rv,ptr) sv_setref_iv(rv,Nullch,(IV)ptr)
1732 /* The following must follow proto.h */
1735 EXT MGVTBL vtbl_sv = {magic_get,
1739 EXT MGVTBL vtbl_env = {0, 0, 0, 0, 0};
1740 EXT MGVTBL vtbl_envelem = {0, magic_setenv,
1743 EXT MGVTBL vtbl_sig = {0, 0, 0, 0, 0};
1744 EXT MGVTBL vtbl_sigelem = {magic_getsig,
1748 EXT MGVTBL vtbl_pack = {0, 0, 0, magic_wipepack,
1750 EXT MGVTBL vtbl_packelem = {magic_getpack,
1754 EXT MGVTBL vtbl_dbline = {0, magic_setdbline,
1756 EXT MGVTBL vtbl_isa = {0, magic_setisa,
1758 EXT MGVTBL vtbl_isaelem = {0, magic_setisa,
1760 EXT MGVTBL vtbl_arylen = {magic_getarylen,
1763 EXT MGVTBL vtbl_glob = {magic_getglob,
1766 EXT MGVTBL vtbl_mglob = {0, magic_setmglob,
1768 EXT MGVTBL vtbl_taint = {magic_gettaint,magic_settaint,
1770 EXT MGVTBL vtbl_substr = {0, magic_setsubstr,
1772 EXT MGVTBL vtbl_vec = {0, magic_setvec,
1774 EXT MGVTBL vtbl_pos = {magic_getpos,
1777 EXT MGVTBL vtbl_bm = {0, magic_setbm,
1779 EXT MGVTBL vtbl_uvar = {magic_getuvar,
1784 EXT MGVTBL vtbl_amagic = {0, magic_setamagic,
1785 0, 0, magic_setamagic};
1786 EXT MGVTBL vtbl_amagicelem = {0, magic_setamagic,
1787 0, 0, magic_setamagic};
1788 #endif /* OVERLOAD */
1792 EXT MGVTBL vtbl_env;
1793 EXT MGVTBL vtbl_envelem;
1794 EXT MGVTBL vtbl_sig;
1795 EXT MGVTBL vtbl_sigelem;
1796 EXT MGVTBL vtbl_pack;
1797 EXT MGVTBL vtbl_packelem;
1798 EXT MGVTBL vtbl_dbline;
1799 EXT MGVTBL vtbl_isa;
1800 EXT MGVTBL vtbl_isaelem;
1801 EXT MGVTBL vtbl_arylen;
1802 EXT MGVTBL vtbl_glob;
1803 EXT MGVTBL vtbl_mglob;
1804 EXT MGVTBL vtbl_taint;
1805 EXT MGVTBL vtbl_substr;
1806 EXT MGVTBL vtbl_vec;
1807 EXT MGVTBL vtbl_pos;
1809 EXT MGVTBL vtbl_uvar;
1812 EXT MGVTBL vtbl_amagic;
1813 EXT MGVTBL vtbl_amagicelem;
1814 #endif /* OVERLOAD */
1819 EXT long amagic_generation;
1821 #define NofAMmeth 29
1823 EXT char * AMG_names[NofAMmeth][2] = {
1825 {"bool", "nomethod"},
1855 EXT char * AMG_names[NofAMmeth][2];
1856 #endif /* def INITAMAGIC */
1861 CV* table[NofAMmeth*2];
1864 typedef struct am_table AMT;
1866 #define AMGfallNEVER 1
1868 #define AMGfallYES 3
1871 fallback_amg, abs_amg,
1872 bool__amg, nomethod_amg,
1873 string_amg, numer_amg,
1874 add_amg, add_ass_amg,
1875 subtr_amg, subtr_ass_amg,
1876 mult_amg, mult_ass_amg,
1877 div_amg, div_ass_amg,
1878 mod_amg, mod_ass_amg,
1879 pow_amg, pow_ass_amg,
1880 lshift_amg, lshift_ass_amg,
1881 rshift_amg, rshift_ass_amg,
1882 band_amg, band_ass_amg,
1883 bor_amg, bor_ass_amg,
1884 bxor_amg, bxor_ass_amg,
1897 repeat_amg, repeat_ass_amg,
1898 concat_amg, concat_ass_amg,
1901 #endif /* OVERLOAD */
1903 #if !defined(PERLIO_IS_STDIO) && defined(HAS_ATTRIBUTE)
1905 * Now we have __attribute__ out of the way
1908 #define printf PerlIO_stdoutf
1911 #endif /* Include guard */