X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/61fc5122f0d8a509834282b8ecb3252d2e4c9f5d..6a080ccd8f8cbc284cf83658040e98d0247adca6:/perl.h?ds=sidebyside diff --git a/perl.h b/perl.h index bf49279..59df0aa 100644 --- a/perl.h +++ b/perl.h @@ -140,6 +140,18 @@ # define EXTERN_C extern #endif +/* Fallback definitions in case we don't have definitions from config.h. + This should only matter for systems that don't use Configure and + haven't been modified to define PERL_STATIC_INLINE yet. +*/ +#if !defined(PERL_STATIC_INLINE) +# ifdef HAS_STATIC_INLINE +# define PERL_STATIC_INLINE static inline +# else +# define PERL_STATIC_INLINE static +# endif +#endif + #ifdef PERL_GLOBAL_STRUCT # ifndef PERL_GET_VARS # ifdef PERL_GLOBAL_STRUCT_PRIVATE @@ -1310,7 +1322,25 @@ EXTERN_C char *crypt(const char *, const char *); # define SS_NORMAL 0 #endif -#define ERRSV GvSV(PL_errgv) +#define ERRSV GvSVn(PL_errgv) + +#define CLEAR_ERRSV() STMT_START { \ + if (!GvSV(PL_errgv)) { \ + sv_setpvs(GvSV(gv_add_by_type(PL_errgv, SVt_PV)), ""); \ + } else if (SvREADONLY(GvSV(PL_errgv))) { \ + SvREFCNT_dec(GvSV(PL_errgv)); \ + GvSV(PL_errgv) = newSVpvs(""); \ + } else { \ + SV *const errsv = GvSV(PL_errgv); \ + sv_setpvs(errsv, ""); \ + if (SvMAGICAL(errsv)) { \ + mg_free(errsv); \ + } \ + SvPOK_only(errsv); \ + } \ + } STMT_END + + #ifdef PERL_CORE # define DEFSV (0 + GvSVn(PL_defgv)) #else @@ -2367,6 +2397,8 @@ typedef struct padop PADOP; typedef struct pvop PVOP; typedef struct loop LOOP; +typedef struct block_hooks BHK; + typedef struct interpreter PerlInterpreter; /* Amdahl's has struct sv */ @@ -3179,14 +3211,6 @@ typedef pthread_key_t perl_key; # endif #endif -#if !defined(PERL_CORE) && !defined(PERL_NO_SHORT_NAMES) -# if defined(PERL_IMPLICIT_CONTEXT) -# define pmflag(a,b) Perl_pmflag(aTHX_ a,b) -# else -# define pmflag Perl_pmflag -# endif -#endif - #ifdef HASATTRIBUTE_DEPRECATED # define __attribute__deprecated__ __attribute__((deprecated)) #endif @@ -3314,6 +3338,7 @@ union any { void* any_ptr; I32 any_i32; IV any_iv; + UV any_uv; long any_long; bool any_bool; void (*any_dptr) (void*); @@ -3414,6 +3439,10 @@ struct nexttoken { #include "warnings.h" #include "utf8.h" +/* these would be in doio.h if there was such a file */ +#define my_stat() my_stat_flags(SV_GMAGIC) +#define my_lstat() my_lstat_flags(SV_GMAGIC) + /* defined in sv.c, but also used in [ach]v.c */ #undef _XPV_HEAD #undef _XPVMG_HEAD @@ -3435,9 +3464,6 @@ 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 */ -/* Keep next first in this structure, because sv_free_arenas take - advantage of this to share code between the pte arenas and the SV - body arenas */ struct ptr_tbl_ent { struct ptr_tbl_ent* next; const void* oldval; @@ -3448,6 +3474,9 @@ struct ptr_tbl { struct ptr_tbl_ent** tbl_ary; UV tbl_max; UV tbl_items; + struct ptr_tbl_arena *tbl_arena; + struct ptr_tbl_ent *tbl_arena_next; + struct ptr_tbl_ent *tbl_arena_end; }; #if defined(iAPX286) || defined(M_I286) || defined(I80286) @@ -3800,8 +3829,10 @@ Gid_t getegid (void); #define DEBUG_SCOPE(where) \ - DEBUG_l(WITH_THR(Perl_deb(aTHX_ "%s scope %ld at %s:%d\n", \ - where, (long)PL_scopestack_ix, __FILE__, __LINE__))); + DEBUG_l( \ + Perl_deb(aTHX_ "%s scope %ld (savestack=%ld) at %s:%d\n", \ + where, (long)PL_scopestack_ix, (long)PL_savestack_ix, \ + __FILE__, __LINE__)); @@ -4176,6 +4207,7 @@ typedef void (CPERLscope(*share_proc_t)) (pTHX_ SV *sv); typedef int (CPERLscope(*thrhook_proc_t)) (pTHX); typedef OP* (CPERLscope(*PPADDR_t)[]) (pTHX); typedef bool (CPERLscope(*destroyable_proc_t)) (pTHX_ SV *sv); +typedef void (CPERLscope(*despatch_signals_proc_t)) (pTHX); /* _ (for $_) must be first in the following list (DEFSV requires it) */ #define THREADSV_NAMES "_123456789&`'+/.,\\\";^-%=|~:\001\005!@" @@ -4755,7 +4787,7 @@ enum { /* pass one of these to get_vtbl */ #define HINT_BLOCK_SCOPE 0x00000100 #define HINT_STRICT_SUBS 0x00000200 /* strict pragma */ #define HINT_STRICT_VARS 0x00000400 /* strict pragma */ -#define HINT_NOT_UNI_8_BIT 0x00000800 /* unicode8bit pragma */ +#define HINT_UNI_8_BIT 0x00000800 /* unicode_strings feature */ /* The HINT_NEW_* constants are used by the overload pragma */ #define HINT_NEW_INTEGER 0x00001000 @@ -4801,7 +4833,13 @@ struct perl_debug_pad { PERL_DEBUG_PAD(i)) /* Enable variables which are pointers to functions */ -typedef void (CPERLscope(*peep_t))(pTHX_ OP* o); +struct peep_next; +typedef void (CPERLscope(*peep_t))(pTHX_ OP* o, struct peep_next *next); +typedef struct peep_next { + peep_t fn; + void *user_data; +} peep_next_t; + typedef regexp*(CPERLscope(*regcomp_t)) (pTHX_ char* exp, char* xend, PMOP* pm); typedef I32 (CPERLscope(*regexec_t)) (pTHX_ regexp* prog, char* stringarg, char* strend, char* strbeg, I32 minend, @@ -4862,6 +4900,10 @@ typedef struct exitlistentry { STRINGIFY(PERL_VERSION) "." \ STRINGIFY(PERL_SUBVERSION) +#define PERL_API_VERSION_STRING STRINGIFY(PERL_API_REVISION) "." \ + STRINGIFY(PERL_API_VERSION) "." \ + STRINGIFY(PERL_API_SUBVERSION) + #ifdef PERL_GLOBAL_STRUCT struct perl_vars { # include "perlvars.h" @@ -5012,6 +5054,19 @@ START_EXTERN_C * not the same beast. ANSI doesn't allow the assignment from one to the other. * (although most, but not all, compilers are prepared to do it) */ + +/* args are: + vtable + get + set + len + clear + free + copy + dup + local +*/ + MGVTBL_SET( PL_vtbl_sv, MEMBER_TO_FPTR(Perl_magic_get), @@ -5664,7 +5719,7 @@ typedef struct am_table_short AMTS; #ifndef PERL_MICRO # ifndef PERL_ASYNC_CHECK -# define PERL_ASYNC_CHECK() if (PL_sig_pending) despatch_signals() +# define PERL_ASYNC_CHECK() if (PL_sig_pending) CALL_FPTR(PL_signalhook)(aTHX) # endif #endif @@ -6129,8 +6184,6 @@ extern void moncontrol(int); #endif /* Include guard */ -#define CLEAR_ERRSV() STMT_START { sv_setpvn(ERRSV,"",0); if (SvMAGICAL(ERRSV)) { mg_free(ERRSV); } SvPOK_only(ERRSV); } STMT_END - /* * Local variables: * c-indentation-style: bsd