From: K.Kosako Date: Fri, 15 Feb 2019 12:56:54 +0000 (+0900) Subject: rename onig_bbuf_init() to bbuf_init() X-Git-Tag: v6.9.2_rc1~65^2~46 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bcdbdcf04123dd54f4c777b33bb1088a3a377610;p=onig rename onig_bbuf_init() to bbuf_init() --- diff --git a/src/regcomp.c b/src/regcomp.c index 8e3376a..99e13d3 100644 --- a/src/regcomp.c +++ b/src/regcomp.c @@ -327,24 +327,6 @@ bitset_is_empty(BitSetRef bs) return 1; } -extern int -onig_bbuf_init(BBuf* buf, int size) -{ - if (size <= 0) { - size = 0; - buf->p = NULL; - } - else { - buf->p = (UChar* )xmalloc(size); - if (IS_NULL(buf->p)) return(ONIGERR_MEMORY); - } - - buf->alloc = size; - buf->used = 0; - return 0; -} - - #ifdef USE_CALL static int diff --git a/src/regint.h b/src/regint.h index 7b506b6..c10b80a 100644 --- a/src/regint.h +++ b/src/regint.h @@ -386,7 +386,7 @@ typedef struct _BBuf { unsigned int alloc; } BBuf; -#define BB_INIT(buf,size) onig_bbuf_init((BBuf* )(buf), (size)) +#define BB_INIT(buf,size) bbuf_init((BBuf* )(buf), (size)) #define BB_SIZE_INC(buf,inc) do{\ (buf)->alloc += (inc);\ @@ -986,7 +986,6 @@ extern int onig_print_statistics P_((FILE* f)); extern void onig_warning(const char* s); extern UChar* onig_error_code_to_format P_((int code)); extern void onig_snprintf_with_pattern PV_((UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const UChar *fmt, ...)); -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_len P_((int enclen, OnigCodePoint code, void* /* CClassNode* */ cc)); diff --git a/src/regparse.c b/src/regparse.c index d3b8da4..b2fc2bc 100644 --- a/src/regparse.c +++ b/src/regparse.c @@ -198,6 +198,23 @@ onig_set_parse_depth_limit(unsigned int depth) return 0; } +static int +bbuf_init(BBuf* buf, int size) +{ + if (size <= 0) { + size = 0; + buf->p = NULL; + } + else { + buf->p = (UChar* )xmalloc(size); + if (IS_NULL(buf->p)) return(ONIGERR_MEMORY); + } + + buf->alloc = size; + buf->used = 0; + return 0; +} + static void bbuf_free(BBuf* bbuf) {