diff options
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 |