Header: mruby/array.h
Overview
Array class
Function Summary collapse
- void mrb_ary_modify(mrb_state*, struct RArray*)
- mrb_value mrb_ary_new_capa(mrb_state*, mrb_int)
-
mrb_value mrb_ary_new(mrb_state *)
Initializes a new array.
- mrb_value mrb_ary_new_from_values(mrb_state *, mrb_int, const mrb_value *)
- mrb_value mrb_assoc_new(mrb_state *, mrb_value, mrb_value)
- void mrb_ary_concat(mrb_state*, mrb_value, mrb_value)
- mrb_value mrb_ary_splat(mrb_state*, mrb_value)
-
void mrb_ary_push(mrb_state *, mrb_value, mrb_value)
Pushes value into array.
-
mrb_value mrb_ary_pop(mrb_state *, mrb_value)
Pops the last element from the array.
-
mrb_value mrb_ary_ref(mrb_state *, mrb_value, mrb_int)
Returns a reference to an element of the array on the given index.
-
void mrb_ary_set(mrb_state *, mrb_value, mrb_int, mrb_value)
Sets a value on an array at the given index.
- void mrb_ary_replace(mrb_state *, mrb_value, mrb_value)
- mrb_value mrb_check_array_type(mrb_state *, mrb_value)
- mrb_value mrb_ary_unshift(mrb_state *, mrb_value, mrb_value)
- mrb_value mrb_ary_entry(mrb_value, mrb_int)
- mrb_value mrb_ary_shift(mrb_state *, mrb_value)
- mrb_value mrb_ary_clear(mrb_state *, mrb_value)
- mrb_value mrb_ary_join(mrb_state *, mrb_value, mrb_value)
- mrb_value mrb_ary_resize(mrb_state *, mrb_value, mrb_int)
Define Summary
- #define MRUBY_ARRAY_H
- #define mrb_ary_ptr
- #define mrb_ary_value
- #define RARRAY
- #define RARRAY_LEN
- #define RARRAY_PTR
- #define MRB_ARY_SHARED
- #define ARY_SHARED_P
- #define ARY_SET_SHARED_FLAG
- #define ARY_UNSET_SHARED_FLAG
Function Details
void mrb_ary_modify(mrb_state* , struct RArray* )
mrb_value mrb_ary_new_capa(mrb_state* , mrb_int )
mrb_value mrb_ary_new(mrb_state * mrb)
Initializes a new array.
Equivalent to:
Array.new
mrb_value mrb_ary_new_from_values(mrb_state * mrb, mrb_int size, const mrb_value * vals)
mrb_value mrb_assoc_new(mrb_state * mrb, mrb_value car, mrb_value cdr)
void mrb_ary_concat(mrb_state* , mrb_value , mrb_value )
mrb_value mrb_ary_splat(mrb_state* , mrb_value )
void mrb_ary_push(mrb_state * mrb, mrb_value array, mrb_value value)
Pushes value into array.
Equivalent to:
ary << value
mrb_value mrb_ary_pop(mrb_state * mrb, mrb_value ary)
Pops the last element from the array.
Equivalent to:
ary.pop
mrb_value mrb_ary_ref(mrb_state * mrb, mrb_value ary, mrb_int n)
Returns a reference to an element of the array on the given index.
Equivalent to:
ary[n]
void mrb_ary_set(mrb_state * mrb, mrb_value ary, mrb_int n, mrb_value val)
Sets a value on an array at the given index
Equivalent to:
ary[n] = val