diff options
| author | Masaki Muranaka <[email protected]> | 2013-03-22 14:28:11 +0900 |
|---|---|---|
| committer | Masaki Muranaka <[email protected]> | 2013-03-22 14:39:28 +0900 |
| commit | fc63ef150b029fcd5c73a0b9fde60d44a4a1d662 (patch) | |
| tree | 5dd50bff085fdf7b8b036168c113636ac6e25aab /include | |
| parent | 0f16b242fc5abba4af8fc716837a28993be57cec (diff) | |
| download | mruby-fc63ef150b029fcd5c73a0b9fde60d44a4a1d662.tar.gz mruby-fc63ef150b029fcd5c73a0b9fde60d44a4a1d662.zip | |
Add new API mrb_intern_cstr(). This is for naming orthogonality. mrb_intern is also left for backward compatibility.
Diffstat (limited to 'include')
| -rw-r--r-- | include/mruby.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/mruby.h b/include/mruby.h index 84aeff0d7..c5c607893 100644 --- a/include/mruby.h +++ b/include/mruby.h @@ -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); |
