00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef RUBY_RE_H
00013 #define RUBY_RE_H 1
00014
00015 #if defined(__cplusplus)
00016 extern "C" {
00017 #if 0
00018 }
00019 #endif
00020 #endif
00021
00022 #include <sys/types.h>
00023 #include <stdio.h>
00024
00025 #include "ruby/regex.h"
00026
00027 RUBY_SYMBOL_EXPORT_BEGIN
00028
00029 typedef struct re_pattern_buffer Regexp;
00030
00031 struct rmatch_offset {
00032 long beg;
00033 long end;
00034 };
00035
00036 struct rmatch {
00037 struct re_registers regs;
00038
00039 int char_offset_updated;
00040 int char_offset_num_allocated;
00041 struct rmatch_offset *char_offset;
00042 };
00043
00044 struct RMatch {
00045 struct RBasic basic;
00046 VALUE str;
00047 struct rmatch *rmatch;
00048 VALUE regexp;
00049 };
00050
00051 #define RMATCH(obj) (R_CAST(RMatch)(obj))
00052 #define RMATCH_REGS(obj) (&(R_CAST(RMatch)(obj))->rmatch->regs)
00053
00054 VALUE rb_reg_regcomp(VALUE);
00055 long rb_reg_search(VALUE, VALUE, long, int);
00056 VALUE rb_reg_regsub(VALUE, VALUE, struct re_registers *, VALUE);
00057 long rb_reg_adjust_startpos(VALUE, VALUE, long, int);
00058 void rb_match_busy(VALUE);
00059 VALUE rb_reg_quote(VALUE);
00060 regex_t *rb_reg_prepare_re(VALUE re, VALUE str);
00061
00062 RUBY_SYMBOL_EXPORT_END
00063
00064 #if defined(__cplusplus)
00065 #if 0
00066 {
00067 #endif
00068 }
00069 #endif
00070
00071 #endif
00072