]> granicus.if.org Git - onig/commitdiff
rename callout_by_xxx to callout_of_xxx
authorK.Kosako <kosako@sofnec.co.jp>
Wed, 7 Feb 2018 00:32:05 +0000 (09:32 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Wed, 7 Feb 2018 00:32:05 +0000 (09:32 +0900)
sample/callout.c
src/oniguruma.h
src/regexec.c

index 6951891ead93818097c3abb55c47324317eaf070..53fb42c4281866f908d604a19cf6996a5c1ba7fb 100644 (file)
@@ -111,8 +111,8 @@ extern int main(int argc, char* argv[])
   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");
index f608fbc5e02ecc25b75fbb4be74d4e55f18b4dfe..cf85c55954ed99ceafef482a550523ee1dd15ba6 100644 (file)
@@ -751,13 +751,13 @@ enum {
 };
 
 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;
@@ -789,8 +789,8 @@ enum {
 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;
 
@@ -924,13 +924,13 @@ const char* onig_copyright P_((void));
 
 /* 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));
index 1231df9cd373b4845b866f2697e0d02f4dc5df41..d860982ff001f1c27e21f8811b0f6a6f3d3ac159 100644 (file)
@@ -801,7 +801,7 @@ onig_region_copy(OnigRegion* to, OnigRegion* from)
 
 #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;\
@@ -925,7 +925,7 @@ typedef struct _StackType {
 /* 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;
@@ -1088,8 +1088,8 @@ onig_initialize_match_params(OnigMatchParams* mp)
 #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;
 }
 
@@ -1472,7 +1472,7 @@ stack_double(int is_alloca, char** arg_alloc_base,
           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);\
         }\
       }\
     }\
@@ -3550,9 +3550,9 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
         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) {
@@ -3576,7 +3576,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
         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);
           }
         }
@@ -4698,26 +4698,26 @@ onig_copy_encoding(OnigEncoding to, OnigEncoding from)
 
 /* 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;