diff options
Diffstat (limited to 'include/ruby/re.h')
-rw-r--r-- | include/ruby/re.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/ruby/re.h b/include/ruby/re.h index 07c08614da..cc7f6025a7 100644 --- a/include/ruby/re.h +++ b/include/ruby/re.h @@ -26,14 +26,28 @@ extern "C" { typedef struct re_pattern_buffer Regexp; +struct rmatch_offset { + int beg; + int end; +}; + +struct rmatch { + struct re_registers regs; + + int char_offset_updated; + int char_offset_num_allocated; + struct rmatch_offset *char_offset; +}; + struct RMatch { struct RBasic basic; VALUE str; - struct re_registers *regs; + struct rmatch *rmatch; VALUE regexp; /* RRegexp */ }; #define RMATCH(obj) (R_CAST(RMatch)(obj)) +#define RMATCH_REGS(obj) (&(R_CAST(RMatch)(obj))->rmatch->regs) VALUE rb_reg_regcomp(VALUE); int rb_reg_search(VALUE, VALUE, int, int); |