📄 perl.h
字号:
typedef struct gp GP;typedef struct gv GV;typedef struct io IO;typedef struct context PERL_CONTEXT;typedef struct block BLOCK;typedef struct magic MAGIC;typedef struct xrv XRV;typedef struct xpv XPV;typedef struct xpviv XPVIV;typedef struct xpvuv XPVUV;typedef struct xpvnv XPVNV;typedef struct xpvmg XPVMG;typedef struct xpvlv XPVLV;typedef struct xpvav XPVAV;typedef struct xpvhv XPVHV;typedef struct xpvgv XPVGV;typedef struct xpvcv XPVCV;typedef struct xpvbm XPVBM;typedef struct xpvfm XPVFM;typedef struct xpvio XPVIO;typedef struct mgvtbl MGVTBL;typedef union any ANY;typedef struct ptr_tbl_ent PTR_TBL_ENT_t;typedef struct ptr_tbl PTR_TBL_t;#include "handy.h"#if defined(USE_LARGE_FILES) && !defined(NO_64_BIT_RAWIO)# if LSEEKSIZE == 8 && !defined(USE_64_BIT_RAWIO)# define USE_64_BIT_RAWIO /* implicit */# endif#endif/* Notice the use of HAS_FSEEKO: now we are obligated to always use * fseeko/ftello if possible. Don't go #defining ftell to ftello yourself, * however, because operating systems like to do that themself. */#ifndef FSEEKSIZE# ifdef HAS_FSEEKO# define FSEEKSIZE LSEEKSIZE# else# define FSEEKSIZE LONGSIZE# endif #endif#if defined(USE_LARGE_FILES) && !defined(NO_64_BIT_STDIO)# if FSEEKSIZE == 8 && !defined(USE_64_BIT_STDIO)# define USE_64_BIT_STDIO /* implicit */# endif#endif#ifdef USE_64_BIT_RAWIO# ifdef HAS_OFF64_T# undef Off_t# define Off_t off64_t# undef LSEEKSIZE# define LSEEKSIZE 8# endif/* Most 64-bit environments have defines like _LARGEFILE_SOURCE that * will trigger defines like the ones below. Some 64-bit environments, * however, do not. Therefore we have to explicitly mix and match. */# if defined(USE_OPEN64)# define open open64# endif# if defined(USE_LSEEK64)# define lseek lseek64# else# if defined(USE_LLSEEK)# define lseek llseek# endif# endif# if defined(USE_STAT64)# define stat stat64# endif# if defined(USE_FSTAT64)# define fstat fstat64# endif# if defined(USE_LSTAT64)# define lstat lstat64# endif# if defined(USE_FLOCK64)# define flock flock64# endif# if defined(USE_LOCKF64)# define lockf lockf64# endif# if defined(USE_FCNTL64)# define fcntl fcntl64# endif# if defined(USE_TRUNCATE64)# define truncate truncate64# endif# if defined(USE_FTRUNCATE64)# define ftruncate ftruncate64# endif#endif#ifdef USE_64_BIT_STDIO# ifdef HAS_FPOS64_T# undef Fpos_t# define Fpos_t fpos64_t# endif/* Most 64-bit environments have defines like _LARGEFILE_SOURCE that * will trigger defines like the ones below. Some 64-bit environments, * however, do not. */# if defined(USE_FOPEN64)# define fopen fopen64# endif# if defined(USE_FSEEK64)# define fseek fseek64 /* don't do fseeko here, see perlio.c */# endif# if defined(USE_FTELL64)# define ftell ftell64 /* don't do ftello here, see perlio.c */# endif# if defined(USE_FSETPOS64)# define fsetpos fsetpos64# endif# if defined(USE_FGETPOS64)# define fgetpos fgetpos64# endif# if defined(USE_TMPFILE64)# define tmpfile tmpfile64# endif# if defined(USE_FREOPEN64)# define freopen freopen64# endif#endif#if defined(OS2)# include "iperlsys.h"#endif#if defined(__OPEN_VM)# include "vmesa/vmesaish.h"#endif#ifdef DOSISH# if defined(OS2)# include "os2ish.h"# else# include "dosish.h"# endif#else# if defined(VMS)# include "vmsish.h"# else# if defined(PLAN9)# include "./plan9/plan9ish.h"# else# if defined(MPE)# include "mpeix/mpeixish.h"# else# if defined(__VOS__)# include "vosish.h"# else# if defined(EPOC)# include "epocish.h"# else# if defined(MACOS_TRADITIONAL)# include "macos/macish.h"# ifndef NO_ENVIRON_ARRAY# define NO_ENVIRON_ARRAY# endif# else# include "unixish.h"# endif# endif# endif# endif# endif# endif#endif#ifndef NO_ENVIRON_ARRAY# define USE_ENVIRON_ARRAY#endif#ifdef JPL /* E.g. JPL needs to operate on a copy of the real environment. * JDK 1.2 and 1.3 seem to get upset if the original environment * is diddled with. */# define NEED_ENVIRON_DUP_FOR_MODIFY#endif#ifndef PERL_SYS_INIT3# define PERL_SYS_INIT3(argvp,argcp,envp) PERL_SYS_INIT(argvp,argcp)#endif#ifndef MAXPATHLEN# ifdef PATH_MAX# ifdef _POSIX_PATH_MAX# if PATH_MAX > _POSIX_PATH_MAX/* MAXPATHLEN is supposed to include the final null character, * as opposed to PATH_MAX and _POSIX_PATH_MAX. */# define MAXPATHLEN (PATH_MAX+1)# else# define MAXPATHLEN (_POSIX_PATH_MAX+1)# endif# else# define MAXPATHLEN (PATH_MAX+1)# endif# else# ifdef _POSIX_PATH_MAX# define MAXPATHLEN (_POSIX_PATH_MAX+1)# else# define MAXPATHLEN 1024 /* Err on the large side. */# endif# endif#endif/* * USE_THREADS needs to be after unixish.h as <pthread.h> includes * <sys/signal.h> which defines NSIG - which will stop inclusion of <signal.h> * this results in many functions being undeclared which bothers C++ * May make sense to have threads after "*ish.h" anyway */#if defined(USE_THREADS) || defined(USE_ITHREADS)# if defined(USE_THREADS) /* pending resolution of licensing issues, we avoid the erstwhile * atomic.h everywhere */# define EMULATE_ATOMIC_REFCOUNTS# endif# ifdef FAKE_THREADS# include "fakethr.h"# else# ifdef WIN32# include <win32thread.h># else# ifdef OS2# include "os2thread.h"# else# ifdef I_MACH_CTHREADS# include <mach/cthreads.h># if (defined(NeXT) || defined(__NeXT__)) && defined(PERL_POLLUTE_MALLOC)# define MUTEX_INIT_CALLS_MALLOC# endiftypedef cthread_t perl_os_thread;typedef mutex_t perl_mutex;typedef condition_t perl_cond;typedef void * perl_key;# else /* Posix threads */# ifdef I_PTHREAD# include <pthread.h># endiftypedef pthread_t perl_os_thread;typedef pthread_mutex_t perl_mutex;typedef pthread_cond_t perl_cond;typedef pthread_key_t perl_key;# endif /* I_MACH_CTHREADS */# endif /* OS2 */# endif /* WIN32 */# endif /* FAKE_THREADS */#endif /* USE_THREADS || USE_ITHREADS */#ifdef WIN32# include "win32.h"#endif#ifdef VMS# define STATUS_NATIVE PL_statusvalue_vms# define STATUS_NATIVE_EXPORT \ (((I32)PL_statusvalue_vms == -1 ? 44 : PL_statusvalue_vms) | (VMSISH_HUSHED ? 0x10000000 : 0))# define STATUS_NATIVE_SET(n) \ STMT_START { \ PL_statusvalue_vms = (n); \ if ((I32)PL_statusvalue_vms == -1) \ PL_statusvalue = -1; \ else if (PL_statusvalue_vms & STS$M_SUCCESS) \ PL_statusvalue = 0; \ else if ((PL_statusvalue_vms & STS$M_SEVERITY) == 0) \ PL_statusvalue = 1 << 8; \ else \ PL_statusvalue = (PL_statusvalue_vms & STS$M_SEVERITY) << 8; \ } STMT_END# define STATUS_POSIX PL_statusvalue# ifdef VMSISH_STATUS# define STATUS_CURRENT (VMSISH_STATUS ? STATUS_NATIVE : STATUS_POSIX)# else# define STATUS_CURRENT STATUS_POSIX# endif# define STATUS_POSIX_SET(n) \ STMT_START { \ PL_statusvalue = (n); \ if (PL_statusvalue != -1) { \ PL_statusvalue &= 0xFFFF; \ PL_statusvalue_vms = PL_statusvalue ? 44 : 1; \ } \ else PL_statusvalue_vms = -1; \ } STMT_END# 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 STATUS_NATIVE_SET STATUS_POSIX_SET# define STATUS_POSIX PL_statusvalue# define STATUS_POSIX_SET(n) \ STMT_START { \ PL_statusvalue = (n); \ if (PL_statusvalue != -1) \ PL_statusvalue &= 0xFFFF; \ } STMT_END# define STATUS_CURRENT STATUS_POSIX# define STATUS_ALL_SUCCESS (PL_statusvalue = 0)# define STATUS_ALL_FAILURE (PL_statusvalue = 1)#endif/* flags in PL_exit_flags for nature of exit() */#define PERL_EXIT_EXPECTED 0x01#ifndef MEMBER_TO_FPTR# define MEMBER_TO_FPTR(name) name#endif/* format to use for version numbers in file/directory names *//* XXX move to Configure? */#ifndef PERL_FS_VER_FMT# define PERL_FS_VER_FMT "%d.%d.%d"#endif/* This defines a way to flush all output buffers. This may be a * performance issue, so we allow people to disable it. */#ifndef PERL_FLUSHALL_FOR_CHILD# if defined(FFLUSH_NULL) || defined(USE_SFIO)# define PERL_FLUSHALL_FOR_CHILD PerlIO_flush((PerlIO*)NULL)# else# ifdef FFLUSH_ALL# define PERL_FLUSHALL_FOR_CHILD my_fflush_all()# else# define PERL_FLUSHALL_FOR_CHILD NOOP# endif# endif#endif#ifndef PERL_WAIT_FOR_CHILDREN# define PERL_WAIT_FOR_CHILDREN NOOP#endif/* the traditional thread-unsafe notion of "current interpreter". */#ifndef PERL_SET_INTERP# define PERL_SET_INTERP(i) (PL_curinterp = (PerlInterpreter*)(i))#endif#ifndef PERL_GET_INTERP# define PERL_GET_INTERP (PL_curinterp)#endif#if defined(PERL_IMPLICIT_CONTEXT) && !defined(PERL_GET_THX)# ifdef USE_THREADS# define PERL_GET_THX ((struct perl_thread *)PERL_GET_CONTEXT)# else# ifdef MULTIPLICITY# define PERL_GET_THX ((PerlInterpreter *)PERL_GET_CONTEXT)# else# ifdef PERL_OBJECT# define PERL_GET_THX ((CPerlObj *)PERL_GET_CONTEXT)# endif# endif# endif# define PERL_SET_THX(t) PERL_SET_CONTEXT(t)#endif#ifndef SVf# ifdef CHECK_FORMAT# define SVf "p"# else# define SVf "_"# endif #endif#ifndef UVf# ifdef CHECK_FORMAT# define UVf UVuf# else# define UVf "Vu"# endif #endif#ifndef VDf# ifdef CHECK_FORMAT# define VDf "p"# else# define VDf "vd"# endif #endif/* Some unistd.h's give a prototype for pause() even though HAS_PAUSE ends up undefined. This causes the #define below to be rejected by the compiler. Sigh.*/#ifdef HAS_PAUSE#define Pause pause#else#define Pause() sleep((32767<<16)+32767)#endif#ifndef IOCPARM_LEN# ifdef IOCPARM_MASK /* on BSDish systes we're safe */# define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK)# else /* otherwise guess at what's safe */# define IOCPARM_LEN(x) 256# endif#endif#if defined(__CYGWIN__) || defined(__MSYS__)/* USEMYBINMODE * This symbol, if defined, indicates that the program should * use the routine my_binmode(FILE *fp, char iotype, int mode) to insure * that a file is in "binary" mode -- that is, that no translation * of bytes occurs on read or write operations. */# define USEMYBINMODE / **/# define my_binmode(fp, iotype, mode) \ (PerlLIO_setmode(PerlIO_fileno(fp), mode) != -1 ? TRUE : FALSE)#endif#ifdef UNION_ANY_DEFINITIONUNION_ANY_DEFINITION;#elseunion any { void* any_ptr; I32 any_i32; IV any_iv; long any_long; void (*any_dptr) (void*); void (*any_dxptr) (pTHXo_ void*);};#endif#ifdef USE_THREADS#define ARGSproto struct perl_thread *thr#else#define ARGSproto#endif /* USE_THREADS */typedef I32 (*filter_t) (pTHXo_ int, SV *, int);#define FILTER_READ(idx, sv, len) filter_read(idx, sv, len)#define FILTER_DATA(idx) (AvARRAY(PL_rsfp_filters)[idx])#define FILTER_ISREADER(idx) (idx >= AvFILLp(PL_rsfp_filters))#if !defined(OS2)# include "iperlsys.h"#endif#include "regexp.h"#include "sv.h"#include "util.h"#include "form.h"#include "gv.h"#include "cv.h"#include "opnames.h"#include "op.h"#include "cop.h"#include "av.h"#include "hv.h"#include "mg.h"#include "scope.h"#include "warnings.h"#include "utf8.h"/* Current curly descriptor */typedef struct curcur CURCUR;struct curcur { int parenfloor; /* how far back to strip paren data */ int cur; /* how many instances of scan we've matched */ int min; /* the minimal number of scans to match */ int max; /* the maximal number of scans to match */ int minmod; /* whether to work our way up or down */ regnode * scan; /* the thing to match */ regnode * next; /* what has to match after it */ char * lastloc; /* where we started matching this scan */ CURCUR * oldcc; /* current curly before we started this one */};typedef struct _sublex_info SUBLEXINFO;struct _sublex_info { I32 super_state; /* lexer state to save */ I32 sub_inwhat; /* "lex_inwhat" to use */ OP *sub_op; /* "lex_op" to use */ char *super_bufptr; /* PL_bufptr that was */ char *super_bufend; /* PL_bufend that was */};typedef struct magic_state MGS; /* struct magic_state defined in mg.c */struct scan_data_t; /* Used in S_* functions in regcomp.c */struct regnode_charclass_class; /* Used in S_* functions in regcomp.c */typedef I32 CHECKPOINT;struct ptr_tbl_ent { struct ptr_tbl_ent* next; void* oldval; void* newval;};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -