diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-10-25 18:07:58 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-10-25 18:07:58 +0000 |
commit | 89ca4ac7af707d34da190bf469b8073ada175d9b (patch) | |
tree | e9338f678f71d31acd664a643de302ea3bd3289f /ext/re | |
parent | 4e1a6d261e266112da00fd82e73dbe2a0631027c (diff) | |
download | perl-89ca4ac7af707d34da190bf469b8073ada175d9b.tar.gz |
Integrate changes #12652 and #12653 from maintperl;
more tweaks to change#12626
* move the boilerplate code over to perl.h and make DynaLoader
use it
* make re, Opcode, File::Glob and B threadsafe
* re.xs needed s/deinstall/uninstall/ (guess nobody uses
C<no re;> anywhere)
include XS_VERSION in MY_CXT_KEY (tweak for change#12652)
File::Glob required a bit more work in bleadperl
because of ExtUtils::Constant (see the Makefile.PL change)
p4raw-link: @12652 on //depot/maint-5.6/perl: 3bc8871b91a24662eada2114d9a016153718b1c4
p4raw-link: @12626 on //depot/maint-5.6/perl: 512dcce54ea4db665708f91609bdd0a6126d1acd
p4raw-id: //depot/perl@12654
p4raw-integrated: from //depot/maint-5.6/perl@12650 'edit in'
ext/B/B.xs ext/DynaLoader/dlutils.c (@12652..) 'merge in'
perl.h (@12597..) ext/File/Glob/Glob.xs ext/Opcode/Opcode.xs
ext/re/re.xs (@12652..)
Diffstat (limited to 'ext/re')
-rw-r--r-- | ext/re/re.xs | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/ext/re/re.xs b/ext/re/re.xs index faab0b370b..55f0f75884 100644 --- a/ext/re/re.xs +++ b/ext/re/re.xs @@ -17,42 +17,58 @@ extern char* my_re_intuit_start (pTHX_ regexp *prog, SV *sv, char *strpos, struct re_scream_pos_data_s *data); extern SV* my_re_intuit_string (pTHX_ regexp *prog); -static int oldfl; +#define MY_CXT_KEY "re::_guts"##XS_VERSION + +typedef struct { + int x_oldflag; /* debug flag */ +} my_cxt_t; + +START_MY_CXT + +#define oldflag (MY_CXT.x_oldflag) static void -deinstall(pTHX) +uninstall(pTHX) { + dMY_CXT; PL_regexecp = Perl_regexec_flags; PL_regcompp = Perl_pregcomp; PL_regint_start = Perl_re_intuit_start; PL_regint_string = Perl_re_intuit_string; PL_regfree = Perl_pregfree; - if (!oldfl) + if (!oldflag) PL_debug &= ~DEBUG_r_FLAG; } static void install(pTHX) { + dMY_CXT; PL_colorset = 0; /* Allow reinspection of ENV. */ PL_regexecp = &my_regexec; PL_regcompp = &my_regcomp; PL_regint_start = &my_re_intuit_start; PL_regint_string = &my_re_intuit_string; PL_regfree = &my_regfree; - oldfl = PL_debug & DEBUG_r_FLAG; + oldflag = PL_debug & DEBUG_r_FLAG; PL_debug |= DEBUG_r_FLAG; } MODULE = re PACKAGE = re +BOOT: +{ + MY_CXT_INIT; +} + + void install() CODE: install(aTHX); void -deinstall() +uninstall() CODE: - deinstall(aTHX); + uninstall(aTHX); |