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 #if defined __GNUC__ && __GNUC__ >= 4
00028 #pragma GCC visibility push(default)
00029 #endif
00030
00031 typedef struct re_pattern_buffer Regexp;
00032
00033 struct rmatch_offset {
00034 long beg;
00035 long end;
00036 };
00037
00038 struct rmatch {
00039 struct re_registers regs;
00040
00041 int char_offset_updated;
00042 int char_offset_num_allocated;
00043 struct rmatch_offset *char_offset;
00044 };
00045
00046 struct RMatch {
00047 struct RBasic basic;
00048 VALUE str;
00049 struct rmatch *rmatch;
00050 VALUE regexp;
00051 };
00052
00053 #define RMATCH(obj) (R_CAST(RMatch)(obj))
00054 #define RMATCH_REGS(obj) (&(R_CAST(RMatch)(obj))->rmatch->regs)
00055
00056 VALUE rb_reg_regcomp(VALUE);
00057 long rb_reg_search(VALUE, VALUE, long, int);
00058 VALUE rb_reg_regsub(VALUE, VALUE, struct re_registers *, VALUE);
00059 long rb_reg_adjust_startpos(VALUE, VALUE, long, int);
00060 void rb_match_busy(VALUE);
00061 VALUE rb_reg_quote(VALUE);
00062 regex_t *rb_reg_prepare_re(VALUE re, VALUE str);
00063
00064 #if defined __GNUC__ && __GNUC__ >= 4
00065 #pragma GCC visibility pop
00066 #endif
00067
00068 #if defined(__cplusplus)
00069 #if 0
00070 {
00071 #endif
00072 }
00073 #endif
00074
00075 #endif
00076