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

    r321 r331  
    1 /* This is a public domain general purpose hash table package written by Peter Moore @ UCB. */
     1/* This is a public domain general purpose hash table package
     2   originally written by Peter Moore @ UCB.
    23
    3 /* @(#) st.h 5.1 89/12/14 */
     4   The hash table data strutures were redesigned and the package was
     5   rewritten by Vladimir Makarov <vmakarov@redhat.com>.  */
    46
    5 #ifndef ST_INCLUDED
     7#ifndef RUBY_ST_H
     8#define RUBY_ST_H 1
    69
    7 #define ST_INCLUDED
     10#if defined(__cplusplus)
     11extern "C" {
     12#if 0
     13} /* satisfy cc-mode */
     14#endif
     15#endif
    816
    9 typedef uintptr_t st_data_t;
     17#ifdef RUBY
     18#include "ruby/defines.h"
     19#else /* RUBY */
     20#ifndef RUBY_SYMBOL_EXPORT_BEGIN
     21#define RUBY_SYMBOL_EXPORT_BEGIN
     22#define RUBY_SYMBOL_EXPORT_END
     23#endif
     24#endif /* RUBY */
     25
     26RUBY_SYMBOL_EXPORT_BEGIN
     27
     28#if SIZEOF_LONG == SIZEOF_VOIDP
     29typedef unsigned long st_data_t;
     30#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
     31typedef unsigned LONG_LONG st_data_t;
     32#else
     33# error ---->> st.c requires sizeof(void*) == sizeof(long) or sizeof(LONG_LONG) to be compiled. <<----
     34#endif
    1035#define ST_DATA_T_DEFINED
    1136
    12 typedef struct st_table st_table;
    13 typedef int st_index_t;
    14 
    15 struct st_hash_type {
    16     int (*compare)();
    17     int (*hash)();
    18 };
    19 
    20 struct st_table {
    21     struct st_hash_type *type;
    22     int num_bins;
    23     int num_entries;
    24     struct st_table_entry **bins;
    25 };
    26 
    27 #define st_is_member(table,key) st_lookup(table,key,(st_data_t *)0)
    28 
    29 enum st_retval {ST_CONTINUE, ST_STOP, ST_DELETE, ST_CHECK};
    30 
     37#ifndef CHAR_BIT
     38# ifdef HAVE_LIMITS_H
     39#  include <limits.h>
     40# else
     41#  define CHAR_BIT 8
     42# endif
     43#endif
    3144#ifndef _
    3245# define _(args) args
     
    4053#endif
    4154
    42 st_table *st_init_table _((struct st_hash_type *));
    43 st_table *st_init_table_with_size _((struct st_hash_type *, int));
    44 st_table *st_init_numtable _((void));
    45 st_table *st_init_numtable_with_size _((int));
    46 st_table *st_init_strtable _((void));
    47 st_table *st_init_strtable_with_size _((int));
    48 int st_delete _((st_table *, st_data_t *, st_data_t *));
    49 int st_delete_safe _((st_table *, st_data_t *, st_data_t *, st_data_t));
    50 int st_insert _((st_table *, st_data_t, st_data_t));
    51 int st_lookup _((st_table *, st_data_t, st_data_t *));
    52 int st_foreach _((st_table *, int (*)(ANYARGS), st_data_t));
    53 void st_add_direct _((st_table *, st_data_t, st_data_t));
    54 void st_free_table _((st_table *));
    55 void st_cleanup_safe _((st_table *, st_data_t));
    56 st_table *st_copy _((st_table *));
     55typedef struct st_table st_table;
    5756
    58 #define ST_NUMCMP       ((int (*)()) 0)
    59 #define ST_NUMHASH      ((int (*)()) -2)
     57typedef st_data_t st_index_t;
    6058
    61 #define st_numcmp       ST_NUMCMP
    62 #define st_numhash      ST_NUMHASH
     59/* Maximal value of unsigned integer type st_index_t.  */
     60#define MAX_ST_INDEX_VAL (~(st_index_t) 0)
    6361
    64 #endif /* ST_INCLUDED */
     62typedef int st_compare_func(st_data_t, st_data_t);
     63typedef st_index_t st_hash_func(st_data_t);
     64
     65typedef char st_check_for_sizeof_st_index_t[SIZEOF_VOIDP == (int)sizeof(st_index_t) ? 1 : -1];
     66#define SIZEOF_ST_INDEX_T SIZEOF_VOIDP
     67
     68struct st_hash_type {
     69    int (*compare)(ANYARGS /*st_data_t, st_data_t*/); /* st_compare_func* */
     70    st_index_t (*hash)(ANYARGS /*st_data_t*/);        /* st_hash_func* */
     71};
     72
     73#define ST_INDEX_BITS (SIZEOF_ST_INDEX_T * CHAR_BIT)
     74
     75#if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR) && defined(HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P)
     76# define ST_DATA_COMPATIBLE_P(type) \
     77   __builtin_choose_expr(__builtin_types_compatible_p(type, st_data_t), 1, 0)
     78#else
     79# define ST_DATA_COMPATIBLE_P(type) 0
     80#endif
     81
     82typedef struct st_table_entry st_table_entry;
     83
     84struct st_table_entry; /* defined in st.c */
     85
     86struct st_table {
     87    /* Cached features of the table -- see st.c for more details.  */
     88    unsigned char entry_power, bin_power, size_ind;
     89    /* How many times the table was rebuilt.  */
     90    unsigned int rebuilds_num;
     91    const struct st_hash_type *type;
     92    /* Number of entries currently in the table.  */
     93    st_index_t num_entries;
     94    /* Array of bins used for access by keys.  */
     95    st_index_t *bins;
     96    /* Start and bound index of entries in array entries.
     97       entries_starts and entries_bound are in interval
     98       [0,allocated_entries].  */
     99    st_index_t entries_start, entries_bound;
     100    /* Array of size 2^entry_power.  */
     101    st_table_entry *entries;
     102};
     103
     104#define st_is_member(table,key) st_lookup((table),(key),(st_data_t *)0)
     105
     106enum st_retval {ST_CONTINUE, ST_STOP, ST_DELETE, ST_CHECK};
     107
     108st_table *st_init_table(const struct st_hash_type *);
     109st_table *st_init_table_with_size(const struct st_hash_type *, st_index_t);
     110st_table *st_init_numtable(void);
     111st_table *st_init_numtable_with_size(st_index_t);
     112st_table *st_init_strtable(void);
     113st_table *st_init_strtable_with_size(st_index_t);
     114st_table *st_init_strcasetable(void);
     115st_table *st_init_strcasetable_with_size(st_index_t);
     116int st_delete(st_table *, st_data_t *, st_data_t *); /* returns 0:notfound 1:deleted */
     117int st_delete_safe(st_table *, st_data_t *, st_data_t *, st_data_t);
     118int st_shift(st_table *, st_data_t *, st_data_t *); /* returns 0:notfound 1:deleted */
     119int st_insert(st_table *, st_data_t, st_data_t);
     120int st_insert2(st_table *, st_data_t, st_data_t, st_data_t (*)(st_data_t));
     121int st_lookup(st_table *, st_data_t, st_data_t *);
     122int st_get_key(st_table *, st_data_t, st_data_t *);
     123typedef int st_update_callback_func(st_data_t *key, st_data_t *value, st_data_t arg, int existing);
     124/* *key may be altered, but must equal to the old key, i.e., the
     125 * results of hash() are same and compare() returns 0, otherwise the
     126 * behavior is undefined */
     127int st_update(st_table *table, st_data_t key, st_update_callback_func *func, st_data_t arg);
     128int st_foreach(st_table *, int (*)(ANYARGS), st_data_t);
     129int st_foreach_check(st_table *, int (*)(ANYARGS), st_data_t, st_data_t);
     130st_index_t st_keys(st_table *table, st_data_t *keys, st_index_t size);
     131st_index_t st_keys_check(st_table *table, st_data_t *keys, st_index_t size, st_data_t never);
     132st_index_t st_values(st_table *table, st_data_t *values, st_index_t size);
     133st_index_t st_values_check(st_table *table, st_data_t *values, st_index_t size, st_data_t never);
     134void st_add_direct(st_table *, st_data_t, st_data_t);
     135void st_free_table(st_table *);
     136void st_cleanup_safe(st_table *, st_data_t);
     137void st_clear(st_table *);
     138st_table *st_copy(st_table *);
     139int st_numcmp(st_data_t, st_data_t);
     140st_index_t st_numhash(st_data_t);
     141int st_locale_insensitive_strcasecmp(const char *s1, const char *s2);
     142int st_locale_insensitive_strncasecmp(const char *s1, const char *s2, size_t n);
     143#define st_strcasecmp st_locale_insensitive_strcasecmp
     144#define st_strncasecmp st_locale_insensitive_strncasecmp
     145size_t st_memsize(const st_table *);
     146st_index_t st_hash(const void *ptr, size_t len, st_index_t h);
     147st_index_t st_hash_uint32(st_index_t h, uint32_t i);
     148st_index_t st_hash_uint(st_index_t h, st_index_t i);
     149st_index_t st_hash_end(st_index_t h);
     150st_index_t st_hash_start(st_index_t h);
     151#define st_hash_start(h) ((st_index_t)(h))
     152
     153RUBY_SYMBOL_EXPORT_END
     154
     155#if defined(__cplusplus)
     156#if 0
     157{ /* satisfy cc-mode */
     158#endif
     159}  /* extern "C" { */
     160#endif
     161
     162#endif /* RUBY_ST_H */
Note: See TracChangeset for help on using the changeset viewer.