This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.pl: Teach to handle wider range of exprs
[perl5.git] / perl.h
diff --git a/perl.h b/perl.h
index adff169..59df0aa 100644 (file)
--- a/perl.h
+++ b/perl.h
 #  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
@@ -2385,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 <ksync.h> has struct sv */
@@ -3197,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
@@ -3332,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*);
@@ -3432,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
@@ -3453,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;
@@ -3466,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)
@@ -3818,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__));
 
 
 
@@ -4194,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!@"
@@ -4773,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
@@ -4819,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,
@@ -4880,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"
@@ -5030,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),
@@ -5682,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