Damien George | d17926d | 2014-03-30 13:35:08 +0100 | [diff] [blame^] | 1 | void mp_init(void); |
| 2 | void mp_deinit(void); |
Damien George | 2326d52 | 2014-03-27 23:26:35 +0000 | [diff] [blame] | 3 | |
Damien George | d17926d | 2014-03-30 13:35:08 +0100 | [diff] [blame^] | 4 | 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); |
Dave Hylands | 51dabac | 2014-02-17 17:57:13 -0800 | [diff] [blame] | 5 | |
Damien George | d17926d | 2014-03-30 13:35:08 +0100 | [diff] [blame^] | 6 | struct _mp_map_t *mp_locals_get(void); |
| 7 | void mp_locals_set(struct _mp_map_t *m); |
| 8 | struct _mp_map_t *mp_globals_get(void); |
| 9 | void mp_globals_set(struct _mp_map_t *m); |
Damien | 429d719 | 2013-10-04 19:53:11 +0100 | [diff] [blame] | 10 | |
Damien George | d17926d | 2014-03-30 13:35:08 +0100 | [diff] [blame^] | 11 | mp_obj_t mp_load_name(qstr qstr); |
| 12 | mp_obj_t mp_load_global(qstr qstr); |
| 13 | mp_obj_t mp_load_build_class(void); |
| 14 | void mp_store_name(qstr qstr, mp_obj_t obj); |
| 15 | void mp_store_global(qstr qstr, mp_obj_t obj); |
| 16 | void mp_delete_name(qstr qstr); |
Damien George | 66028ab | 2014-01-03 14:03:48 +0000 | [diff] [blame] | 17 | |
Damien George | d17926d | 2014-03-30 13:35:08 +0100 | [diff] [blame^] | 18 | mp_obj_t mp_unary_op(int op, mp_obj_t arg); |
| 19 | mp_obj_t mp_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs); |
| 20 | |
| 21 | mp_obj_t mp_load_const_dec(qstr qstr); |
| 22 | mp_obj_t mp_load_const_str(qstr qstr); |
| 23 | mp_obj_t mp_load_const_bytes(qstr qstr); |
| 24 | |
| 25 | mp_obj_t mp_get_cell(mp_obj_t cell); |
| 26 | void mp_set_cell(mp_obj_t cell, mp_obj_t val); |
| 27 | |
| 28 | mp_obj_t mp_make_function_from_id(uint unique_code_id, bool free_unique_code, mp_obj_t def_args); |
| 29 | mp_obj_t mp_make_function_n(int n_args, void *fun); // fun must have the correct signature for n_args fixed arguments |
| 30 | mp_obj_t mp_make_function_var(int n_args_min, mp_fun_var_t fun); |
| 31 | 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 |
| 32 | mp_obj_t mp_make_closure_from_id(uint unique_code_id, mp_obj_t closure_tuple, mp_obj_t def_args); |
| 33 | |
| 34 | mp_obj_t mp_call_function_0(mp_obj_t fun); |
| 35 | mp_obj_t mp_call_function_1(mp_obj_t fun, mp_obj_t arg); |
| 36 | mp_obj_t mp_call_function_2(mp_obj_t fun, mp_obj_t arg1, mp_obj_t arg2); |
| 37 | mp_obj_t mp_call_function_n_kw_for_native(mp_obj_t fun_in, uint n_args_kw, const mp_obj_t *args); |
| 38 | mp_obj_t mp_call_function_n_kw(mp_obj_t fun, uint n_args, uint n_kw, const mp_obj_t *args); |
| 39 | mp_obj_t mp_call_method_n_kw(uint n_args, uint n_kw, const mp_obj_t *args); |
| 40 | |
| 41 | mp_obj_t mp_build_tuple(int n_args, mp_obj_t *items); |
| 42 | mp_obj_t mp_build_list(int n_args, mp_obj_t *items); |
| 43 | mp_obj_t mp_list_append(mp_obj_t list, mp_obj_t arg); |
| 44 | mp_obj_t mp_build_set(int n_args, mp_obj_t *items); |
| 45 | mp_obj_t mp_store_set(mp_obj_t set, mp_obj_t item); |
| 46 | void mp_unpack_sequence(mp_obj_t seq, uint num, mp_obj_t *items); |
| 47 | mp_obj_t mp_build_map(int n_args); |
| 48 | mp_obj_t mp_store_map(mp_obj_t map, mp_obj_t key, mp_obj_t value); |
| 49 | mp_obj_t mp_load_attr(mp_obj_t base, qstr attr); |
| 50 | void mp_load_method(mp_obj_t base, qstr attr, mp_obj_t *dest); |
| 51 | void mp_store_attr(mp_obj_t base, qstr attr, mp_obj_t val); |
| 52 | void mp_store_subscr(mp_obj_t base, mp_obj_t index, mp_obj_t val); |
| 53 | |
| 54 | mp_obj_t mp_getiter(mp_obj_t o); |
| 55 | mp_obj_t mp_iternext_allow_raise(mp_obj_t o); // may return MP_OBJ_NULL instead of raising StopIteration() |
| 56 | mp_obj_t mp_iternext(mp_obj_t o); // will always return MP_OBJ_NULL instead of raising StopIteration(...) |
| 57 | |
| 58 | mp_obj_t mp_make_raise_obj(mp_obj_t o); |
| 59 | |
| 60 | extern mp_obj_t mp_sys_path; |
| 61 | struct _mp_map_t *mp_loaded_modules_get(void); |
| 62 | mp_obj_t mp_import_name(qstr name, mp_obj_t fromlist, mp_obj_t level); |
| 63 | mp_obj_t mp_import_from(mp_obj_t module, qstr name); |
| 64 | void mp_import_all(mp_obj_t module); |