diff options
author | Damien George <damien.p.george@gmail.com> | 2014-03-30 13:35:08 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-03-30 13:35:08 +0100 |
commit | d17926db710189db97a49e9b2e72d782fc404231 (patch) | |
tree | 406396ee6f3010511a606dd4ea3ed5a817d959eb /py/runtime.h | |
parent | 09d207785c77c85c957471b064ceebe0d2ee0a23 (diff) | |
download | micropython-d17926db710189db97a49e9b2e72d782fc404231.tar.gz micropython-d17926db710189db97a49e9b2e72d782fc404231.zip |
Rename rt_* to mp_*.
Mostly just a global search and replace. Except rt_is_true which
becomes mp_obj_is_true.
Still would like to tidy up some of the names, but this will do for now.
Diffstat (limited to 'py/runtime.h')
-rw-r--r-- | py/runtime.h | 122 |
1 files changed, 64 insertions, 58 deletions
diff --git a/py/runtime.h b/py/runtime.h index a8f83e529d..1934ccd1e4 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -1,58 +1,64 @@ -void rt_init(void); -void rt_deinit(void); - -void rt_check_nargs(int n_args, machine_uint_t n_args_min, machine_uint_t n_args_max, int n_kw, bool is_kw); - -int rt_is_true(mp_obj_t arg); - -mp_obj_t rt_load_const_dec(qstr qstr); -mp_obj_t rt_load_const_str(qstr qstr); -mp_obj_t rt_load_const_bytes(qstr qstr); -mp_obj_t rt_load_name(qstr qstr); -mp_obj_t rt_load_global(qstr qstr); -mp_obj_t rt_load_build_class(void); -mp_obj_t rt_get_cell(mp_obj_t cell); -void rt_set_cell(mp_obj_t cell, mp_obj_t val); -void rt_store_name(qstr qstr, mp_obj_t obj); -void rt_store_global(qstr qstr, mp_obj_t obj); -void rt_delete_name(qstr qstr); -mp_obj_t rt_unary_op(int op, mp_obj_t arg); -mp_obj_t rt_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs); -mp_obj_t rt_make_function_from_id(uint unique_code_id, bool free_unique_code, mp_obj_t def_args); -mp_obj_t rt_make_function_n(int n_args, void *fun); // fun must have the correct signature for n_args fixed arguments -mp_obj_t rt_make_function_var(int n_args_min, mp_fun_var_t fun); -mp_obj_t rt_make_function_var_between(int n_args_min, int n_args_max, mp_fun_var_t fun); // min and max are inclusive -mp_obj_t rt_make_closure_from_id(uint unique_code_id, mp_obj_t closure_tuple, mp_obj_t def_args); -mp_obj_t rt_call_function_0(mp_obj_t fun); -mp_obj_t rt_call_function_1(mp_obj_t fun, mp_obj_t arg); -mp_obj_t rt_call_function_2(mp_obj_t fun, mp_obj_t arg1, mp_obj_t arg2); -mp_obj_t rt_call_function_n_kw_for_native(mp_obj_t fun_in, uint n_args_kw, const mp_obj_t *args); -mp_obj_t rt_call_function_n_kw(mp_obj_t fun, uint n_args, uint n_kw, const mp_obj_t *args); -mp_obj_t rt_call_method_n_kw(uint n_args, uint n_kw, const mp_obj_t *args); -mp_obj_t rt_build_tuple(int n_args, mp_obj_t *items); -mp_obj_t rt_build_list(int n_args, mp_obj_t *items); -mp_obj_t rt_list_append(mp_obj_t list, mp_obj_t arg); -mp_obj_t rt_build_set(int n_args, mp_obj_t *items); -mp_obj_t rt_store_set(mp_obj_t set, mp_obj_t item); -void rt_unpack_sequence(mp_obj_t seq, uint num, mp_obj_t *items); -mp_obj_t rt_build_map(int n_args); -mp_obj_t rt_store_map(mp_obj_t map, mp_obj_t key, mp_obj_t value); -mp_obj_t rt_load_attr(mp_obj_t base, qstr attr); -void rt_load_method(mp_obj_t base, qstr attr, mp_obj_t *dest); -void rt_store_attr(mp_obj_t base, qstr attr, mp_obj_t val); -void rt_store_subscr(mp_obj_t base, mp_obj_t index, mp_obj_t val); -mp_obj_t rt_getiter(mp_obj_t o); -mp_obj_t rt_iternext_allow_raise(mp_obj_t o); // may return MP_OBJ_NULL instead of raising StopIteration() -mp_obj_t rt_iternext(mp_obj_t o); // will always return MP_OBJ_NULL instead of raising StopIteration(...) -mp_obj_t rt_make_raise_obj(mp_obj_t o); -mp_obj_t rt_import_name(qstr name, mp_obj_t fromlist, mp_obj_t level); -mp_obj_t rt_import_from(mp_obj_t module, qstr name); -void rt_import_all(mp_obj_t module); - -struct _mp_map_t; -struct _mp_map_t *rt_locals_get(void); -void rt_locals_set(struct _mp_map_t *m); -struct _mp_map_t *rt_globals_get(void); -void rt_globals_set(struct _mp_map_t *m); -struct _mp_map_t *rt_loaded_modules_get(void); -extern mp_obj_t sys_path; +void mp_init(void); +void mp_deinit(void); + +void mp_check_nargs(int n_args, machine_uint_t n_args_min, machine_uint_t n_args_max, int n_kw, bool is_kw); + +struct _mp_map_t *mp_locals_get(void); +void mp_locals_set(struct _mp_map_t *m); +struct _mp_map_t *mp_globals_get(void); +void mp_globals_set(struct _mp_map_t *m); + +mp_obj_t mp_load_name(qstr qstr); +mp_obj_t mp_load_global(qstr qstr); +mp_obj_t mp_load_build_class(void); +void mp_store_name(qstr qstr, mp_obj_t obj); +void mp_store_global(qstr qstr, mp_obj_t obj); +void mp_delete_name(qstr qstr); + +mp_obj_t mp_unary_op(int op, mp_obj_t arg); +mp_obj_t mp_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs); + +mp_obj_t mp_load_const_dec(qstr qstr); +mp_obj_t mp_load_const_str(qstr qstr); +mp_obj_t mp_load_const_bytes(qstr qstr); + +mp_obj_t mp_get_cell(mp_obj_t cell); +void mp_set_cell(mp_obj_t cell, mp_obj_t val); + +mp_obj_t mp_make_function_from_id(uint unique_code_id, bool free_unique_code, mp_obj_t def_args); +mp_obj_t mp_make_function_n(int n_args, void *fun); // fun must have the correct signature for n_args fixed arguments +mp_obj_t mp_make_function_var(int n_args_min, mp_fun_var_t fun); +mp_obj_t mp_make_function_var_between(int n_args_min, int n_args_max, mp_fun_var_t fun); // min and max are inclusive +mp_obj_t mp_make_closure_from_id(uint unique_code_id, mp_obj_t closure_tuple, mp_obj_t def_args); + +mp_obj_t mp_call_function_0(mp_obj_t fun); +mp_obj_t mp_call_function_1(mp_obj_t fun, mp_obj_t arg); +mp_obj_t mp_call_function_2(mp_obj_t fun, mp_obj_t arg1, mp_obj_t arg2); +mp_obj_t mp_call_function_n_kw_for_native(mp_obj_t fun_in, uint n_args_kw, const mp_obj_t *args); +mp_obj_t mp_call_function_n_kw(mp_obj_t fun, uint n_args, uint n_kw, const mp_obj_t *args); +mp_obj_t mp_call_method_n_kw(uint n_args, uint n_kw, const mp_obj_t *args); + +mp_obj_t mp_build_tuple(int n_args, mp_obj_t *items); +mp_obj_t mp_build_list(int n_args, mp_obj_t *items); +mp_obj_t mp_list_append(mp_obj_t list, mp_obj_t arg); +mp_obj_t mp_build_set(int n_args, mp_obj_t *items); +mp_obj_t mp_store_set(mp_obj_t set, mp_obj_t item); +void mp_unpack_sequence(mp_obj_t seq, uint num, mp_obj_t *items); +mp_obj_t mp_build_map(int n_args); +mp_obj_t mp_store_map(mp_obj_t map, mp_obj_t key, mp_obj_t value); +mp_obj_t mp_load_attr(mp_obj_t base, qstr attr); +void mp_load_method(mp_obj_t base, qstr attr, mp_obj_t *dest); +void mp_store_attr(mp_obj_t base, qstr attr, mp_obj_t val); +void mp_store_subscr(mp_obj_t base, mp_obj_t index, mp_obj_t val); + +mp_obj_t mp_getiter(mp_obj_t o); +mp_obj_t mp_iternext_allow_raise(mp_obj_t o); // may return MP_OBJ_NULL instead of raising StopIteration() +mp_obj_t mp_iternext(mp_obj_t o); // will always return MP_OBJ_NULL instead of raising StopIteration(...) + +mp_obj_t mp_make_raise_obj(mp_obj_t o); + +extern mp_obj_t mp_sys_path; +struct _mp_map_t *mp_loaded_modules_get(void); +mp_obj_t mp_import_name(qstr name, mp_obj_t fromlist, mp_obj_t level); +mp_obj_t mp_import_from(mp_obj_t module, qstr name); +void mp_import_all(mp_obj_t module); |