Given that @optype and @specialsv_name are hard coded tables, it seems
[p5sagit/p5-mst-13.2.git] / regexp.h
index bb73dab..faec656 100644 (file)
--- a/regexp.h
+++ b/regexp.h
@@ -112,20 +112,27 @@ typedef struct re_scream_pos_data_s
  * Any regex engine implementation must be able to build one of these.
  */
 typedef struct regexp_engine {
-    regexp* (*comp) (pTHX_ char* exp, char* xend, PMOP* pm);
-    I32            (*exec) (pTHX_ regexp* prog, char* stringarg, char* strend,
-                           char* strbeg, I32 minend, SV* screamer,
-                           void* data, U32 flags);
-    char*   (*intuit) (pTHX_ regexp *prog, SV *sv, char *strpos,
-                           char *strend, U32 flags,
-                           struct re_scream_pos_data_s *data);
-    SV*            (*checkstr) (pTHX_ regexp *prog);
-    void    (*free) (pTHX_ struct regexp* r);
-    SV*     (*numbered_buff_get) (pTHX_ const REGEXP * const rx, I32 paren, SV* usesv);
-    SV*     (*named_buff_get)(pTHX_ const REGEXP * const rx, SV* namesv, U32 flags);
+    REGEXP* (*comp) (pTHX_ const SV * const pattern, const U32 flags);
+    I32     (*exec) (pTHX_ REGEXP * const rx, char* stringarg, char* strend,
+                     char* strbeg, I32 minend, SV* screamer,
+                     void* data, U32 flags);
+    char*   (*intuit) (pTHX_ REGEXP * const rx, SV *sv, char *strpos,
+                       char *strend, const U32 flags,
+                       re_scream_pos_data *data);
+    SV*     (*checkstr) (pTHX_ REGEXP * const rx);
+    void    (*free) (pTHX_ REGEXP * const rx);
+    void    (*numbered_buff_FETCH) (pTHX_ REGEXP * const rx, const I32 paren,
+                             SV * const sv);
+    void    (*numbered_buff_STORE) (pTHX_ REGEXP * const rx, const I32 paren,
+                                   SV const * const value);
+    I32     (*numbered_buff_LENGTH) (pTHX_ REGEXP * const rx, const SV * const sv,
+                                    const I32 paren);
+    SV*     (*named_buff_FETCH) (pTHX_ REGEXP * const rx, SV * const key,
+                                 const U32 flags);
+    SV*     (*qr_package)(pTHX_ REGEXP * const rx);
 #ifdef USE_ITHREADS
-    void* (*dupe) (pTHX_ const regexp *r, CLONE_PARAMS *param);
-#endif    
+    void*   (*dupe) (pTHX_ REGEXP * const rx, CLONE_PARAMS *param);
+#endif
 } regexp_engine;
 
 /* Flags stored in regexp->extflags 
@@ -149,6 +156,7 @@ typedef struct regexp_engine {
 #define RXf_ANCH_SINGLE         (RXf_ANCH_SBOL|RXf_ANCH_GPOS)
 
 /* Flags indicating special patterns */
+#define RXf_SKIPWHITE          0x00000100 /* Pattern is for a split / / */
 #define RXf_START_ONLY         0x00000200 /* Pattern is /^/ */
 #define RXf_WHITE              0x00000400 /* Pattern is /\s+/ */
 
@@ -224,7 +232,8 @@ typedef struct regexp_engine {
 /* Copy and tainted info */
 #define RXf_COPY_DONE          0x10000000
 #define RXf_TAINTED_SEEN       0x20000000
-/* two bits here  */
+#define RXf_TAINTED             0x80000000 /* this pattern is tainted */
+
 
 #define RX_HAS_CUTGROUP(prog) ((prog)->intflags & PREGf_CUTGROUP_SEEN)
 #define RX_MATCH_TAINTED(prog) ((prog)->extflags & RXf_TAINTED_SEEN)