Ruby 2.0.0p247(2013-06-27revision41674)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

re.h
Go to the documentation of this file.
1 /**********************************************************************
2
3 re.h -
4
5 $Author: nobu $
6 created at: Thu Sep 30 14:18:32 JST 1993
7
8 Copyright (C) 1993-2007 Yukihiro Matsumoto
9
10 **********************************************************************/
11
12 #ifndef RUBY_RE_H
13 #define RUBY_RE_H 1
14
15 #if defined(__cplusplus)
16 extern "C" {
17 #if 0
18 } /* satisfy cc-mode */
19 #endif
20 #endif
21
22 #include <sys/types.h>
23 #include <stdio.h>
24
25 #include "ruby/regex.h"
26
27 #if defined __GNUC__ && __GNUC__ >= 4
28 #pragma GCC visibility push(default)
29 #endif
30
31 typedef struct re_pattern_buffer Regexp;
32
33 struct rmatch_offset {
34 long beg;
35 long end;
36 };
37
38 struct rmatch {
39 struct re_registers regs;
40
41 int char_offset_updated;
42 int char_offset_num_allocated;
43 struct rmatch_offset *char_offset;
44 };
45
46 struct RMatch {
47 struct RBasic basic;
48 VALUE str;
49 struct rmatch *rmatch;
50 VALUE regexp; /* RRegexp */
51 };
52
53 #define RMATCH(obj) (R_CAST(RMatch)(obj))
54 #define RMATCH_REGS(obj) (&(R_CAST(RMatch)(obj))->rmatch->regs)
55
56 VALUE rb_reg_regcomp(VALUE);
57 long rb_reg_search(VALUE, VALUE, long, int);
58 VALUE rb_reg_regsub(VALUE, VALUE, struct re_registers *, VALUE);
59 long rb_reg_adjust_startpos(VALUE, VALUE, long, int);
60 void rb_match_busy(VALUE);
61 VALUE rb_reg_quote(VALUE);
62 regex_t *rb_reg_prepare_re(VALUE re, VALUE str);
63
64 #if defined __GNUC__ && __GNUC__ >= 4
65 #pragma GCC visibility pop
66 #endif
67
68 #if defined(__cplusplus)
69 #if 0
70 { /* satisfy cc-mode */
71 #endif
72 } /* extern "C" { */
73 #endif
74
75 #endif /* RUBY_RE_H */
76