Ignore:
Timestamp:
Jan 21, 2018, 12:10:09 AM (6 years ago)
Author:
coas-nagasima
Message:

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

Location:
EcnlProtoTool/trunk/onigmo-6.1.3
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/onigmo-6.1.3/src/regint.h

    r321 r331  
    1 #ifndef REGINT_H
    2 #define REGINT_H
     1#ifndef ONIGMO_REGINT_H
     2#define ONIGMO_REGINT_H
    33/**********************************************************************
    44  regint.h -  Onigmo (Oniguruma-mod) (regular expression library)
     
    66/*-
    77 * Copyright (c) 2002-2013  K.Kosako  <sndgk393 AT ybb DOT ne DOT jp>
    8  * Copyright (c) 2011-2014  K.Takata  <kentkt AT csc DOT jp>
     8 * Copyright (c) 2011-2016  K.Takata  <kentkt AT csc DOT jp>
    99 * All rights reserved.
    1010 *
     
    3636/* #define ONIG_DEBUG_SEARCH */
    3737/* #define ONIG_DEBUG_MATCH */
     38/* #define ONIG_DEBUG_MEMLEAK */
    3839/* #define ONIG_DONT_OPTIMIZE */
    3940
     
    4344#if defined(ONIG_DEBUG_PARSE_TREE) || defined(ONIG_DEBUG_MATCH) || \
    4445    defined(ONIG_DEBUG_SEARCH) || defined(ONIG_DEBUG_COMPILE) || \
    45     defined(ONIG_DEBUG_STATISTICS)
    46 #ifndef ONIG_DEBUG
    47 #define ONIG_DEBUG
    48 #endif
     46    defined(ONIG_DEBUG_STATISTICS) || defined(ONIG_DEBUG_MEMLEAK)
     47# ifndef ONIG_DEBUG
     48#  define ONIG_DEBUG
     49# endif
    4950#endif
    5051
    5152#ifndef UNALIGNED_WORD_ACCESS
    52 #if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
    53     defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || \
    54     defined(__powerpc64__) || \
    55     defined(__mc68020__)
    56 #define UNALIGNED_WORD_ACCESS 1
    57 #else
    58 #define UNALIGNED_WORD_ACCESS 0
    59 #endif
     53# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
     54     defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || \
     55     defined(__powerpc64__) || \
     56     defined(__mc68020__)
     57#  define UNALIGNED_WORD_ACCESS 1
     58# else
     59#  define UNALIGNED_WORD_ACCESS 0
     60# endif
    6061#endif
    6162
    6263#if UNALIGNED_WORD_ACCESS
    63 #define PLATFORM_UNALIGNED_WORD_ACCESS
     64# define PLATFORM_UNALIGNED_WORD_ACCESS
    6465#endif
    6566
     
    7475#define USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE     /* /\n$/ =~ "\n" */
    7576#define USE_WARNING_REDUNDANT_NESTED_REPEAT_OPERATOR
    76 /* #define USE_RECOMPILE_API */
    7777/* !!! moved to regenc.h. */ /* #define USE_CRNL_AS_LINE_TERMINATOR */
    7878#define USE_NO_INVALID_QUANTIFIER
    7979
    8080/* internal config */
    81 #define USE_PARSE_TREE_NODE_RECYCLE
    82 #define USE_OP_PUSH_OR_JUMP_EXACT
     81/* #define USE_OP_PUSH_OR_JUMP_EXACT */
    8382#define USE_QTFR_PEEK_NEXT
    8483#define USE_ST_LIBRARY
    85 #define USE_SHARED_CCLASS_TABLE
    8684#define USE_SUNDAY_QUICK_SEARCH
    8785
    8886#define INIT_MATCH_STACK_SIZE                     160
    8987#define DEFAULT_MATCH_STACK_LIMIT_SIZE              0 /* unlimited */
     88#define DEFAULT_PARSE_DEPTH_LIMIT                4096
     89
     90#define OPT_EXACT_MAXLEN   24
    9091
    9192/* check config */
    9293#if defined(USE_PERL_SUBEXP_CALL) || defined(USE_CAPITAL_P_NAMED_GROUP)
    93 #if !defined(USE_NAMED_GROUP) || !defined(USE_SUBEXP_CALL)
    94 #error USE_NAMED_GROUP and USE_SUBEXP_CALL must be defined.
    95 #endif
     94# if !defined(USE_NAMED_GROUP) || !defined(USE_SUBEXP_CALL)
     95#  error USE_NAMED_GROUP and USE_SUBEXP_CALL must be defined.
     96# endif
    9697#endif
    9798
    9899#if defined(__GNUC__)
    99 #  define ARG_UNUSED  __attribute__ ((unused))
     100# define ARG_UNUSED  __attribute__ ((unused))
    100101#else
    101 #  define ARG_UNUSED
    102 #endif
     102# define ARG_UNUSED
     103#endif
     104
     105#if !defined(RUBY) && defined(RUBY_EXPORT)
     106# define RUBY
     107#endif
     108#ifdef RUBY
     109# ifndef RUBY_DEFINES_H
     110#  include "ruby/ruby.h"
     111#  undef xmalloc
     112#  undef xrealloc
     113#  undef xcalloc
     114#  undef xfree
     115# endif
     116#else /* RUBY */
     117# include "config.h"
     118# if SIZEOF_LONG_LONG > 0
     119#  define LONG_LONG long long
     120# endif
     121#endif /* RUBY */
     122
     123#include <stdarg.h>
    103124
    104125/* */
    105126/* escape other system UChar definition */
    106 #include "config.h"
    107127#ifdef ONIG_ESCAPE_UCHAR_COLLISION
    108 #undef ONIG_ESCAPE_UCHAR_COLLISION
     128# undef ONIG_ESCAPE_UCHAR_COLLISION
    109129#endif
    110130
    111131#define USE_WORD_BEGIN_END          /* "\<": word-begin, "\>": word-end */
    112 #define USE_CAPTURE_HISTORY
     132#ifdef RUBY
     133# undef USE_CAPTURE_HISTORY
     134#else
     135# define USE_CAPTURE_HISTORY
     136#endif
    113137#define USE_VARIABLE_META_CHARS
    114 #define USE_POSIX_API_REGION_OPTION     /* needed for POSIX API support */
    115138#define USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE
    116139/* #define USE_COMBINATION_EXPLOSION_CHECK */     /* (X*)* */
    117140
    118 /* multithread config */
    119 /* #define USE_MULTI_THREAD_SYSTEM */
    120 /* #define USE_DEFAULT_MULTI_THREAD_SYSTEM */
    121 
    122 #if defined(USE_MULTI_THREAD_SYSTEM) \
    123   && defined(USE_DEFAULT_MULTI_THREAD_SYSTEM)
    124 
    125 #if defined(_WIN32) && !defined(MUSL_LIBC)
    126 #define WIN32_LEAN_AND_MEAN
    127 #include <windows.h>
    128 extern CRITICAL_SECTION gOnigMutex;
    129 #define THREAD_SYSTEM_INIT      InitializeCriticalSection(&gOnigMutex)
    130 #define THREAD_SYSTEM_END       DeleteCriticalSection(&gOnigMutex)
    131 #define THREAD_ATOMIC_START     EnterCriticalSection(&gOnigMutex)
    132 #define THREAD_ATOMIC_END       LeaveCriticalSection(&gOnigMutex)
    133 #define THREAD_PASS             Sleep(0)
    134 #else /* _WIN32 */
    135 #include <pthread.h>
    136 #include <sched.h>
    137 extern pthread_mutex_t gOnigMutex;
    138 #define THREAD_SYSTEM_INIT      pthread_mutex_init(&gOnigMutex, NULL)
    139 #define THREAD_SYSTEM_END       pthread_mutex_destroy(&gOnigMutex)
    140 #define THREAD_ATOMIC_START     pthread_mutex_lock(&gOnigMutex)
    141 #define THREAD_ATOMIC_END       pthread_mutex_unlock(&gOnigMutex)
    142 #define THREAD_PASS             sched_yield()
    143 #endif /* _WIN32 */
    144 
    145 #else /* USE_DEFAULT_MULTI_THREAD_SYSTEM */
    146 
    147 #ifndef THREAD_SYSTEM_INIT
    148 #define THREAD_SYSTEM_INIT      /* depend on thread system */
    149 #endif
    150 #ifndef THREAD_SYSTEM_END
    151 #define THREAD_SYSTEM_END       /* depend on thread system */
    152 #endif
    153 #ifndef THREAD_ATOMIC_START
    154 #define THREAD_ATOMIC_START     /* depend on thread system */
    155 #endif
    156 #ifndef THREAD_ATOMIC_END
    157 #define THREAD_ATOMIC_END       /* depend on thread system */
    158 #endif
    159 #ifndef THREAD_PASS
    160 #define THREAD_PASS             /* depend on thread system */
    161 #endif
    162 
    163 #endif /* USE_DEFAULT_MULTI_THREAD_SYSTEM */
    164141
    165142#ifndef xmalloc
    166 #define xmalloc     malloc
    167 #define xrealloc    realloc
    168 #define xcalloc     calloc
    169 #define xfree       free
    170 #endif
    171 
    172 #define CHECK_INTERRUPT_IN_MATCH_AT
    173 
    174 #define st_init_table                  onig_st_init_table
    175 #define st_init_table_with_size        onig_st_init_table_with_size
    176 #define st_init_numtable               onig_st_init_numtable
    177 #define st_init_numtable_with_size     onig_st_init_numtable_with_size
    178 #define st_init_strtable               onig_st_init_strtable
    179 #define st_init_strtable_with_size     onig_st_init_strtable_with_size
    180 #define st_delete                      onig_st_delete
    181 #define st_delete_safe                 onig_st_delete_safe
    182 #define st_insert                      onig_st_insert
    183 #define st_lookup                      onig_st_lookup
    184 #define st_foreach                     onig_st_foreach
    185 #define st_add_direct                  onig_st_add_direct
    186 #define st_free_table                  onig_st_free_table
    187 #define st_cleanup_safe                onig_st_cleanup_safe
    188 #define st_copy                        onig_st_copy
    189 #define st_nothing_key_clone           onig_st_nothing_key_clone
    190 #define st_nothing_key_free            onig_st_nothing_key_free
     143# define xmalloc     malloc
     144# define xrealloc    realloc
     145# define xcalloc     calloc
     146# define xfree       free
     147#endif
     148
     149#ifdef RUBY
     150
     151# define CHECK_INTERRUPT_IN_MATCH_AT rb_thread_check_ints()
     152# define onig_st_init_table                  st_init_table
     153# define onig_st_init_table_with_size        st_init_table_with_size
     154# define onig_st_init_numtable               st_init_numtable
     155# define onig_st_init_numtable_with_size     st_init_numtable_with_size
     156# define onig_st_init_strtable               st_init_strtable
     157# define onig_st_init_strtable_with_size     st_init_strtable_with_size
     158# define onig_st_delete                      st_delete
     159# define onig_st_delete_safe                 st_delete_safe
     160# define onig_st_insert                      st_insert
     161# define onig_st_lookup                      st_lookup
     162# define onig_st_foreach                     st_foreach
     163# define onig_st_add_direct                  st_add_direct
     164# define onig_st_free_table                  st_free_table
     165# define onig_st_cleanup_safe                st_cleanup_safe
     166# define onig_st_copy                        st_copy
     167# define onig_st_nothing_key_clone           st_nothing_key_clone
     168# define onig_st_nothing_key_free            st_nothing_key_free
     169# define onig_st_is_member                   st_is_member
     170
     171# define USE_UPPER_CASE_TABLE
     172#else /* RUBY */
     173
     174# define CHECK_INTERRUPT_IN_MATCH_AT
     175
     176# define st_init_table                  onig_st_init_table
     177# define st_init_table_with_size        onig_st_init_table_with_size
     178# define st_init_numtable               onig_st_init_numtable
     179# define st_init_numtable_with_size     onig_st_init_numtable_with_size
     180# define st_init_strtable               onig_st_init_strtable
     181# define st_init_strtable_with_size     onig_st_init_strtable_with_size
     182# define st_delete                      onig_st_delete
     183# define st_delete_safe                 onig_st_delete_safe
     184# define st_insert                      onig_st_insert
     185# define st_lookup                      onig_st_lookup
     186# define st_foreach                     onig_st_foreach
     187# define st_add_direct                  onig_st_add_direct
     188# define st_free_table                  onig_st_free_table
     189# define st_cleanup_safe                onig_st_cleanup_safe
     190# define st_copy                        onig_st_copy
     191# define st_nothing_key_clone           onig_st_nothing_key_clone
     192# define st_nothing_key_free            onig_st_nothing_key_free
    191193/* */
    192 #define onig_st_is_member              st_is_member
     194# define onig_st_is_member              st_is_member
     195
     196#endif /* RUBY */
    193197
    194198#define STATE_CHECK_STRING_THRESHOLD_LEN             7
    195199#define STATE_CHECK_BUFF_MAX_SIZE               0x4000
    196200
    197 #define THREAD_PASS_LIMIT_COUNT     8
    198201#define xmemset     memset
    199202#define xmemcpy     memcpy
    200203#define xmemmove    memmove
    201204
    202 #if defined(_WIN32) && !defined(__GNUC__) && !defined(MUSL_LIBC)
    203 #define xalloca     _alloca
    204 #define xvsnprintf  _vsnprintf
     205#if ((defined(RUBY_MSVCRT_VERSION) && RUBY_MSVCRT_VERSION >= 90) \
     206        || (!defined(RUBY_MSVCRT_VERSION) && defined(_WIN32))) \
     207    && !defined(__GNUC__)
     208# define xalloca     _alloca
     209# define xvsnprintf(buf,size,fmt,args)  _vsnprintf_s(buf,size,_TRUNCATE,fmt,args)
     210# define xsnprintf   sprintf_s
     211# define xstrcat(dest,src,size)   strcat_s(dest,size,src)
    205212#else
    206 /*#define xalloca     alloca*/
    207 #define xvsnprintf  vsnprintf
    208 #endif
    209 
    210 
    211 #if defined(USE_RECOMPILE_API) && defined(USE_MULTI_THREAD_SYSTEM)
    212 #define ONIG_STATE_INC(reg) (reg)->state++
    213 #define ONIG_STATE_DEC(reg) (reg)->state--
    214 
    215 #define ONIG_STATE_INC_THREAD(reg) do {\
    216   THREAD_ATOMIC_START;\
    217   (reg)->state++;\
    218   THREAD_ATOMIC_END;\
    219 } while(0)
    220 #define ONIG_STATE_DEC_THREAD(reg) do {\
    221   THREAD_ATOMIC_START;\
    222   (reg)->state--;\
    223   THREAD_ATOMIC_END;\
    224 } while(0)
    225 #else
    226 #define ONIG_STATE_INC(reg)         /* Nothing */
    227 #define ONIG_STATE_DEC(reg)         /* Nothing */
    228 #define ONIG_STATE_INC_THREAD(reg)  /* Nothing */
    229 #define ONIG_STATE_DEC_THREAD(reg)  /* Nothing */
    230 #endif /* USE_RECOMPILE_API && USE_MULTI_THREAD_SYSTEM */
    231 
    232 #ifdef HAVE_STDLIB_H
     213# define xalloca     alloca
     214# define xvsnprintf  vsnprintf
     215# define xsnprintf   snprintf
     216# define xstrcat(dest,src,size)   strcat(dest,src)
     217#endif
     218
     219#if defined(ONIG_DEBUG_MEMLEAK) && defined(_MSC_VER)
     220# define _CRTDBG_MAP_ALLOC
     221# include <malloc.h>
     222# include <crtdbg.h>
     223#endif
     224
    233225#include <stdlib.h>
    234 #endif
    235226
    236227#if defined(HAVE_ALLOCA_H) && (defined(_AIX) || !defined(__GNUC__))
    237 #include <alloca.h>
    238 #endif
    239 
    240 #ifdef HAVE_STRING_H
    241 # include <string.h>
    242 #else
    243 # include <strings.h>
    244 #endif
     228# include <alloca.h>
     229#endif
     230
     231#include <string.h>
    245232
    246233#include <ctype.h>
    247234#ifdef HAVE_SYS_TYPES_H
    248 #include <sys/types.h>
     235# include <sys/types.h>
    249236#endif
    250237
     
    257244#endif
    258245
    259 #ifdef STDC_HEADERS
    260 # include <stddef.h>
    261 #endif
    262 
    263 #if defined(_WIN32) && !defined(MUSL_LIBC)
    264 #include <malloc.h>     /* for alloca() */
     246#include <stddef.h>
     247
     248#ifdef _WIN32
     249# include <malloc.h>    /* for alloca() */
    265250#endif
    266251
     
    269254#endif
    270255
    271 #if defined(_WIN32) && !defined(MUSL_LIBC)
    272 #if defined(_MSC_VER) && (_MSC_VER < 1300)
    273 #ifndef _INTPTR_T_DEFINED
    274 #define _INTPTR_T_DEFINED
     256#ifdef _WIN32
     257# if defined(_MSC_VER) && (_MSC_VER < 1300)
     258#  ifndef _INTPTR_T_DEFINED
     259#   define _INTPTR_T_DEFINED
    275260typedef int intptr_t;
    276 #endif
    277 #ifndef _UINTPTR_T_DEFINED
    278 #define _UINTPTR_T_DEFINED
     261#  endif
     262#  ifndef _UINTPTR_T_DEFINED
     263#   define _UINTPTR_T_DEFINED
    279264typedef unsigned int uintptr_t;
    280 #endif
    281 #endif
     265#  endif
     266# endif
    282267#endif /* _WIN32 */
    283268
    284269#ifndef PRIdPTR
    285 #ifdef _WIN64
    286 #define PRIdPTR "I64d"
    287 #define PRIuPTR "I64u"
    288 #define PRIxPTR "I64x"
    289 #else
    290 #define PRIdPTR "ld"
    291 #define PRIuPTR "lu"
    292 #define PRIxPTR "lx"
    293 #endif
     270# ifdef _WIN64
     271#  define PRIdPTR       "I64d"
     272#  define PRIuPTR       "I64u"
     273#  define PRIxPTR       "I64x"
     274# else
     275#  define PRIdPTR       "ld"
     276#  define PRIuPTR       "lu"
     277#  define PRIxPTR       "lx"
     278# endif
     279#endif
     280
     281#ifndef PRIdPTRDIFF
     282# define PRIdPTRDIFF PRIdPTR
    294283#endif
    295284
    296285#include "regenc.h"
    297286
     287RUBY_SYMBOL_EXPORT_BEGIN
     288
    298289#ifdef MIN
    299 #undef MIN
     290# undef MIN
    300291#endif
    301292#ifdef MAX
    302 #undef MAX
     293# undef MAX
    303294#endif
    304295#define MIN(a,b) (((a)>(b))?(b):(a))
     
    315306#ifdef PLATFORM_UNALIGNED_WORD_ACCESS
    316307
    317 #define PLATFORM_GET_INC(val,p,type) do{\
     308# define PLATFORM_GET_INC(val,p,type) do{\
    318309  val  = *(type* )p;\
    319310  (p) += sizeof(type);\
     
    322313#else
    323314
    324 #define PLATFORM_GET_INC(val,p,type) do{\
     315# define PLATFORM_GET_INC(val,p,type) do{\
    325316  xmemcpy(&val, (p), sizeof(type));\
    326317  (p) += sizeof(type);\
     
    328319
    329320/* sizeof(OnigCodePoint) */
    330 #define WORD_ALIGNMENT_SIZE     SIZEOF_LONG
    331 
    332 #define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\
     321# define WORD_ALIGNMENT_SIZE     SIZEOF_LONG
     322
     323# define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\
    333324  (pad_size) = WORD_ALIGNMENT_SIZE \
    334325               - ((uintptr_t )(addr) % WORD_ALIGNMENT_SIZE);\
     
    336327} while (0)
    337328
    338 #define ALIGNMENT_RIGHT(addr) do {\
     329# define ALIGNMENT_RIGHT(addr) do {\
    339330  (addr) += (WORD_ALIGNMENT_SIZE - 1);\
    340331  (addr) -= ((uintptr_t )(addr) % WORD_ALIGNMENT_SIZE);\
     
    400391#define IS_NOTBOS(option)         ((option) & ONIG_OPTION_NOTBOS)
    401392#define IS_NOTEOS(option)         ((option) & ONIG_OPTION_NOTEOS)
    402 #define IS_POSIX_REGION(option)   ((option) & ONIG_OPTION_POSIX_REGION)
    403393#define IS_ASCII_RANGE(option)    ((option) & ONIG_OPTION_ASCII_RANGE)
    404394#define IS_POSIX_BRACKET_ALL_RANGE(option)  ((option) & ONIG_OPTION_POSIX_BRACKET_ALL_RANGE)
     
    583573  OP_CCLASS_MB_NOT,
    584574  OP_CCLASS_MIX_NOT,
    585   OP_CCLASS_NODE,       /* pointer to CClassNode node */
    586575
    587576  OP_ANYCHAR,                 /* "."  */
     
    612601  OP_SEMI_END_BUF,
    613602  OP_BEGIN_POSITION,
    614   OP_BEGIN_POS_OR_LINE,   /* used for implicit anchor optimization */
    615603
    616604  OP_BACKREF1,
     
    657645  OP_PUSH_LOOK_BEHIND_NOT, /* (?<!...) start */
    658646  OP_FAIL_LOOK_BEHIND_NOT, /* (?<!...) end   */
     647  OP_PUSH_ABSENT_POS,      /* (?~...)  start */
     648  OP_ABSENT,               /* (?~...)  start of inner loop */
     649  OP_ABSENT_END,           /* (?~...)  end   */
    659650
    660651  OP_CALL,                 /* \g<name> */
     
    744735#define SIZE_OP_RETURN                  SIZE_OPCODE
    745736#define SIZE_OP_CONDITION              (SIZE_OPCODE + SIZE_MEMNUM + SIZE_RELADDR)
     737#define SIZE_OP_PUSH_ABSENT_POS         SIZE_OPCODE
     738#define SIZE_OP_ABSENT                 (SIZE_OPCODE + SIZE_RELADDR)
     739#define SIZE_OP_ABSENT_END              SIZE_OPCODE
    746740
    747741#ifdef USE_COMBINATION_EXPLOSION_CHECK
    748 #define SIZE_OP_STATE_CHECK            (SIZE_OPCODE + SIZE_STATE_CHECK_NUM)
    749 #define SIZE_OP_STATE_CHECK_PUSH       (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR)
    750 #define SIZE_OP_STATE_CHECK_PUSH_OR_JUMP (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR)
    751 #define SIZE_OP_STATE_CHECK_ANYCHAR_STAR (SIZE_OPCODE + SIZE_STATE_CHECK_NUM)
     742# define SIZE_OP_STATE_CHECK           (SIZE_OPCODE + SIZE_STATE_CHECK_NUM)
     743# define SIZE_OP_STATE_CHECK_PUSH      (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR)
     744# define SIZE_OP_STATE_CHECK_PUSH_OR_JUMP (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR)
     745# define SIZE_OP_STATE_CHECK_ANYCHAR_STAR (SIZE_OPCODE + SIZE_STATE_CHECK_NUM)
    752746#endif
    753747
     
    797791/* cclass node */
    798792#define FLAG_NCCLASS_NOT           (1<<0)
    799 #define FLAG_NCCLASS_SHARE         (1<<1)
    800793
    801794#define NCCLASS_SET_NOT(nd)     NCCLASS_FLAG_SET(nd, FLAG_NCCLASS_NOT)
    802 #define NCCLASS_SET_SHARE(nd)   NCCLASS_FLAG_SET(nd, FLAG_NCCLASS_SHARE)
    803795#define NCCLASS_CLEAR_NOT(nd)   NCCLASS_FLAG_CLEAR(nd, FLAG_NCCLASS_NOT)
    804796#define IS_NCCLASS_NOT(nd)      IS_NCCLASS_FLAG_ON(nd, FLAG_NCCLASS_NOT)
    805 #define IS_NCCLASS_SHARE(nd)    IS_NCCLASS_FLAG_ON(nd, FLAG_NCCLASS_SHARE)
    806797
    807798typedef struct {
     
    858849    } call_frame;
    859850#endif
     851    struct {
     852      UChar *abs_pstr;        /* absent start position */
     853      const UChar *end_pstr;  /* end position */
     854    } absent_pos;
    860855  } u;
    861856} OnigStackType;
     
    901896
    902897
    903 extern void onig_print_compiled_byte_code P_((FILE* f, UChar* bp, UChar** nextp, OnigEncoding enc));
    904 
    905 #ifdef ONIG_DEBUG_STATISTICS
    906 extern void onig_statistics_init P_((void));
    907 extern void onig_print_statistics P_((FILE* f));
    908 #endif
    909 #endif
    910 
    911 extern UChar* onig_error_code_to_format P_((OnigPosition code));
    912 extern void  onig_snprintf_with_pattern PV_((UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const UChar *fmt, ...));
    913 extern int  onig_bbuf_init P_((BBuf* buf, OnigDistance size));
    914 extern int  onig_compile P_((regex_t* reg, const UChar* pattern, const UChar* pattern_end, OnigErrorInfo* einfo));
    915 extern void onig_chain_reduce P_((regex_t* reg));
    916 extern void onig_chain_link_add P_((regex_t* to, regex_t* add));
    917 extern void onig_transfer P_((regex_t* to, regex_t* from));
    918 extern int  onig_is_code_in_cc P_((OnigEncoding enc, OnigCodePoint code, CClassNode* cc));
    919 extern int  onig_is_code_in_cc_len P_((int enclen, OnigCodePoint code, CClassNode* cc));
     898extern void onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar* bpend, UChar** nextp, OnigEncoding enc);
     899
     900# ifdef ONIG_DEBUG_STATISTICS
     901extern void onig_statistics_init(void);
     902extern void onig_print_statistics(FILE* f);
     903# endif
     904#endif
     905
     906extern UChar* onig_error_code_to_format(OnigPosition code);
     907extern void onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const UChar *fmt, va_list args);
     908extern void onig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const UChar *fmt, ...);
     909extern int  onig_bbuf_init(BBuf* buf, OnigDistance size);
     910extern int  onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end, OnigErrorInfo* einfo);
     911#ifdef RUBY
     912extern int  onig_compile_ruby(regex_t* reg, const UChar* pattern, const UChar* pattern_end, OnigErrorInfo* einfo, const char *sourcefile, int sourceline);
     913#endif
     914extern void onig_transfer(regex_t* to, regex_t* from);
     915extern int  onig_is_code_in_cc(OnigEncoding enc, OnigCodePoint code, CClassNode* cc);
     916extern int  onig_is_code_in_cc_len(int enclen, OnigCodePoint code, CClassNode* cc);
    920917
    921918/* strend hash */
    922919typedef void hash_table_type;
    923 typedef uintptr_t hash_data_type;
    924 
    925 extern hash_table_type* onig_st_init_strend_table_with_size P_((int size));
    926 extern int onig_st_lookup_strend P_((hash_table_type* table, const UChar* str_key, const UChar* end_key, hash_data_type *value));
    927 extern int onig_st_insert_strend P_((hash_table_type* table, const UChar* str_key, const UChar* end_key, hash_data_type value));
    928 
    929 /* encoding property management */
    930 #define PROPERTY_LIST_ADD_PROP(Name, CR) \
    931   r = onigenc_property_list_add_property((UChar* )Name, CR,\
    932               &PropertyNameTable, &PropertyList, &PropertyListNum,\
    933               &PropertyListSize);\
    934   if (r != 0) goto end
    935 
    936 #define PROPERTY_LIST_INIT_CHECK \
    937   if (PropertyInited == 0) {\
    938     int r = onigenc_property_list_init(init_property_list);\
    939     if (r != 0) return r;\
    940   }
    941 
    942 extern int onigenc_property_list_add_property P_((UChar* name, const OnigCodePoint* prop, hash_table_type **table, const OnigCodePoint*** plist, int *pnum, int *psize));
    943 
    944 typedef int (*ONIGENC_INIT_PROPERTY_LIST_FUNC_TYPE)(void);
    945 
    946 extern int onigenc_property_list_init P_((ONIGENC_INIT_PROPERTY_LIST_FUNC_TYPE));
    947 
    948 extern size_t onig_memsize P_((const regex_t *reg));
    949 extern size_t onig_region_memsize P_((const struct re_registers *regs));
    950 
    951 #endif /* REGINT_H */
     920#ifdef RUBY
     921# include "ruby/st.h"
     922#else
     923# include "st.h"
     924#endif
     925typedef st_data_t hash_data_type;
     926
     927extern hash_table_type* onig_st_init_strend_table_with_size(st_index_t size);
     928extern int onig_st_lookup_strend(hash_table_type* table, const UChar* str_key, const UChar* end_key, hash_data_type *value);
     929extern int onig_st_insert_strend(hash_table_type* table, const UChar* str_key, const UChar* end_key, hash_data_type value);
     930
     931#ifdef RUBY
     932extern size_t onig_memsize(const regex_t *reg);
     933extern size_t onig_region_memsize(const struct re_registers *regs);
     934#endif
     935
     936RUBY_SYMBOL_EXPORT_END
     937
     938#endif /* ONIGMO_REGINT_H */
Note: See TracChangeset for help on using the changeset viewer.