1use bitflags::bitflags;
2use std::os::raw::c_uint;
3
4bitflags! {
5 pub struct RegexOptions: onig_sys::OnigOptionType {
7 const REGEX_OPTION_NONE
9 = onig_sys::ONIG_OPTION_NONE;
10 const REGEX_OPTION_IGNORECASE
12 = onig_sys::ONIG_OPTION_IGNORECASE;
13 const REGEX_OPTION_EXTEND
15 = onig_sys::ONIG_OPTION_EXTEND;
16 const REGEX_OPTION_MULTILINE
18 = onig_sys::ONIG_OPTION_MULTILINE;
19 const REGEX_OPTION_SINGLELINE
21 = onig_sys::ONIG_OPTION_SINGLELINE;
22 const REGEX_OPTION_FIND_LONGEST
24 = onig_sys::ONIG_OPTION_FIND_LONGEST;
25 const REGEX_OPTION_FIND_NOT_EMPTY
27 = onig_sys::ONIG_OPTION_FIND_NOT_EMPTY;
28 const REGEX_OPTION_NEGATE_SINGLELINE
32 = onig_sys::ONIG_OPTION_NEGATE_SINGLELINE;
33 const REGEX_OPTION_DONT_CAPTURE_GROUP
35 = onig_sys::ONIG_OPTION_DONT_CAPTURE_GROUP;
36 const REGEX_OPTION_CAPTURE_GROUP
38 = onig_sys::ONIG_OPTION_CAPTURE_GROUP;
39 }
40}
41
42bitflags! {
43 pub struct SearchOptions: onig_sys::OnigOptionType {
45 const SEARCH_OPTION_NONE
47 = onig_sys::ONIG_OPTION_NONE;
48 const SEARCH_OPTION_NOTBOL
50 = onig_sys::ONIG_OPTION_NOTBOL;
51 const SEARCH_OPTION_NOTEOL
53 = onig_sys::ONIG_OPTION_NOTEOL;
54 }
55}
56
57bitflags! {
58 pub struct SyntaxOperator: u64 {
60 const SYNTAX_OPERATOR_DOT_ANYCHAR
62 = (onig_sys::ONIG_SYN_OP_DOT_ANYCHAR as u64);
63 const SYNTAX_OPERATOR_ASTERISK_ZERO_INF
65 = (onig_sys::ONIG_SYN_OP_ASTERISK_ZERO_INF as u64);
66 const SYNTAX_OPERATOR_PLUS_ONE_INF
68 = (onig_sys::ONIG_SYN_OP_PLUS_ONE_INF as u64);
69 const SYNTAX_OPERATOR_QMARK_ZERO_ONE
71 = (onig_sys::ONIG_SYN_OP_QMARK_ZERO_ONE as u64);
72 const SYNTAX_OPERATOR_QMARK_CAPITAL_P_NAME
74 = (onig_sys::ONIG_SYN_OP2_QMARK_CAPITAL_P_NAME as u64);
75 const SYNTAX_OPERATOR_BRACE_INTERVAL
77 = (onig_sys::ONIG_SYN_OP_BRACE_INTERVAL as u64);
78 const SYNTAX_OPERATOR_ESC_BRACE_INTERVAL
80 = (onig_sys::ONIG_SYN_OP_ESC_BRACE_INTERVAL as u64);
81 const SYNTAX_OPERATOR_VBAR_ALT
83 = (onig_sys::ONIG_SYN_OP_VBAR_ALT as u64);
84 const SYNTAX_OPERATOR_ESC_VBAR_ALT
86 = (onig_sys::ONIG_SYN_OP_ESC_VBAR_ALT as u64);
87 const SYNTAX_OPERATOR_LPAREN_SUBEXP
89 = (onig_sys::ONIG_SYN_OP_LPAREN_SUBEXP as u64);
90 const SYNTAX_OPERATOR_ESC_LPAREN_SUBEXP
92 = (onig_sys::ONIG_SYN_OP_ESC_LPAREN_SUBEXP as u64);
93 const SYNTAX_OPERATOR_ESC_AZ_BUF_ANCHOR
95 = (onig_sys::ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR as u64);
96 const SYNTAX_OPERATOR_ESC_CAPITAL_G_BEGIN_ANCHOR
98 = (onig_sys::ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR as u64);
99 const SYNTAX_OPERATOR_DECIMAL_BACKREF
101 = (onig_sys::ONIG_SYN_OP_DECIMAL_BACKREF as u64);
102 const SYNTAX_OPERATOR_BRACKET_CC
104 = (onig_sys::ONIG_SYN_OP_BRACKET_CC as u64);
105 const SYNTAX_OPERATOR_ESC_W_WORD
107 = (onig_sys::ONIG_SYN_OP_ESC_W_WORD as u64);
108 const SYNTAX_OPERATOR_ESC_LTGT_WORD_BEGIN_END
110 = (onig_sys::ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END as u64);
111 const SYNTAX_OPERATOR_ESC_B_WORD_BOUND
113 = (onig_sys::ONIG_SYN_OP_ESC_B_WORD_BOUND as u64);
114 const SYNTAX_OPERATOR_ESC_S_WHITE_SPACE
116 = (onig_sys::ONIG_SYN_OP_ESC_S_WHITE_SPACE as u64);
117 const SYNTAX_OPERATOR_ESC_D_DIGIT
119 = (onig_sys::ONIG_SYN_OP_ESC_D_DIGIT as u64);
120 const SYNTAX_OPERATOR_LINE_ANCHOR
122 = (onig_sys::ONIG_SYN_OP_LINE_ANCHOR as u64);
123 const SYNTAX_OPERATOR_POSIX_BRACKET
125 = (onig_sys::ONIG_SYN_OP_POSIX_BRACKET as u64);
126 const SYNTAX_OPERATOR_QMARK_NON_GREEDY
128 = (onig_sys::ONIG_SYN_OP_QMARK_NON_GREEDY as u64);
129 const SYNTAX_OPERATOR_ESC_CONTROL_CHARS
131 = (onig_sys::ONIG_SYN_OP_ESC_CONTROL_CHARS as u64);
132 const SYNTAX_OPERATOR_ESC_C_CONTROL
134 = (onig_sys::ONIG_SYN_OP_ESC_C_CONTROL as u64);
135 const SYNTAX_OPERATOR_ESC_OCTAL3
137 = (onig_sys::ONIG_SYN_OP_ESC_OCTAL3 as u64);
138 const SYNTAX_OPERATOR_ESC_X_HEX2
140 = (onig_sys::ONIG_SYN_OP_ESC_X_HEX2 as u64);
141 const SYNTAX_OPERATOR_ESC_X_BRACE_HEX8
143 = (onig_sys::ONIG_SYN_OP_ESC_X_BRACE_HEX8 as u64);
144 const SYNTAX_OPERATOR_VARIABLE_META_CHARACTERS
146 = (onig_sys::ONIG_SYN_OP_VARIABLE_META_CHARACTERS as u64);
147 const SYNTAX_OPERATOR_ESC_CAPITAL_Q_QUOTE
149 = (onig_sys::ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE as u64) << 32;
150 const SYNTAX_OPERATOR_QMARK_GROUP_EFFECT
152 = (onig_sys::ONIG_SYN_OP2_QMARK_GROUP_EFFECT as u64) << 32;
153 const SYNTAX_OPERATOR_OPTION_PERL
155 = (onig_sys::ONIG_SYN_OP2_OPTION_PERL as u64) << 32;
156 const SYNTAX_OPERATOR_OPTION_RUBY
158 = (onig_sys::ONIG_SYN_OP2_OPTION_RUBY as u64) << 32;
159 const SYNTAX_OPERATOR_PLUS_POSSESSIVE_REPEAT
161 = (onig_sys::ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT as u64) << 32;
162 const SYNTAX_OPERATOR_PLUS_POSSESSIVE_INTERVAL
164 = (onig_sys::ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL as u64) << 32;
165 const SYNTAX_OPERATOR_CCLASS_SET_OP
167 = (onig_sys::ONIG_SYN_OP2_CCLASS_SET_OP as u64) << 32;
168 const SYNTAX_OPERATOR_QMARK_LT_NAMED_GROUP
170 = (onig_sys::ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP as u64) << 32;
171 const SYNTAX_OPERATOR_ESC_K_NAMED_BACKREF
173 = (onig_sys::ONIG_SYN_OP2_ESC_K_NAMED_BACKREF as u64) << 32;
174 const SYNTAX_OPERATOR_ESC_G_SUBEXP_CALL
176 = (onig_sys::ONIG_SYN_OP2_ESC_G_SUBEXP_CALL as u64) << 32;
177 const SYNTAX_OPERATOR_ATMARK_CAPTURE_HISTORY
179 = (onig_sys::ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY as u64) << 32;
180 const SYNTAX_OPERATOR_ESC_CAPITAL_C_BAR_CONTROL
182 = (onig_sys::ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL as u64) << 32;
183 const SYNTAX_OPERATOR_ESC_CAPITAL_M_BAR_META
185 = (onig_sys::ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META as u64) << 32;
186 const SYNTAX_OPERATOR_ESC_V_VTAB
188 = (onig_sys::ONIG_SYN_OP2_ESC_V_VTAB as u64) << 32;
189 const SYNTAX_OPERATOR_ESC_U_HEX4
191 = (onig_sys::ONIG_SYN_OP2_ESC_U_HEX4 as u64) << 32;
192 const SYNTAX_OPERATOR_ESC_GNU_BUF_ANCHOR
194 = (onig_sys::ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR as u64) << 32;
195 const SYNTAX_OPERATOR_ESC_P_BRACE_CHAR_PROPERTY
197 = (onig_sys::ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY as u64) << 32;
198 const SYNTAX_OPERATOR_ESC_P_BRACE_CIRCUMFLEX_NOT
200 = (onig_sys::ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT as u64) << 32;
201 const SYNTAX_OPERATOR_ESC_H_XDIGIT
203 = (onig_sys::ONIG_SYN_OP2_ESC_H_XDIGIT as u64) << 32;
204 const SYNTAX_OPERATOR_INEFFECTIVE_ESCAPE
206 = (onig_sys::ONIG_SYN_OP2_INEFFECTIVE_ESCAPE as u64) << 32;
207 }
208}
209
210bitflags! {
211 pub struct SyntaxBehavior: onig_sys::OnigSyntaxBehavior {
213 const SYNTAX_BEHAVIOR_CONTEXT_INDEP_REPEAT_OPS
215 = onig_sys::ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS;
216 const SYNTAX_BEHAVIOR_CONTEXT_INVALID_REPEAT_OPS
218 = onig_sys::ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS;
219 const SYNTAX_BEHAVIOR_ALLOW_UNMATCHED_CLOSE_SUBEXP
221 = onig_sys::ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP;
222 const SYNTAX_BEHAVIOR_ALLOW_INVALID_INTERVAL
224 = onig_sys::ONIG_SYN_ALLOW_INVALID_INTERVAL;
225 const SYNTAX_BEHAVIOR_ALLOW_INTERVAL_LOW_ABBREV
227 = onig_sys::ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV;
228 const SYNTAX_BEHAVIOR_STRICT_CHECK_BACKREF
230 = onig_sys::ONIG_SYN_STRICT_CHECK_BACKREF;
231 const SYNTAX_BEHAVIOR_DIFFERENT_LEN_ALT_LOOK_BEHIND
233 = onig_sys::ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND;
234 const SYNTAX_BEHAVIOR_CAPTURE_ONLY_NAMED_GROUP
236 = onig_sys::ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP;
237 const SYNTAX_BEHAVIOR_ALLOW_MULTIPLEX_DEFINITION_NAME
239 = onig_sys::ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME;
240 const SYNTAX_BEHAVIOR_FIXED_INTERVAL_IS_GREEDY_ONLY
242 = onig_sys::ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY;
243 const SYNTAX_BEHAVIOR_NOT_NEWLINE_IN_NEGATIVE_CC
245 = onig_sys::ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC;
246 const SYNTAX_BEHAVIOR_BACKSLASH_ESCAPE_IN_CC
248 = onig_sys::ONIG_SYN_BACKSLASH_ESCAPE_IN_CC;
249 const SYNTAX_BEHAVIOR_ALLOW_DOUBLE_RANGE_OP_IN_CC
251 = onig_sys::ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC;
252 const SYNTAX_BEHAVIOR_WARN_CC_OP_NOT_ESCAPED
254 = onig_sys::ONIG_SYN_WARN_CC_OP_NOT_ESCAPED;
255 const SYNTAX_BEHAVIOR_WARN_REDUNDANT_NESTED_REPEAT
257 = onig_sys::ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT;
258 }
259}
260
261bitflags! {
262 pub struct TraverseCallbackAt: c_uint {
264 const CALLBACK_AT_FIRST =
266 onig_sys::ONIG_TRAVERSE_CALLBACK_AT_FIRST;
267 const CALLBACK_AT_LAST =
269 onig_sys::ONIG_TRAVERSE_CALLBACK_AT_LAST;
270 const CALLBACK_AT_BOTH =
272 onig_sys::ONIG_TRAVERSE_CALLBACK_AT_BOTH;
273 }
274}
275
276bitflags! {
277 pub struct MetaCharType: c_uint {
279 const META_CHAR_ESCAPE = onig_sys::ONIG_META_CHAR_ESCAPE;
281 const META_CHAR_ANYCHAR = onig_sys::ONIG_META_CHAR_ANYCHAR;
283 const META_CHAR_ANYTIME = onig_sys::ONIG_META_CHAR_ANYTIME;
285 const META_CHAR_ZERO_OR_ONE_TIME = onig_sys::ONIG_META_CHAR_ZERO_OR_ONE_TIME;
287 const META_CHAR_ONE_OR_MORE_TIME = onig_sys::ONIG_META_CHAR_ONE_OR_MORE_TIME;
289 const META_CHAR_ANYCHAR_ANYTIME = onig_sys::ONIG_META_CHAR_ANYCHAR_ANYTIME;
291 }
292}