diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-26 08:31:27 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-26 08:31:27 +0000 |
commit | 9ed1d63f41e67b1a2c50171ba9fc99a9b90e93c4 (patch) | |
tree | a55f5b8aff31a6765dd5c8514f523d420d3c12a1 /regint.h | |
parent | 360b98355e08c455d627c31c5f63bdda75fe8de2 (diff) |
* regcomp.c, regenc.c, regexec.c, regint.h, enc/unicode.c:
Merge Onigmo 58fa099ed1a34367de67fb3d06dd48d076839692
+ https://github.com/k-takata/Onigmo/pull/52
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regint.h')
-rw-r--r-- | regint.h | 35 |
1 files changed, 25 insertions, 10 deletions
@@ -4,7 +4,7 @@ regint.h - Onigmo (Oniguruma-mod) (regular expression library) **********************************************************************/ /*- - * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2002-2013 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> * Copyright (c) 2011-2014 K.Takata <kentkt AT csc DOT jp> * All rights reserved. * @@ -392,17 +392,17 @@ typedef unsigned int BitStatusType; #define BIT_STATUS_CLEAR(stats) (stats) = 0 #define BIT_STATUS_ON_ALL(stats) (stats) = ~((BitStatusType )0) #define BIT_STATUS_AT(stats,n) \ - ((n) < (int )BIT_STATUS_BITS_NUM ? ((stats) & ((BitStatusType)1 << n)) : ((stats) & 1)) + ((n) < (int )BIT_STATUS_BITS_NUM ? ((stats) & ((BitStatusType )1 << n)) : ((stats) & 1)) #define BIT_STATUS_ON_AT(stats,n) do {\ - if ((n) < (int )BIT_STATUS_BITS_NUM) \ + if ((n) < (int )BIT_STATUS_BITS_NUM)\ (stats) |= (1 << (n));\ else\ (stats) |= 1;\ } while (0) #define BIT_STATUS_ON_AT_SIMPLE(stats,n) do {\ - if ((n) < (int )BIT_STATUS_BITS_NUM)\ + if ((n) < (int )BIT_STATUS_BITS_NUM)\ (stats) |= (1 << (n));\ } while (0) @@ -485,23 +485,29 @@ typedef struct _BBuf { #define BBUF_INIT(buf,size) onig_bbuf_init((BBuf* )(buf), (size)) #define BBUF_SIZE_INC(buf,inc) do{\ + UChar *tmp;\ (buf)->alloc += (inc);\ - (buf)->p = (UChar* )xrealloc((buf)->p, (buf)->alloc);\ - if (IS_NULL((buf)->p)) return(ONIGERR_MEMORY);\ + tmp = (UChar* )xrealloc((buf)->p, (buf)->alloc);\ + if (IS_NULL(tmp)) return(ONIGERR_MEMORY);\ + (buf)->p = tmp;\ } while (0) #define BBUF_EXPAND(buf,low) do{\ + UChar *tmp;\ do { (buf)->alloc *= 2; } while ((buf)->alloc < (unsigned int )low);\ - (buf)->p = (UChar* )xrealloc((buf)->p, (buf)->alloc);\ - if (IS_NULL((buf)->p)) return(ONIGERR_MEMORY);\ + tmp = (UChar* )xrealloc((buf)->p, (buf)->alloc);\ + if (IS_NULL(tmp)) return(ONIGERR_MEMORY);\ + (buf)->p = tmp;\ } while (0) #define BBUF_ENSURE_SIZE(buf,size) do{\ unsigned int new_alloc = (buf)->alloc;\ while (new_alloc < (unsigned int )(size)) { new_alloc *= 2; }\ if ((buf)->alloc != new_alloc) {\ - (buf)->p = (UChar* )xrealloc((buf)->p, new_alloc);\ - if (IS_NULL((buf)->p)) return(ONIGERR_MEMORY);\ + UChar *tmp;\ + tmp = (UChar* )xrealloc((buf)->p, new_alloc);\ + if (IS_NULL(tmp)) return(ONIGERR_MEMORY);\ + (buf)->p = tmp;\ (buf)->alloc = new_alloc;\ }\ } while (0) @@ -903,6 +909,14 @@ typedef struct { #define IS_CODE_SB_WORD(enc,code) \ (ONIGENC_IS_CODE_ASCII(code) && ONIGENC_IS_CODE_WORD(enc,code)) +typedef struct OnigEndCallListItem { + struct OnigEndCallListItem* next; + void (*func)(void); +} OnigEndCallListItemType; + +extern void onig_add_end_call(void (*func)(void)); + + #ifdef ONIG_DEBUG typedef struct { @@ -913,6 +927,7 @@ typedef struct { extern OnigOpInfoType OnigOpInfo[]; + extern void onig_print_compiled_byte_code P_((FILE* f, UChar* bp, UChar* bpend, UChar** nextp, OnigEncoding enc)); #ifdef ONIG_DEBUG_STATISTICS |