summaryrefslogtreecommitdiff
path: root/ext/strscan
diff options
context:
space:
mode:
authorkosako <kosako@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-17 14:43:38 +0000
committerkosako <kosako@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-17 14:43:38 +0000
commit1034d1407e433b3fa7fe163c87e0b81e9b3f5787 (patch)
tree20becb3f9928aa9573509dc3f6ad1bf0171e9706 /ext/strscan
parent02b8414d98c0cc66b7b3870c26a59dd8c5600cf4 (diff)
remove GNU regex API
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/strscan')
-rw-r--r--ext/strscan/strscan.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/ext/strscan/strscan.c b/ext/strscan/strscan.c
index db1a9c6..158fab3 100644
--- a/ext/strscan/strscan.c
+++ b/ext/strscan/strscan.c
@@ -171,7 +171,7 @@ static void
strscan_free(p)
struct strscanner *p;
{
- re_free_registers(&(p->regs));
+ onig_region_free(&(p->regs), 0);
memset(p, sizeof(struct strscanner), 0);
free(p);
}
@@ -440,17 +440,15 @@ strscan_do_scan(self, regex, succptr, getstr, headonly)
}
strscan_prepare_re(regex);
if (headonly) {
- ret = re_match(RREGEXP(regex)->ptr,
- CURPTR(p), S_RESTLEN(p),
- 0,
- &(p->regs));
+ ret = onig_match(RREGEXP(regex)->ptr, (UChar* )CURPTR(p),
+ (UChar* )(CURPTR(p) + S_RESTLEN(p)),
+ (UChar* )CURPTR(p), &(p->regs), ONIG_OPTION_NONE);
}
else {
- ret = re_search(RREGEXP(regex)->ptr,
- CURPTR(p), S_RESTLEN(p),
- 0,
- S_RESTLEN(p),
- &(p->regs));
+ ret = onig_search(RREGEXP(regex)->ptr,
+ (UChar* )CURPTR(p), (UChar* )(CURPTR(p) + S_RESTLEN(p)),
+ (UChar* )CURPTR(p), (UChar* )(CURPTR(p) + S_RESTLEN(p)),
+ &(p->regs), ONIG_OPTION_NONE);
}
if (ret == -2) rb_raise(ScanError, "regexp buffer overflow");