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
d0c1b7b4
Commit
d0c1b7b4
authored
Jul 30, 2012
by
Yukihiro Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:mruby/mruby
parents
bd035bcb
179b2ace
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
23 additions
and
18 deletions
+23
-18
include/mruby/array.h
include/mruby/array.h
+0
-1
include/mruby/hash.h
include/mruby/hash.h
+0
-3
include/mruby/numeric.h
include/mruby/numeric.h
+0
-1
include/mruby/string.h
include/mruby/string.h
+0
-3
include/mruby/struct.h
include/mruby/struct.h
+0
-3
include/mruby/variable.h
include/mruby/variable.h
+0
-1
src/hash.c
src/hash.c
+2
-2
test/driver.c
test/driver.c
+17
-3
tools/mrbc/mrbc.c
tools/mrbc/mrbc.c
+4
-1
No files found.
include/mruby/array.h
View file @
d0c1b7b4
...
...
@@ -54,7 +54,6 @@ mrb_value mrb_ary_unshift(mrb_state *mrb, mrb_value self, mrb_value item);
mrb_value
mrb_ary_new4
(
mrb_state
*
mrb
,
int
n
,
const
mrb_value
*
elts
);
mrb_value
mrb_assoc_new
(
mrb_state
*
mrb
,
mrb_value
car
,
mrb_value
cdr
);
mrb_value
mrb_ary_entry
(
mrb_value
ary
,
int
offset
);
mrb_value
mrb_ary_sort
(
mrb_state
*
mrb
,
mrb_value
ary
);
mrb_value
mrb_ary_shift
(
mrb_state
*
mrb
,
mrb_value
self
);
#if defined(__cplusplus)
...
...
include/mruby/hash.h
View file @
d0c1b7b4
...
...
@@ -26,10 +26,7 @@ mrb_value mrb_hash_new(mrb_state *mrb);
void
mrb_hash_set
(
mrb_state
*
mrb
,
mrb_value
hash
,
mrb_value
key
,
mrb_value
val
);
mrb_value
mrb_hash_get
(
mrb_state
*
mrb
,
mrb_value
hash
,
mrb_value
key
);
mrb_value
mrb_hash_fetch
(
mrb_state
*
mrb
,
mrb_value
hash
,
mrb_value
key
,
mrb_value
def
);
mrb_value
mrb_hash_delete_key
(
mrb_state
*
mrb
,
mrb_value
hash
,
mrb_value
key
);
mrb_value
mrb_hash_keys
(
mrb_state
*
mrb
,
mrb_value
hash
);
mrb_value
mrb_hash
(
mrb_state
*
mrb
,
mrb_value
obj
);
mrb_value
mrb_check_hash_type
(
mrb_state
*
mrb
,
mrb_value
self
);
/* RHASH_TBL allocates st_table if not available. */
#define RHASH(obj) ((struct RHash*)((obj).value.p))
...
...
include/mruby/numeric.h
View file @
d0c1b7b4
...
...
@@ -18,7 +18,6 @@ extern "C" {
#define FIXABLE(f) (POSFIXABLE(f) && NEGFIXABLE(f))
mrb_value
mrb_flt2big
(
mrb_state
*
mrb
,
mrb_float
d
);
void
mrb_num_zerodiv
(
mrb_state
*
mrb
);
mrb_value
mrb_fix2str
(
mrb_state
*
mrb
,
mrb_value
x
,
int
base
);
mrb_value
mrb_fixnum_plus
(
mrb_state
*
mrb
,
mrb_value
x
,
mrb_value
y
);
...
...
include/mruby/string.h
View file @
d0c1b7b4
...
...
@@ -52,7 +52,6 @@ struct RString {
void
mrb_str_decref
(
mrb_state
*
,
struct
mrb_shared_string
*
);
mrb_value
mrb_str_literal
(
mrb_state
*
,
mrb_value
);
void
mrb_str_concat
(
mrb_state
*
,
mrb_value
,
mrb_value
);
mrb_value
mrb_obj_to_str
(
mrb_state
*
,
mrb_value
);
mrb_value
mrb_str_plus
(
mrb_state
*
,
mrb_value
,
mrb_value
);
mrb_value
mrb_obj_as_string
(
mrb_state
*
mrb
,
mrb_value
obj
);
mrb_value
mrb_str_resize
(
mrb_state
*
mrb
,
mrb_value
str
,
int
len
);
/* mrb_str_resize */
...
...
@@ -78,8 +77,6 @@ int mrb_str_hash_cmp(mrb_state *mrb, mrb_value str1, mrb_value str2);
mrb_value
mrb_str_buf_append
(
mrb_state
*
mrb
,
mrb_value
str
,
mrb_value
str2
);
mrb_value
mrb_str_inspect
(
mrb_state
*
mrb
,
mrb_value
str
);
int
mrb_str_equal
(
mrb_state
*
mrb
,
mrb_value
str1
,
mrb_value
str2
);
mrb_value
*
mrb_svar
(
mrb_int
cnt
);
mrb_value
mrb_str_drop_bytes
(
mrb_state
*
mrb
,
mrb_value
str
,
long
len
);
mrb_value
mrb_str_dump
(
mrb_state
*
mrb
,
mrb_value
str
);
mrb_value
mrb_str_cat
(
mrb_state
*
mrb
,
mrb_value
str
,
const
char
*
ptr
,
long
len
);
mrb_value
mrb_str_append
(
mrb_state
*
mrb
,
mrb_value
str
,
mrb_value
str2
);
...
...
include/mruby/struct.h
View file @
d0c1b7b4
...
...
@@ -20,9 +20,6 @@ struct RStruct {
#define RSTRUCT_LEN(st) ((int)(RSTRUCT(st)->len))
#define RSTRUCT_PTR(st) (RSTRUCT(st)->ptr)
mrb_value
mrb_yield_values
(
int
n
,
...);
mrb_value
mrb_mod_module_eval
(
mrb_state
*
mrb
,
int
argc
,
mrb_value
*
argv
,
mrb_value
mod
);
#if defined(__cplusplus)
}
/* extern "C" { */
#endif
...
...
include/mruby/variable.h
View file @
d0c1b7b4
...
...
@@ -44,7 +44,6 @@ const char * mrb_class2name(mrb_state *mrb, struct RClass* klass);
mrb_value
mrb_iv_get
(
mrb_state
*
mrb
,
mrb_value
obj
,
mrb_sym
sym
);
void
mrb_iv_set
(
mrb_state
*
mrb
,
mrb_value
obj
,
mrb_sym
sym
,
mrb_value
v
);
mrb_value
mrb_iv_remove
(
mrb_state
*
mrb
,
mrb_value
obj
,
mrb_sym
sym
);
void
mrb_copy_generic_ivar
(
mrb_value
clone
,
mrb_value
obj
);
int
mrb_const_defined_at
(
mrb_state
*
mrb
,
struct
RClass
*
klass
,
mrb_sym
id
);
mrb_value
mrb_f_global_variables
(
mrb_state
*
mrb
,
mrb_value
self
);
mrb_value
mrb_gv_get
(
mrb_state
*
mrb
,
mrb_sym
sym
);
...
...
src/hash.c
View file @
d0c1b7b4
...
...
@@ -488,7 +488,7 @@ mrb_hash_set_default_proc(mrb_state *mrb, mrb_value hash)
return
ifnone
;
}
mrb_value
static
mrb_value
mrb_hash_delete_key
(
mrb_state
*
mrb
,
mrb_value
hash
,
mrb_value
key
)
{
khash_t
(
ht
)
*
h
=
RHASH_TBL
(
hash
);
...
...
@@ -965,7 +965,7 @@ mrb_hash_to_hash(mrb_state *mrb, mrb_value hash)
*
*/
mrb_value
static
mrb_value
mrb_hash_keys
(
mrb_state
*
mrb
,
mrb_value
hash
)
{
khash_t
(
ht
)
*
h
=
RHASH_TBL
(
hash
);
...
...
test/driver.c
View file @
d0c1b7b4
...
...
@@ -11,6 +11,7 @@
#include <mruby/proc.h>
#include <mruby/data.h>
#include <mruby/compile.h>
#include <mruby/variable.h>
void
mrb_init_mrbtest
(
mrb_state
*
);
...
...
@@ -23,12 +24,24 @@ void print_hint(void)
printf
(
"Thanks :)
\n\n
"
);
}
static
int
check_error
(
mrb_state
*
mrb
)
{
/* Error check */
/* $ko_test and $kill_test should be 0 */
mrb_value
ko_test
=
mrb_gv_get
(
mrb
,
mrb_intern
(
mrb
,
"$ko_test"
));
mrb_value
kill_test
=
mrb_gv_get
(
mrb
,
mrb_intern
(
mrb
,
"$kill_test"
));
return
FIXNUM_P
(
ko_test
)
&&
mrb_fixnum
(
ko_test
)
==
0
&&
FIXNUM_P
(
kill_test
)
&&
mrb_fixnum
(
kill_test
)
==
0
;
}
int
main
(
void
)
{
mrb_state
*
mrb
;
mrb_value
return_value
;
const
char
*
prog
=
"report()"
;
int
ret
=
EXIT_SUCCESS
;
print_hint
();
...
...
@@ -46,11 +59,12 @@ main(void)
if
(
mrb
->
exc
)
{
mrb_p
(
mrb
,
return_value
);
mrb
->
exc
=
0
;
ret
=
EXIT_FAILURE
;
}
else
{
/* no */
else
if
(
!
check_error
(
mrb
))
{
ret
=
EXIT_FAILURE
;
}
mrb_close
(
mrb
);
return
EXIT_SUCCESS
;
return
ret
;
}
tools/mrbc/mrbc.c
View file @
d0c1b7b4
...
...
@@ -135,7 +135,10 @@ parse_args(mrb_state *mrb, int argc, char **argv, struct _args *args)
if
(
outfile
==
NULL
)
outfile
=
get_outfilename
(
infile
,
args
->
ext
);
if
((
args
->
wfp
=
fopen
(
outfile
,
"wb"
))
==
NULL
)
{
if
(
strcmp
(
"-"
,
outfile
)
==
0
)
{
args
->
wfp
=
stdout
;
}
else
if
((
args
->
wfp
=
fopen
(
outfile
,
"wb"
))
==
NULL
)
{
printf
(
"%s: Cannot open output file. (%s)
\n
"
,
*
origargv
,
outfile
);
return
0
;
}
...
...
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