Initial import from FreeBSD RELENG_4:
[dragonfly.git] / contrib / perl5 / ext / re / re.xs
1 /* We need access to debugger hooks */
2 #ifndef DEBUGGING
3 #  define DEBUGGING
4 #endif
5
6 #include "EXTERN.h"
7 #include "perl.h"
8 #include "XSUB.h"
9
10 extern regexp*  my_regcomp _((char* exp, char* xend, PMOP* pm));
11 extern I32      my_regexec _((regexp* prog, char* stringarg, char* strend,
12                               char* strbeg, I32 minend, SV* screamer,
13                               void* data, U32 flags));
14
15 static int oldfl;
16
17 #define R_DB 512
18
19 static void
20 deinstall(void)
21 {
22     dTHR;
23     PL_regexecp = &regexec_flags;
24     PL_regcompp = &pregcomp;
25     if (!oldfl)
26         PL_debug &= ~R_DB;
27 }
28
29 static void
30 install(void)
31 {
32     dTHR;
33     PL_colorset = 0;                    /* Allow reinspection of ENV. */
34     PL_regexecp = &my_regexec;
35     PL_regcompp = &my_regcomp;
36     oldfl = PL_debug & R_DB;
37     PL_debug |= R_DB;
38 }
39
40 MODULE = re     PACKAGE = re
41
42 void
43 install()
44
45 void
46 deinstall()