diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/mruby.h | 7 | ||||
| -rw-r--r-- | include/mruby/string.h | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/include/mruby.h b/include/mruby.h index e2054f440..04ef018cb 100644 --- a/include/mruby.h +++ b/include/mruby.h @@ -102,6 +102,8 @@ enum gc_state { struct mrb_jmpbuf; +typedef void (*mrb_atexit_func)(struct mrb_state*); + typedef struct mrb_state { struct mrb_jmpbuf *jmp; @@ -170,6 +172,9 @@ typedef struct mrb_state { struct RObject *nomem_err; /* pre-allocated NoMemoryError */ void *ud; /* auxiliary data */ + + mrb_atexit_func *atexit_stack; + mrb_int atexit_stack_len; } mrb_state; #if __STDC_VERSION__ >= 201112L @@ -414,6 +419,8 @@ void* mrb_pool_realloc(struct mrb_pool*, void*, size_t oldlen, size_t newlen); mrb_bool mrb_pool_can_realloc(struct mrb_pool*, void*, size_t); void* mrb_alloca(mrb_state *mrb, size_t); +void mrb_atexit(mrb_state *mrb, mrb_atexit_func func); + #ifdef MRB_DEBUG #include <assert.h> #define mrb_assert(p) assert(p) diff --git a/include/mruby/string.h b/include/mruby/string.h index dd73f5f1e..51556d177 100644 --- a/include/mruby/string.h +++ b/include/mruby/string.h @@ -11,8 +11,6 @@ extern "C" { #endif -#define IS_EVSTR(p,e) ((p) < (e) && (*(p) == '$' || *(p) == '@' || *(p) == '{')) - extern const char mrb_digitmap[]; #define RSTRING_EMBED_LEN_MAX ((mrb_int)(sizeof(void*) * 3 - 1)) |
