Integrate with Sarathy.
[p5sagit/p5-mst-13.2.git] / ext / re / re.xs
CommitLineData
b9d5759e 1/* We need access to debugger hooks */
2#ifndef DEBUGGING
3# define DEBUGGING
4#endif
5
c5be433b 6#define PERL_NO_GET_CONTEXT
56953603 7#include "EXTERN.h"
8#include "perl.h"
9#include "XSUB.h"
10
cea2e8a9 11extern regexp* my_regcomp (pTHX_ char* exp, char* xend, PMOP* pm);
12extern I32 my_regexec (pTHX_ regexp* prog, char* stringarg, char* strend,
20ce7b12 13 char* strbeg, I32 minend, SV* screamer,
14 void* data, U32 flags);
f722798b 15extern void my_regfree (pTHX_ struct regexp* r);
16extern char* my_re_intuit_start (pTHX_ regexp *prog, SV *sv, char *strpos,
17 char *strend, U32 flags,
18 struct re_scream_pos_data_s *data);
19extern SV* my_re_intuit_string (pTHX_ regexp *prog);
56953603 20
21static int oldfl;
22
23#define R_DB 512
24
25static void
cea2e8a9 26deinstall(pTHX)
56953603 27{
5c0ca799 28 dTHR;
0b94c7bb 29 PL_regexecp = Perl_regexec_flags;
30 PL_regcompp = Perl_pregcomp;
31 PL_regint_start = Perl_re_intuit_start;
32 PL_regint_string = Perl_re_intuit_string;
33 PL_regfree = Perl_pregfree;
f722798b 34
56953603 35 if (!oldfl)
3280af22 36 PL_debug &= ~R_DB;
56953603 37}
38
39static void
cea2e8a9 40install(pTHX)
56953603 41{
5c0ca799 42 dTHR;
285bbc62 43 PL_colorset = 0; /* Allow reinspection of ENV. */
3280af22 44 PL_regexecp = &my_regexec;
45 PL_regcompp = &my_regcomp;
f722798b 46 PL_regint_start = &my_re_intuit_start;
47 PL_regint_string = &my_re_intuit_string;
48 PL_regfree = &my_regfree;
3280af22 49 oldfl = PL_debug & R_DB;
50 PL_debug |= R_DB;
56953603 51}
52
53MODULE = re PACKAGE = re
54
55void
56install()
cea2e8a9 57 CODE:
58 install(aTHX);
56953603 59
60void
61deinstall()
cea2e8a9 62 CODE:
63 deinstall(aTHX);