strscan.c: use new Oniguruma API.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kosako 2005-02-28 13:04:28 +00:00
Родитель 4200ee6e69
Коммит f4900ea772
2 изменённых файлов: 14 добавлений и 13 удалений

Просмотреть файл

@ -1,3 +1,11 @@
Mon Feb 28 21:55:49 2005 K.Kosako <sndgk393 AT ybb.ne.jp>
* ext/strscan/strscan.c (strscan_s_allocate):
use onig_region_init().
* ext/strscan/strscan.c (adjust_registers_to_matched):
use onig_region_set().
Mon Feb 28 15:12:06 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/socket/socket.c (Init_socket): ported more Socket::Constants
@ -12,7 +20,7 @@ Sun Feb 27 05:55:38 2005 Minero Aoki <aamine@loveruby.net>
* parse.y [ripper]: fix typo. [ruby-core:04494]
Sat Feb 26 16:58:20 2005 K.Kosako <sndgk393@ybb.ne.jp>
Sat Feb 26 16:58:20 2005 K.Kosako <sndgk393 AT ybb.ne.jp>
* parse.y, re.c, regex.h, LEGAL, ext/strscan/strscan.c:
remove oniggnu.h (GNU regex API).
@ -121,11 +129,11 @@ Sat Feb 19 01:28:56 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/bigdecimal/lib/bigdecimal/nlsolve.rb: removed because this file
is sample script and same file exists in ext/bigdecimal/sample.
Thu Feb 17 22:15:34 2005 K.Kosako <sndgk@ybb.ne.jp>
Thu Feb 17 22:15:34 2005 K.Kosako <sndgk393 AT ybb.ne.jp>
* ext/strscan/strscan.c: calls Oniguruma API directly.
Thu Feb 17 21:53:12 2005 K.Kosako <sndgk@ybb.ne.jp>
Thu Feb 17 21:53:12 2005 K.Kosako <sndgk393 AT ybb.ne.jp>
* common.mk, LEGAL: remove reggnu.c.

Просмотреть файл

@ -185,7 +185,7 @@ strscan_s_allocate(klass)
p = ALLOC(struct strscanner);
MEMZERO(p, struct strscanner, 1);
CLEAR_MATCH_STATUS(p);
MEMZERO(&(p->regs), struct re_registers, 1);
onig_region_init(&(p->regs));
p->str = Qnil;
return Data_Wrap_Struct(klass, strscan_mark, strscan_free, p);
}
@ -678,19 +678,12 @@ strscan_search_full(self, re, s, f)
return strscan_do_scan(self, re, RTEST(s), RTEST(f), 0);
}
/* DANGEROUS; need to synchronize with regex.c */
static void
adjust_registers_to_matched(p)
struct strscanner *p;
{
if (p->regs.allocated == 0) {
p->regs.beg = ALLOC_N(int, ONIG_NREGION);
p->regs.end = ALLOC_N(int, ONIG_NREGION);
p->regs.allocated = ONIG_NREGION;
}
p->regs.num_regs = 1;
p->regs.beg[0] = 0;
p->regs.end[0] = p->curr - p->prev;
onig_region_clear(&(p->regs));
onig_region_set(&(p->regs), 0, 0, p->curr - p->prev);
}
/*