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/mruby-1.3.0
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/mruby-1.3.0/include/mruby/array.h

    r321 r331  
    88#define MRUBY_ARRAY_H
    99
    10 #include "mruby/common.h"
     10#include "common.h"
    1111
    1212/*
     
    5555 *
    5656 * @param mrb The mruby state reference.
    57  * @return The initialized array
     57 * @return The initialized array.
    5858 */
    5959MRB_API mrb_value mrb_ary_new(mrb_state *mrb);
    6060
     61/*
     62 * Initializes a new array with initial values
     63 *
     64 * Equivalent to:
     65 *
     66 *      Array[value1, value2, ...]
     67 *
     68 * @param mrb The mruby state reference.
     69 * @param size The numer of values.
     70 * @param vals The actual values.
     71 * @return The initialized array.
     72 */
    6173MRB_API mrb_value mrb_ary_new_from_values(mrb_state *mrb, mrb_int size, const mrb_value *vals);
     74
     75/*
     76 * Initializes a new array with two initial values
     77 *
     78 * Equivalent to:
     79 *
     80 *      Array[car, cdr]
     81 *
     82 * @param mrb The mruby state reference.
     83 * @param car The first value.
     84 * @param cdr The second value.
     85 * @return The initialized array.
     86 */
    6287MRB_API mrb_value mrb_assoc_new(mrb_state *mrb, mrb_value car, mrb_value cdr);
    63 MRB_API void mrb_ary_concat(mrb_state*, mrb_value, mrb_value);
    64 MRB_API mrb_value mrb_ary_splat(mrb_state*, mrb_value);
     88
     89/*
     90 * Concatenate two arrays. The target array will be modified
     91 *
     92 * Equivalent to:
     93 *      ary.concat(other)
     94 *
     95 * @param mrb The mruby state reference.
     96 * @param self The target array.
     97 * @param other The array that will be concatenated to self.
     98 */
     99MRB_API void mrb_ary_concat(mrb_state *mrb, mrb_value self, mrb_value other);
     100
     101/*
     102 * Create an array from the input. It tries calling to_a on the
     103 * value. If value does not respond to that, it creates a new
     104 * array with just this value.
     105 *
     106 * @param mrb The mruby state reference.
     107 * @param value The value to change into an array.
     108 * @return An array representation of value.
     109 */
     110MRB_API mrb_value mrb_ary_splat(mrb_state *mrb, mrb_value value);
    65111
    66112/*
     
    85131 *
    86132 * @param mrb The mruby state reference.
    87  * @param ary The array from which the value will be poped.
    88  * @return The poped value.
     133 * @param ary The array from which the value will be popped.
     134 * @return The popped value.
    89135 */
    90136MRB_API mrb_value mrb_ary_pop(mrb_state *mrb, mrb_value ary);
     
    118164MRB_API void mrb_ary_set(mrb_state *mrb, mrb_value ary, mrb_int n, mrb_value val);
    119165
    120 MRB_API void mrb_ary_replace(mrb_state *mrb, mrb_value a, mrb_value b);
     166/*
     167 * Replace the array with another array
     168 *
     169 * Equivalent to:
     170 *
     171 *      ary.replace(other)
     172 *
     173 * @param mrb The mruby state reference
     174 * @param self The target array.
     175 * @param other The array to replace it with.
     176 */
     177MRB_API void mrb_ary_replace(mrb_state *mrb, mrb_value self, mrb_value other);
    121178MRB_API mrb_value mrb_check_array_type(mrb_state *mrb, mrb_value self);
     179
     180/*
     181 * Unshift an element into an array
     182 *
     183 * Equivalent to:
     184 *
     185 *     ary.unshift(item)
     186 *
     187 * @param mrb The mruby state reference.
     188 * @param self The target array.
     189 * @param item The item to unshift.
     190 */
    122191MRB_API mrb_value mrb_ary_unshift(mrb_state *mrb, mrb_value self, mrb_value item);
    123192MRB_API mrb_value mrb_ary_entry(mrb_value ary, mrb_int offset);
     193
     194/*
     195 * Shifts the first element from the array.
     196 *
     197 * Equivalent to:
     198 *
     199 *      ary.shift
     200 *
     201 * @param mrb The mruby state reference.
     202 * @param self The array from which the value will be shifted.
     203 * @return The shifted value.
     204 */
    124205MRB_API mrb_value mrb_ary_shift(mrb_state *mrb, mrb_value self);
     206
     207/*
     208 * Removes all elements from this array
     209 *
     210 * Equivalent to:
     211 *
     212 *      ary.clear
     213 *
     214 * @param mrb The mruby state reference.
     215 * @param self The target array.
     216 * @return self
     217 */
    125218MRB_API mrb_value mrb_ary_clear(mrb_state *mrb, mrb_value self);
     219
     220/*
     221 * Join the array elements together in a string
     222 *
     223 * Equivalent to:
     224 *
     225 *      ary.join(sep="")
     226 *
     227 * @param mrb The mruby state reference.
     228 * @param ary The target array
     229 * @param sep The separater, can be NULL
     230 */
    126231MRB_API mrb_value mrb_ary_join(mrb_state *mrb, mrb_value ary, mrb_value sep);
    127 MRB_API mrb_value mrb_ary_resize(mrb_state *mrb, mrb_value ary, mrb_int len);
     232
     233/*
     234 * Update the capacity of the array
     235 *
     236 * @param mrb The mruby state reference.
     237 * @param ary The target array.
     238 * @param new_len The new capacity of the array
     239 */
     240MRB_API mrb_value mrb_ary_resize(mrb_state *mrb, mrb_value ary, mrb_int new_len);
    128241
    129242static inline mrb_int
     
    135248}
    136249
     250static inline mrb_value
     251ary_elt(mrb_value ary, mrb_int offset)
     252{
     253  if (offset < 0 || RARRAY_LEN(ary) <= offset) {
     254    return mrb_nil_value();
     255  }
     256  return RARRAY_PTR(ary)[offset];
     257}
     258
    137259MRB_END_DECL
    138260
Note: See TracChangeset for help on using the changeset viewer.