mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Add new API mrb_intern_cstr(). This is for naming orthogonality. mrb_intern is also left for backward compatibility.
This commit is contained in:
+8
-1
@@ -189,13 +189,20 @@ int mrb_get_args(mrb_state *mrb, const char *format, ...);
|
||||
mrb_value mrb_funcall(mrb_state*, mrb_value, const char*, int,...);
|
||||
mrb_value mrb_funcall_argv(mrb_state*, mrb_value, mrb_sym, int, mrb_value*);
|
||||
mrb_value mrb_funcall_with_block(mrb_state*, mrb_value, mrb_sym, int, mrb_value*, mrb_value);
|
||||
mrb_sym mrb_intern(mrb_state*,const char*);
|
||||
mrb_sym mrb_intern_cstr(mrb_state*,const char*);
|
||||
mrb_sym mrb_intern2(mrb_state*,const char*,size_t);
|
||||
mrb_sym mrb_intern_str(mrb_state*,mrb_value);
|
||||
const char *mrb_sym2name(mrb_state*,mrb_sym);
|
||||
const char *mrb_sym2name_len(mrb_state*,mrb_sym,size_t*);
|
||||
mrb_value mrb_str_format(mrb_state *, int, const mrb_value *, mrb_value);
|
||||
|
||||
/* For backward compatibility. */
|
||||
static inline
|
||||
mrb_sym mrb_intern(mrb_state *mrb,const char *cstr)
|
||||
{
|
||||
return mrb_intern_cstr(mrb, cstr);
|
||||
}
|
||||
|
||||
void *mrb_malloc(mrb_state*, size_t);
|
||||
void *mrb_calloc(mrb_state*, size_t, size_t);
|
||||
void *mrb_realloc(mrb_state*, void*, size_t);
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ mrb_intern2(mrb_state *mrb, const char *name, size_t len)
|
||||
}
|
||||
|
||||
mrb_sym
|
||||
mrb_intern(mrb_state *mrb, const char *name)
|
||||
mrb_intern_cstr(mrb_state *mrb, const char *name)
|
||||
{
|
||||
return mrb_intern2(mrb, name, strlen(name));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user