Commit 65a7eac1 authored by cremno's avatar cremno

mruby-struct: remove unused functions

parent 64b0e48d
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
*/ */
#include <string.h> #include <string.h>
#include <stdarg.h>
#include "mruby.h" #include "mruby.h"
#include "mruby/array.h" #include "mruby/array.h"
#include "mruby/string.h" #include "mruby/string.h"
...@@ -40,12 +39,6 @@ struct_ivar_get(mrb_state *mrb, mrb_value c, mrb_sym id) ...@@ -40,12 +39,6 @@ struct_ivar_get(mrb_state *mrb, mrb_value c, mrb_sym id)
} }
} }
static mrb_value
mrb_struct_iv_get(mrb_state *mrb, mrb_value c, const char *name)
{
return struct_ivar_get(mrb, c, mrb_intern_cstr(mrb, name));
}
static mrb_value static mrb_value
mrb_struct_s_members(mrb_state *mrb, mrb_value klass) mrb_struct_s_members(mrb_state *mrb, mrb_value klass)
{ {
...@@ -283,27 +276,6 @@ make_struct(mrb_state *mrb, mrb_value name, mrb_value members, struct RClass * k ...@@ -283,27 +276,6 @@ make_struct(mrb_state *mrb, mrb_value name, mrb_value members, struct RClass * k
return nstr; return nstr;
} }
static mrb_value
mrb_struct_define(mrb_state *mrb, const char *name, ...)
{
va_list ar;
mrb_value nm, ary;
char *mem;
if (!name) nm = mrb_nil_value();
else nm = mrb_str_new_cstr(mrb, name);
ary = mrb_ary_new(mrb);
va_start(ar, name);
while ((mem = va_arg(ar, char*)) != 0) {
mrb_sym slot = mrb_intern_cstr(mrb, mem);
mrb_ary_push(mrb, ary, mrb_symbol_value(slot));
}
va_end(ar);
return make_struct(mrb, nm, ary, struct_class(mrb));
}
/* 15.2.18.3.1 */ /* 15.2.18.3.1 */
/* /*
* call-seq: * call-seq:
...@@ -435,12 +407,6 @@ mrb_struct_initialize_m(mrb_state *mrb, /*int argc, mrb_value *argv,*/ mrb_value ...@@ -435,12 +407,6 @@ mrb_struct_initialize_m(mrb_state *mrb, /*int argc, mrb_value *argv,*/ mrb_value
return mrb_struct_initialize_withArg(mrb, argc, argv, self); return mrb_struct_initialize_withArg(mrb, argc, argv, self);
} }
static mrb_value
mrb_struct_initialize(mrb_state *mrb, mrb_value self, mrb_value values)
{
return mrb_struct_initialize_withArg(mrb, RARRAY_LEN(values), RARRAY_PTR(values), self);
}
static mrb_value static mrb_value
inspect_struct(mrb_state *mrb, mrb_value s, mrb_bool recur) inspect_struct(mrb_state *mrb, mrb_value s, mrb_bool recur)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment