Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
ef73ec56
Commit
ef73ec56
authored
Oct 08, 2015
by
Seba Gamboa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
array header cleanup
parent
11fb10a2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
39 deletions
+23
-39
include/mruby/array.h
include/mruby/array.h
+23
-39
No files found.
include/mruby/array.h
View file @
ef73ec56
...
...
@@ -9,7 +9,7 @@
#include "mruby/common.h"
/*
*
/*
* Array class
*/
MRB_BEGIN_DECL
...
...
@@ -46,89 +46,74 @@ void mrb_ary_decref(mrb_state*, mrb_shared_array*);
MRB_API
void
mrb_ary_modify
(
mrb_state
*
,
struct
RArray
*
);
MRB_API
mrb_value
mrb_ary_new_capa
(
mrb_state
*
,
mrb_int
);
/*
*
/*
* Initializes a new array.
*
* Equivalent to:
*
* Array.new
*
* @param mrb
* The MRuby state reference.
* @return
* The initialized array
* @param mrb The mruby state reference.
* @return The initialized array
*/
MRB_API
mrb_value
mrb_ary_new
(
mrb_state
*
mrb
);
MRB_API
mrb_value
mrb_ary_new_from_values
(
mrb_state
*
mrb
,
mrb_int
size
,
const
mrb_value
*
vals
);
MRB_API
mrb_value
mrb_assoc_new
(
mrb_state
*
mrb
,
mrb_value
car
,
mrb_value
cdr
);
MRB_API
void
mrb_ary_concat
(
mrb_state
*
,
mrb_value
,
mrb_value
);
MRB_API
mrb_value
mrb_ary_splat
(
mrb_state
*
,
mrb_value
);
/*
*
/*
* Pushes value into array.
*
* Equivalent to:
*
* ary << value
*
* @param mrb
* The MRuby state reference.
* @param ary
* The array in which the value will be pushed
* @param value
* The value to be pushed into array
* @param mrb The mruby state reference.
* @param ary The array in which the value will be pushed
* @param value The value to be pushed into array
*/
MRB_API
void
mrb_ary_push
(
mrb_state
*
mrb
,
mrb_value
array
,
mrb_value
value
);
/*
*
/*
* Pops the last element from the array.
*
* Equivalent to:
*
* ary.pop
*
* @param mrb
* The MRuby state reference.
* @param ary
* The array from which the value will be poped.
* @return
* The poped value.
* @param mrb The mruby state reference.
* @param ary The array from which the value will be poped.
* @return The poped value.
*/
MRB_API
mrb_value
mrb_ary_pop
(
mrb_state
*
mrb
,
mrb_value
ary
);
/*
*
/*
* Returns a reference to an element of the array on the given index.
*
* Equivalent to:
*
* ary[n]
*
* @param mrb
* The MRuby state reference.
* @param ary
* The target array.
* @param n
* The array index being referenced
* @return
* The referenced value.
* @param mrb The mruby state reference.
* @param ary The target array.
* @param n The array index being referenced
* @return The referenced value.
*/
MRB_API
mrb_value
mrb_ary_ref
(
mrb_state
*
mrb
,
mrb_value
ary
,
mrb_int
n
);
/*
*
/*
* Sets a value on an array at the given index
*
* Equivalent to:
*
* ary[n] = val
*
* @param mrb
* The MRuby state reference.
* @param ary
* The target array.
* @param n
* The array index being referenced.
* @param val
* The value being setted.
* @param mrb The mruby state reference.
* @param ary The target array.
* @param n The array index being referenced.
* @param val The value being setted.
*/
MRB_API
void
mrb_ary_set
(
mrb_state
*
mrb
,
mrb_value
ary
,
mrb_int
n
,
mrb_value
val
);
...
...
@@ -149,7 +134,6 @@ mrb_ary_len(mrb_state *mrb, mrb_value ary)
return
RARRAY_LEN
(
ary
);
}
/** @} */
MRB_END_DECL
#endif
/* MRUBY_ARRAY_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment