From 07005064494f2e24f77d090c7cbd569829d9d1c8 Mon Sep 17 00:00:00 2001 From: "K.Kosako" Date: Thu, 1 Feb 2018 15:53:37 +0900 Subject: [PATCH] define CalloutArgs --- src/oniguruma.h | 6 ++++++ src/regexec.c | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/oniguruma.h b/src/oniguruma.h index ca4515a..d66bc90 100644 --- a/src/oniguruma.h +++ b/src/oniguruma.h @@ -754,6 +754,12 @@ typedef struct { const OnigUChar* sstart; const OnigUChar* s; // current matching position unsigned long try_in_match_counter; + + /* elements invisible to users */ + void* invisible1_; + void* invisible2_; + void* invisible3_; + void* invisible4_; } OnigCalloutArgs; typedef int (*OnigCalloutFunc)(OnigCalloutArgs* args, void* user_data); diff --git a/src/regexec.c b/src/regexec.c index eb76440..4b7b384 100644 --- a/src/regexec.c +++ b/src/regexec.c @@ -872,6 +872,25 @@ typedef struct _StackType { } u; } StackType; +/* Synchronize visible part of the type with OnigCalloutArgs */ +typedef struct { + const OnigUChar* content; + const OnigUChar* content_end; + OnigRegex reg; + const OnigUChar* str; + const OnigUChar* end; + const OnigUChar* right_range; + const OnigUChar* sstart; + const OnigUChar* s; // current matching position + unsigned long try_in_match_counter; + + /* invisible to users */ + StackType* stk_base; + StackType* stk; + StackIndex* mem_start_stk; + StackIndex* mem_end_stk; +} CalloutArgs; + #ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE #define MATCH_ARG_INIT(msa, reg, arg_option, arg_region, arg_start, mp) do { \ -- 2.40.0