From 45052e503c17868e88b0755d680461d2322a058e Mon Sep 17 00:00:00 2001 From: "K.Kosako" Date: Fri, 9 Jun 2017 14:55:59 +0900 Subject: [PATCH] move CClassNode from regint.h to regparse.h --- src/regcomp.c | 3 ++- src/regint.h | 20 +------------------- src/regparse.h | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/regcomp.c b/src/regcomp.c index b7b428d..06a9c51 100644 --- a/src/regcomp.c +++ b/src/regcomp.c @@ -5707,9 +5707,10 @@ onig_is_in_code_range(const UChar* p, OnigCodePoint code) } extern int -onig_is_code_in_cc_len(int elen, OnigCodePoint code, CClassNode* cc) +onig_is_code_in_cc_len(int elen, OnigCodePoint code, /* CClassNode* */ void* cc_arg) { int found; + CClassNode* cc = (CClassNode* )cc_arg; if (elen > 1 || (code >= SINGLE_BYTE_SIZE)) { if (IS_NULL(cc->mbuf)) { diff --git a/src/regint.h b/src/regint.h index a7cece5..5d9be9d 100644 --- a/src/regint.h +++ b/src/regint.h @@ -652,23 +652,6 @@ typedef void* PointerType; #define IS_NCCLASS_NOT(nd) IS_NCCLASS_FLAG_ON(nd, FLAG_NCCLASS_NOT) #define IS_NCCLASS_SHARE(nd) IS_NCCLASS_FLAG_ON(nd, FLAG_NCCLASS_SHARE) -struct _Node; - -typedef struct { - int node_type; - int status; - struct _Node* body; -} NodeBase; - -typedef struct { - int node_type; - int status; - - unsigned int flags; - BitSet bs; - BBuf* mbuf; /* multi-byte info or NULL */ -} CClassNode; - typedef long OnigStackIndex; typedef struct _OnigStackType { @@ -765,8 +748,7 @@ extern void onig_snprintf_with_pattern PV_((UChar buf[], int bufsize, OnigEncod extern int onig_bbuf_init P_((BBuf* buf, int size)); extern int onig_compile P_((regex_t* reg, const UChar* pattern, const UChar* pattern_end, OnigErrorInfo* einfo)); extern void onig_transfer P_((regex_t* to, regex_t* from)); -extern int onig_is_code_in_cc P_((OnigEncoding enc, OnigCodePoint code, CClassNode* cc)); -extern int onig_is_code_in_cc_len P_((int enclen, OnigCodePoint code, CClassNode* cc)); +extern int onig_is_code_in_cc_len P_((int enclen, OnigCodePoint code, void* /* CClassNode* */ cc)); /* strend hash */ typedef void hash_table_type; diff --git a/src/regparse.h b/src/regparse.h index 6e81353..a0e9da5 100644 --- a/src/regparse.h +++ b/src/regparse.h @@ -164,6 +164,12 @@ typedef enum { #define CALLNODE_REFNUM_UNDEF -1 +typedef struct { + int node_type; + int status; + struct _Node* body; +} NodeBase; + typedef struct { int node_type; int status; @@ -175,6 +181,15 @@ typedef struct { UChar buf[NODE_STR_BUF_SIZE]; } StrNode; +typedef struct { + int node_type; + int status; + + unsigned int flags; + BitSet bs; + BBuf* mbuf; /* multi-byte info or NULL */ +} CClassNode; + typedef struct { int node_type; int status; @@ -368,6 +383,7 @@ extern void onig_node_str_clear P_((Node* node)); extern int onig_names_free P_((regex_t* reg)); extern int onig_parse_make_tree P_((Node** root, const UChar* pattern, const UChar* end, regex_t* reg, ScanEnv* env)); extern int onig_free_shared_cclass_table P_((void)); +extern int onig_is_code_in_cc P_((OnigEncoding enc, OnigCodePoint code, CClassNode* cc)); #ifdef ONIG_DEBUG #ifdef USE_NAMED_GROUP -- 2.40.0