diff --git a/MY-BASIC Quick Reference.pdf b/MY-BASIC Quick Reference.pdf index fbfa1ab..f16d86a 100644 Binary files a/MY-BASIC Quick Reference.pdf and b/MY-BASIC Quick Reference.pdf differ diff --git a/core/my_basic.c b/core/my_basic.c index c5ba2b1..f96cfa8 100755 --- a/core/my_basic.c +++ b/core/my_basic.c @@ -14638,6 +14638,30 @@ _exit: return result; } +/* Set an import handler to a MY-BASIC environment */ +int mb_set_import_handler(struct mb_interpreter_t* s, mb_import_handler_t h) { + int result = MB_FUNC_OK; + + if(!s) { + result = MB_FUNC_ERR; + + goto _exit; + } + + s->import_handler = h; + +_exit: + return result; +} + +/* Register an allocator and a freer globally */ +int mb_set_memory_manager(mb_memory_allocate_func_t a, mb_memory_free_func_t f) { + _mb_allocate_func = a; + _mb_free_func = f; + + return MB_FUNC_OK; +} + /* Get whether GC is enabled */ bool_t mb_get_gc_enabled(struct mb_interpreter_t* s) { if(!s) return false; @@ -14704,22 +14728,6 @@ _exit: return result; } -/* Set an import handler to a MY-BASIC environment */ -int mb_set_import_handler(struct mb_interpreter_t* s, mb_import_handler_t h) { - int result = MB_FUNC_OK; - - if(!s) { - result = MB_FUNC_ERR; - - goto _exit; - } - - s->import_handler = h; - -_exit: - return result; -} - /* Safe stdin reader function */ int mb_gets(const char* pmt, char* buf, int s) { int result = 0; @@ -14754,14 +14762,6 @@ char* mb_memdup(const char* val, unsigned size) { return result; } -/* Register an allocator and a freer globally */ -int mb_set_memory_manager(mb_memory_allocate_func_t a, mb_memory_free_func_t f) { - _mb_allocate_func = a; - _mb_free_func = f; - - return MB_FUNC_OK; -} - /* ========================================================} */ /* diff --git a/core/my_basic.h b/core/my_basic.h index da9803e..fe5cf6a 100755 --- a/core/my_basic.h +++ b/core/my_basic.h @@ -670,15 +670,15 @@ MBAPI int mb_set_error_handler(struct mb_interpreter_t* s, mb_error_handler_t h) MBAPI int mb_set_printer(struct mb_interpreter_t* s, mb_print_func_t p); MBAPI int mb_set_inputer(struct mb_interpreter_t* s, mb_input_func_t p); +MBAPI int mb_set_import_handler(struct mb_interpreter_t* s, mb_import_handler_t h); +MBAPI int mb_set_memory_manager(mb_memory_allocate_func_t a, mb_memory_free_func_t f); MBAPI bool_t mb_get_gc_enabled(struct mb_interpreter_t* s); MBAPI int mb_set_gc_enabled(struct mb_interpreter_t* s, bool_t gc); MBAPI int mb_gc(struct mb_interpreter_t* s, int_t* collected/* = NULL*/); MBAPI int mb_get_userdata(struct mb_interpreter_t* s, void** d); MBAPI int mb_set_userdata(struct mb_interpreter_t* s, void* d); -MBAPI int mb_set_import_handler(struct mb_interpreter_t* s, mb_import_handler_t h); MBAPI int mb_gets(const char* pmt, char* buf, int s); MBAPI char* mb_memdup(const char* val, unsigned size); -MBAPI int mb_set_memory_manager(mb_memory_allocate_func_t a, mb_memory_free_func_t f); #ifdef MB_COMPACT_MODE # pragma pack()