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/regenc.h

    r321 r331  
    1 #ifndef REGENC_H
    2 #define REGENC_H
     1#ifndef ONIGMO_REGENC_H
     2#define ONIGMO_REGENC_H
    33/**********************************************************************
    44  regenc.h -  Onigmo (Oniguruma-mod) (regular expression library)
     
    66/*-
    77 * Copyright (c) 2002-2008  K.Kosako  <sndgk393 AT ybb DOT ne DOT jp>
    8  * Copyright (c) 2011       K.Takata  <kentkt AT csc DOT jp>
     8 * Copyright (c) 2011-2016  K.Takata  <kentkt AT csc DOT jp>
    99 * All rights reserved.
    1010 *
     
    3131 */
    3232
    33 #ifndef PACKAGE
     33#if !defined(RUBY) && (defined(RUBY_EXPORT) || defined(ONIG_ENC_REGISTER))
     34# define RUBY
     35#endif
     36#ifdef RUBY
     37# ifndef ONIGMO_REGINT_H
     38#  ifndef RUBY_EXTERN
     39#   include "ruby/config.h"
     40#   include "ruby/defines.h"
     41#  endif
     42# endif
     43#else /* RUBY */
     44# ifndef PACKAGE
    3445/* PACKAGE is defined in config.h */
    35 #include "config.h"
    36 #endif
     46#  include "config.h"
     47# endif
     48#endif /* RUBY */
    3749
    3850#ifdef ONIG_ESCAPE_UCHAR_COLLISION
    39 #undef ONIG_ESCAPE_UCHAR_COLLISION
    40 #endif
    41 
    42 #include "oniguruma.h"
     51# undef ONIG_ESCAPE_UCHAR_COLLISION
     52#endif
     53
     54#ifdef RUBY
     55# include "ruby/onigmo.h"
     56#else
     57# include "onigmo.h"
     58#endif
     59
     60RUBY_SYMBOL_EXPORT_BEGIN
    4361
    4462typedef struct {
     
    4967
    5068#ifndef NULL
    51 #define NULL   ((void* )0)
     69# define NULL   ((void* )0)
    5270#endif
    5371
    5472#ifndef TRUE
    55 #define TRUE    1
     73# define TRUE    1
    5674#endif
    5775
    5876#ifndef FALSE
    59 #define FALSE   0
     77# define FALSE   0
    6078#endif
    6179
    6280#ifndef ARG_UNUSED
    63 #if defined(__GNUC__)
     81# if defined(__GNUC__)
    6482#  define ARG_UNUSED  __attribute__ ((unused))
    65 #else
     83# else
    6684#  define ARG_UNUSED
    67 #endif
     85# endif
    6886#endif
    6987
     
    7391#define ONIG_CHECK_NULL_RETURN_VAL(p,val)  if (ONIG_IS_NULL(p)) return (val)
    7492
    75 #define enclen(enc,p)      ONIGENC_MBC_ENC_LEN(enc,p)
     93#define enclen(enc,p,e) ((enc->max_enc_len == enc->min_enc_len) ? enc->min_enc_len : ONIGENC_MBC_ENC_LEN(enc,p,e))
    7694
    7795/* character types bit flag */
     
    99117
    100118typedef struct {
    101   const UChar *name;
     119  short int len;
     120  const UChar name[6];
    102121  int       ctype;
    103   short int len;
    104122} PosixBracketEntryType;
    105123
    106124#define POSIX_BRACKET_ENTRY_INIT(name, ctype) \
    107   {(const UChar* )(name), (ctype), (short int )(sizeof(name) - 1)}
     125  {(short int )(sizeof(name) - 1), (name), (ctype)}
    108126
    109127#ifndef numberof
    110 #define numberof(array) (int )(sizeof(array) / sizeof((array)[0]))
     128# define numberof(array) (int )(sizeof(array) / sizeof((array)[0]))
    111129#endif
    112130
     
    119137
    120138
    121 #define ONIG_ENCODING_INIT_DEFAULT           ONIG_ENCODING_UTF8
     139#define ONIG_ENCODING_INIT_DEFAULT           ONIG_ENCODING_ASCII
    122140
    123141/* for encoding system implementation (internal) */
    124 ONIG_EXTERN int onigenc_ascii_apply_all_case_fold P_((OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg));
    125 ONIG_EXTERN int onigenc_ascii_get_case_fold_codes_by_str P_((OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]));
    126 ONIG_EXTERN int onigenc_apply_all_case_fold_with_map P_((int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg));
    127 ONIG_EXTERN int onigenc_get_case_fold_codes_by_str_with_map P_((int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]));
    128 ONIG_EXTERN int onigenc_not_support_get_ctype_code_range P_((OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[]));
    129 ONIG_EXTERN int onigenc_is_mbc_newline_0x0a P_((const UChar* p, const UChar* end));
     142ONIG_EXTERN int onigenc_ascii_apply_all_case_fold(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc);
     143ONIG_EXTERN int onigenc_ascii_get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[], OnigEncoding enc);
     144ONIG_EXTERN int onigenc_apply_all_case_fold_with_map(int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg);
     145ONIG_EXTERN int onigenc_get_case_fold_codes_by_str_with_map(int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]);
     146ONIG_EXTERN int onigenc_not_support_get_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[], OnigEncoding enc);
     147ONIG_EXTERN int onigenc_is_mbc_newline_0x0a(const UChar* p, const UChar* end, OnigEncoding enc);
     148ONIG_EXTERN int    onigenc_single_byte_ascii_only_case_map(OnigCaseFoldType* flagP, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, OnigUChar* to_end, const struct OnigEncodingTypeST* enc);
    130149
    131150
    132151/* methods for single byte encoding */
    133 ONIG_EXTERN int onigenc_ascii_mbc_case_fold P_((OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower));
    134 ONIG_EXTERN int onigenc_single_byte_mbc_enc_len P_((const UChar* p));
    135 ONIG_EXTERN OnigCodePoint onigenc_single_byte_mbc_to_code P_((const UChar* p, const UChar* end));
    136 ONIG_EXTERN int onigenc_single_byte_code_to_mbclen P_((OnigCodePoint code));
    137 ONIG_EXTERN int onigenc_single_byte_code_to_mbc P_((OnigCodePoint code, UChar *buf));
    138 ONIG_EXTERN UChar* onigenc_single_byte_left_adjust_char_head P_((const UChar* start, const UChar* s));
    139 ONIG_EXTERN int onigenc_always_true_is_allowed_reverse_match P_((const UChar* s, const UChar* end));
    140 ONIG_EXTERN int onigenc_always_false_is_allowed_reverse_match P_((const UChar* s, const UChar* end));
    141 ONIG_EXTERN int onigenc_ascii_is_code_ctype P_((OnigCodePoint code, unsigned int ctype));
     152ONIG_EXTERN int onigenc_ascii_mbc_case_fold(OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower, OnigEncoding enc);
     153ONIG_EXTERN int onigenc_single_byte_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc);
     154ONIG_EXTERN OnigCodePoint onigenc_single_byte_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc);
     155ONIG_EXTERN int onigenc_single_byte_code_to_mbclen(OnigCodePoint code, OnigEncoding enc);
     156ONIG_EXTERN int onigenc_single_byte_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc);
     157ONIG_EXTERN UChar* onigenc_single_byte_left_adjust_char_head(const UChar* start, const UChar* s, const OnigUChar* end, OnigEncoding enc);
     158ONIG_EXTERN int onigenc_always_true_is_allowed_reverse_match(const UChar* s, const UChar* end, OnigEncoding enc);
     159ONIG_EXTERN int onigenc_always_false_is_allowed_reverse_match(const UChar* s, const UChar* end, OnigEncoding enc);
     160ONIG_EXTERN int onigenc_ascii_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc);
    142161
    143162/* methods for multi byte encoding */
    144 ONIG_EXTERN OnigCodePoint onigenc_mbn_mbc_to_code P_((OnigEncoding enc, const UChar* p, const UChar* end));
    145 ONIG_EXTERN int onigenc_mbn_mbc_case_fold P_((OnigEncoding enc, OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower));
    146 ONIG_EXTERN int onigenc_mb2_code_to_mbclen P_((OnigCodePoint code));
    147 ONIG_EXTERN int onigenc_mb2_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, UChar *buf));
    148 ONIG_EXTERN int onigenc_minimum_property_name_to_ctype P_((OnigEncoding enc, UChar* p, UChar* end));
    149 ONIG_EXTERN int onigenc_unicode_property_name_to_ctype P_((OnigEncoding enc, UChar* p, UChar* end));
    150 ONIG_EXTERN int onigenc_mb2_is_code_ctype P_((OnigEncoding enc, OnigCodePoint code, unsigned int ctype));
    151 ONIG_EXTERN int onigenc_mb4_code_to_mbclen P_((OnigCodePoint code));
    152 ONIG_EXTERN int onigenc_mb4_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, UChar *buf));
    153 ONIG_EXTERN int onigenc_mb4_is_code_ctype P_((OnigEncoding enc, OnigCodePoint code, unsigned int ctype));
     163ONIG_EXTERN OnigCodePoint onigenc_mbn_mbc_to_code(OnigEncoding enc, const UChar* p, const UChar* end);
     164ONIG_EXTERN int onigenc_mbn_mbc_case_fold(OnigEncoding enc, OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower);
     165ONIG_EXTERN int onigenc_mb2_code_to_mbclen(OnigCodePoint code, OnigEncoding enc);
     166ONIG_EXTERN int onigenc_mb2_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf);
     167ONIG_EXTERN int onigenc_minimum_property_name_to_ctype(OnigEncoding enc, const UChar* p, const UChar* end);
     168ONIG_EXTERN int onigenc_unicode_property_name_to_ctype(OnigEncoding enc, const UChar* p, const UChar* end);
     169ONIG_EXTERN int onigenc_mb2_is_code_ctype(OnigEncoding enc, OnigCodePoint code, unsigned int ctype);
     170ONIG_EXTERN int onigenc_mb4_code_to_mbclen(OnigCodePoint code, OnigEncoding enc);
     171ONIG_EXTERN int onigenc_mb4_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf);
     172ONIG_EXTERN int onigenc_mb4_is_code_ctype(OnigEncoding enc, OnigCodePoint code, unsigned int ctype);
     173
     174ONIG_EXTERN int onigenc_unicode_case_map(OnigCaseFoldType* flagP, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, OnigUChar* to_end, const struct OnigEncodingTypeST* enc);
    154175
    155176
    156177/* in enc/unicode.c */
    157 ONIG_EXTERN int onigenc_unicode_is_code_ctype P_((OnigCodePoint code, unsigned int ctype));
    158 ONIG_EXTERN int onigenc_utf16_32_get_ctype_code_range P_((OnigCtype ctype, OnigCodePoint *sb_out, const OnigCodePoint* ranges[]));
    159 ONIG_EXTERN int onigenc_unicode_ctype_code_range P_((int ctype, const OnigCodePoint* ranges[]));
    160 ONIG_EXTERN int onigenc_unicode_get_case_fold_codes_by_str P_((OnigEncoding enc, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]));
    161 ONIG_EXTERN int onigenc_unicode_mbc_case_fold P_((OnigEncoding enc, OnigCaseFoldType flag, const UChar** pp, const UChar* end, UChar* fold));
    162 ONIG_EXTERN int onigenc_unicode_apply_all_case_fold P_((OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg));
     178ONIG_EXTERN int onigenc_unicode_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc);
     179ONIG_EXTERN int onigenc_utf16_32_get_ctype_code_range(OnigCtype ctype, OnigCodePoint *sb_out, const OnigCodePoint* ranges[], OnigEncoding enc);
     180ONIG_EXTERN int onigenc_unicode_ctype_code_range(int ctype, const OnigCodePoint* ranges[]);
     181ONIG_EXTERN int onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]);
     182ONIG_EXTERN int onigenc_unicode_mbc_case_fold(OnigEncoding enc, OnigCaseFoldType flag, const UChar** pp, const UChar* end, UChar* fold);
     183ONIG_EXTERN int onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc);
    163184
    164185
    165186#define UTF16_IS_SURROGATE_FIRST(c)    (((c) & 0xfc) == 0xd8)
    166187#define UTF16_IS_SURROGATE_SECOND(c)   (((c) & 0xfc) == 0xdc)
     188#define UTF16_IS_SURROGATE(c)          (((c) & 0xf8) == 0xd8)
     189#define UNICODE_VALID_CODEPOINT_P(c) ( \
     190        ((c) <= 0x10ffff) && \
     191        !((c) < 0x10000 && UTF16_IS_SURROGATE((c) >> 8)))
    167192
    168193#define ONIGENC_ISO_8859_1_TO_LOWER_CASE(c) \
     
    175200
    176201ONIG_EXTERN int
    177 onigenc_with_ascii_strncmp P_((OnigEncoding enc, const UChar* p, const UChar* end, const UChar* sascii /* ascii */, int n));
     202onigenc_with_ascii_strncmp(OnigEncoding enc, const UChar* p, const UChar* end, const UChar* sascii /* ascii */, int n);
    178203ONIG_EXTERN int
    179 onigenc_with_ascii_strnicmp P_((OnigEncoding enc, const UChar* p, const UChar* end, const UChar* sascii /* ascii */, int n));
     204onigenc_with_ascii_strnicmp(OnigEncoding enc, const UChar* p, const UChar* end, const UChar* sascii /* ascii */, int n);
    180205ONIG_EXTERN UChar*
    181 onigenc_step P_((OnigEncoding enc, const UChar* p, const UChar* end, int n));
     206onigenc_step(OnigEncoding enc, const UChar* p, const UChar* end, int n);
    182207
    183208/* defined in regexec.c, but used in enc/xxx.c */
    184 extern int  onig_is_in_code_range P_((const UChar* p, OnigCodePoint code));
     209extern int  onig_is_in_code_range(const UChar* p, OnigCodePoint code);
    185210
    186211ONIG_EXTERN OnigEncoding  OnigEncDefaultCharEncoding;
     
    203228
    204229
    205 #endif /* REGENC_H */
     230#ifdef ONIG_ENC_REGISTER
     231extern int ONIG_ENC_REGISTER(const char *, OnigEncoding);
     232# define OnigEncodingName(n) encoding_##n
     233# define OnigEncodingDeclare(n) static const OnigEncodingType OnigEncodingName(n)
     234# define OnigEncodingDefine(f,n)                             \
     235    OnigEncodingDeclare(n);                          \
     236    void Init_##f(void) {                            \
     237        ONIG_ENC_REGISTER(OnigEncodingName(n).name,  \
     238                          &OnigEncodingName(n));     \
     239    }                                                \
     240    OnigEncodingDeclare(n)
     241#else
     242# define OnigEncodingName(n) OnigEncoding##n
     243# define OnigEncodingDeclare(n) const OnigEncodingType OnigEncodingName(n)
     244# define OnigEncodingDefine(f,n) OnigEncodingDeclare(n)
     245#endif
     246
     247/* macros for define replica encoding and encoding alias */
     248#define ENC_REPLICATE(name, orig)
     249#define ENC_ALIAS(name, orig)
     250#define ENC_DUMMY(name)
     251
     252RUBY_SYMBOL_EXPORT_END
     253
     254#endif /* ONIGMO_REGENC_H */
Note: See TracChangeset for help on using the changeset viewer.