OnigEncoding use_encs[] = { ONIG_ENCODING_UTF8 };
onig_initialize(use_encs, sizeof(use_encs)/sizeof(use_encs[0]));
- (void)onig_set_callout_by_code(normal_callout_func);
- (void)onig_set_retraction_callout_by_code(retraction_callout_func);
+ (void)onig_set_callout_of_code(normal_callout_func);
+ (void)onig_set_retraction_callout_of_code(retraction_callout_func);
test("a+(?{foo bar baz...}+)$", "aaab");
test("(?{{!{}#$%&'()=-~^|[_]`@*:+;<>?/.\\,}})c", "abc");
};
enum {
- ONIG_CALLOUT_BY_CODE = 0,
- ONIG_CALLOUT_BY_NAME = 1,
+ ONIG_CALLOUT_OF_CODE = 0,
+ ONIG_CALLOUT_OF_NAME = 1,
};
typedef struct {
int direction;
- int by;
+ int of;
int id;
const OnigUChar* content;
const OnigUChar* content_end;
typedef struct {
unsigned int match_stack_limit;
unsigned long try_in_match_limit;
- OnigCalloutFunc callout_by_code;
- OnigCalloutFunc retraction_callout_by_code;
+ OnigCalloutFunc callout_of_code;
+ OnigCalloutFunc retraction_callout_of_code;
void* callout_user_data;
} OnigMatchParams;
/* for callout functions */
ONIG_EXTERN
-OnigCalloutFunc onig_get_callout_by_code P_((void));
+OnigCalloutFunc onig_get_callout_of_code P_((void));
ONIG_EXTERN
-int onig_set_callout_by_code P_((OnigCalloutFunc f));
+int onig_set_callout_of_code P_((OnigCalloutFunc f));
ONIG_EXTERN
-OnigCalloutFunc onig_get_retraction_callout_by_code P_((void));
+OnigCalloutFunc onig_get_retraction_callout_of_code P_((void));
ONIG_EXTERN
-int onig_set_retraction_callout_by_code P_((OnigCalloutFunc f));
+int onig_set_retraction_callout_of_code P_((OnigCalloutFunc f));
ONIG_EXTERN
int onig_get_capture_range_in_callout P_((OnigCalloutArgs* args, int mem_num, int* begin, int* end));
#define CALLOUT_CODE_BODY(func, dir, sid, cstart, cend, user, args, result) do { \
args.direction = dir;\
- args.by = ONIG_CALLOUT_BY_CODE;\
+ args.of = ONIG_CALLOUT_OF_CODE;\
args.id = sid;\
args.content = cstart;\
args.content_end = cend;\
/* Synchronize visible part of the type with OnigCalloutArgs */
typedef struct {
int direction;
- int by;
+ int of;
int id;
const OnigUChar* content;
const OnigUChar* content_end;
#ifdef USE_TRY_IN_MATCH_LIMIT
mp->try_in_match_limit = TryInMatchLimit;
#endif
- mp->callout_by_code = DefaultCallout;
- mp->retraction_callout_by_code = DefaultRetractionCallout;
+ mp->callout_of_code = DefaultCallout;
+ mp->retraction_callout_of_code = DefaultRetractionCallout;
mp->callout_user_data = 0;
}
mem_end_stk[stk->zid] = stk->u.mem.end;\
}\
else if (stk->type == STK_CALLOUT_CODE) {\
- RETRACTION_CALLOUT_CODE(msa->mp->retraction_callout_by_code, stk->zid, stk->u.callout_code.content, stk->u.callout_code.content_end, msa->mp->callout_user_data);\
+ RETRACTION_CALLOUT_CODE(msa->mp->retraction_callout_of_code, stk->zid, stk->u.callout_code.content, stk->u.callout_code.content_end, msa->mp->callout_user_data);\
}\
}\
}\
GET_POINTER_INC(content_start, p);
GET_POINTER_INC(content_end, p);
- if (IS_NOT_NULL(msa->mp->callout_by_code) &&
+ if (IS_NOT_NULL(msa->mp->callout_of_code) &&
(dirs & CALLOUT_DIRECTION_NORMAL) != 0) {
- CALLOUT_CODE_BODY(msa->mp->callout_by_code, ONIG_CALLOUT_DIRECTION_NORMAL,
+ CALLOUT_CODE_BODY(msa->mp->callout_of_code, ONIG_CALLOUT_DIRECTION_NORMAL,
id, content_start, content_end,
msa->mp->callout_user_data, args, call_result);
switch (call_result) {
else {
retraction_callout:
if ((dirs & CALLOUT_DIRECTION_RETRACTION) != 0 &&
- IS_NOT_NULL(msa->mp->retraction_callout_by_code)) {
+ IS_NOT_NULL(msa->mp->retraction_callout_of_code)) {
STACK_PUSH_CALLOUT_CODE(id, content_start, content_end);
}
}
/* for callout functions */
extern OnigCalloutFunc
-onig_get_callout_by_code(void)
+onig_get_callout_of_code(void)
{
return DefaultCallout;
}
extern int
-onig_set_callout_by_code(OnigCalloutFunc f)
+onig_set_callout_of_code(OnigCalloutFunc f)
{
DefaultCallout = f;
return ONIG_NORMAL;
}
extern OnigCalloutFunc
-onig_get_retraction_callout_by_code(void)
+onig_get_retraction_callout_of_code(void)
{
return DefaultRetractionCallout;
}
extern int
-onig_set_retraction_callout_by_code(OnigCalloutFunc f)
+onig_set_retraction_callout_of_code(OnigCalloutFunc f)
{
DefaultRetractionCallout = f;
return ONIG_NORMAL;