Damien George | 04b9147 | 2014-05-03 23:27:38 +0100 | [diff] [blame] | 1 | /* |
Alexander Steffen | 55f3324 | 2017-06-30 09:22:17 +0200 | [diff] [blame] | 2 | * This file is part of the MicroPython project, http://micropython.org/ |
Damien George | 04b9147 | 2014-05-03 23:27:38 +0100 | [diff] [blame] | 3 | * |
| 4 | * The MIT License (MIT) |
| 5 | * |
| 6 | * Copyright (c) 2013, 2014 Damien P. George |
| 7 | * |
| 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 9 | * of this software and associated documentation files (the "Software"), to deal |
| 10 | * in the Software without restriction, including without limitation the rights |
| 11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 12 | * copies of the Software, and to permit persons to whom the Software is |
| 13 | * furnished to do so, subject to the following conditions: |
| 14 | * |
| 15 | * The above copyright notice and this permission notice shall be included in |
| 16 | * all copies or substantial portions of the Software. |
| 17 | * |
| 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 24 | * THE SOFTWARE. |
| 25 | */ |
Alexander Steffen | 299bc62 | 2017-06-29 23:14:58 +0200 | [diff] [blame] | 26 | #ifndef MICROPY_INCLUDED_PY_BUILTIN_H |
| 27 | #define MICROPY_INCLUDED_PY_BUILTIN_H |
Damien George | 51dfcb4 | 2015-01-01 20:27:54 +0000 | [diff] [blame] | 28 | |
| 29 | #include "py/obj.h" |
Damien George | 04b9147 | 2014-05-03 23:27:38 +0100 | [diff] [blame] | 30 | |
Damien George | 4b72b3a | 2016-01-03 14:21:40 +0000 | [diff] [blame] | 31 | mp_obj_t mp_builtin___import__(size_t n_args, const mp_obj_t *args); |
| 32 | mp_obj_t mp_builtin_open(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs); |
| 33 | mp_obj_t mp_micropython_mem_info(size_t n_args, const mp_obj_t *args); |
Damien | d99b052 | 2013-12-21 18:17:45 +0000 | [diff] [blame] | 34 | |
Damien George | 4ebdb1f | 2016-10-18 11:06:20 +1100 | [diff] [blame] | 35 | MP_DECLARE_CONST_FUN_OBJ_VAR(mp_builtin___build_class___obj); |
| 36 | MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin___import___obj); |
| 37 | MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin___repl_print___obj); |
| 38 | MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_abs_obj); |
| 39 | MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_all_obj); |
| 40 | MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_any_obj); |
| 41 | MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_bin_obj); |
| 42 | MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_callable_obj); |
| 43 | MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_compile_obj); |
| 44 | MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_chr_obj); |
Damien George | 5076e5c | 2016-10-24 13:50:03 +1100 | [diff] [blame] | 45 | MP_DECLARE_CONST_FUN_OBJ_2(mp_builtin_delattr_obj); |
Damien George | 4ebdb1f | 2016-10-18 11:06:20 +1100 | [diff] [blame] | 46 | MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_dir_obj); |
| 47 | MP_DECLARE_CONST_FUN_OBJ_2(mp_builtin_divmod_obj); |
| 48 | MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_eval_obj); |
| 49 | MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_exec_obj); |
| 50 | MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_execfile_obj); |
| 51 | MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_getattr_obj); |
| 52 | MP_DECLARE_CONST_FUN_OBJ_3(mp_builtin_setattr_obj); |
| 53 | MP_DECLARE_CONST_FUN_OBJ_0(mp_builtin_globals_obj); |
| 54 | MP_DECLARE_CONST_FUN_OBJ_2(mp_builtin_hasattr_obj); |
| 55 | MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_hash_obj); |
Damien George | 9f04dfb | 2017-01-21 23:17:51 +1100 | [diff] [blame] | 56 | MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_help_obj); |
Damien George | 4ebdb1f | 2016-10-18 11:06:20 +1100 | [diff] [blame] | 57 | MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_hex_obj); |
| 58 | MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_id_obj); |
| 59 | MP_DECLARE_CONST_FUN_OBJ_2(mp_builtin_isinstance_obj); |
| 60 | MP_DECLARE_CONST_FUN_OBJ_2(mp_builtin_issubclass_obj); |
| 61 | MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_iter_obj); |
| 62 | MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_len_obj); |
| 63 | MP_DECLARE_CONST_FUN_OBJ_0(mp_builtin_locals_obj); |
| 64 | MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_max_obj); |
| 65 | MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_min_obj); |
| 66 | MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_next_obj); |
| 67 | MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_oct_obj); |
| 68 | MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_ord_obj); |
| 69 | MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_pow_obj); |
| 70 | MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_print_obj); |
| 71 | MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_repr_obj); |
| 72 | MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_round_obj); |
| 73 | MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_sorted_obj); |
| 74 | MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_sum_obj); |
Paul Sokolovsky | 9b0714b | 2016-04-15 00:07:56 +0300 | [diff] [blame] | 75 | // Defined by a port, but declared here for simplicity |
Damien George | 4ebdb1f | 2016-10-18 11:06:20 +1100 | [diff] [blame] | 76 | MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_input_obj); |
| 77 | MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_open_obj); |
Paul Sokolovsky | 440cc3f | 2014-01-20 01:53:15 +0200 | [diff] [blame] | 78 | |
Damien George | 4ebdb1f | 2016-10-18 11:06:20 +1100 | [diff] [blame] | 79 | MP_DECLARE_CONST_FUN_OBJ_2(mp_namedtuple_obj); |
Paul Sokolovsky | d08fd68 | 2014-02-27 22:22:04 +0200 | [diff] [blame] | 80 | |
Damien George | 4ebdb1f | 2016-10-18 11:06:20 +1100 | [diff] [blame] | 81 | MP_DECLARE_CONST_FUN_OBJ_2(mp_op_contains_obj); |
| 82 | MP_DECLARE_CONST_FUN_OBJ_2(mp_op_getitem_obj); |
| 83 | MP_DECLARE_CONST_FUN_OBJ_3(mp_op_setitem_obj); |
| 84 | MP_DECLARE_CONST_FUN_OBJ_2(mp_op_delitem_obj); |
Paul Sokolovsky | 68e7c51 | 2014-04-13 11:53:15 +0300 | [diff] [blame] | 85 | |
Paul Sokolovsky | c6813d9 | 2014-04-04 20:08:21 +0300 | [diff] [blame] | 86 | extern const mp_obj_module_t mp_module___main__; |
Damien George | 78d702c | 2014-12-09 16:19:48 +0000 | [diff] [blame] | 87 | extern const mp_obj_module_t mp_module_builtins; |
Damien George | caac542 | 2014-03-25 14:18:18 +0000 | [diff] [blame] | 88 | extern const mp_obj_module_t mp_module_array; |
| 89 | extern const mp_obj_module_t mp_module_collections; |
Paul Sokolovsky | 98a627d | 2014-04-03 14:57:53 +0300 | [diff] [blame] | 90 | extern const mp_obj_module_t mp_module_io; |
Damien George | 0c36da0 | 2014-03-08 15:24:39 +0000 | [diff] [blame] | 91 | extern const mp_obj_module_t mp_module_math; |
Damien George | dbdfee1 | 2014-04-17 17:11:03 +0100 | [diff] [blame] | 92 | extern const mp_obj_module_t mp_module_cmath; |
Damien George | 0c36da0 | 2014-03-08 15:24:39 +0000 | [diff] [blame] | 93 | extern const mp_obj_module_t mp_module_micropython; |
Paul Sokolovsky | 3d3ef36 | 2015-05-04 16:35:40 +0300 | [diff] [blame] | 94 | extern const mp_obj_module_t mp_module_ustruct; |
Paul Sokolovsky | 5500cde | 2014-04-13 06:43:18 +0300 | [diff] [blame] | 95 | extern const mp_obj_module_t mp_module_sys; |
Paul Sokolovsky | f9e54e0 | 2014-05-06 02:16:43 +0300 | [diff] [blame] | 96 | extern const mp_obj_module_t mp_module_gc; |
Damien George | 27cc077 | 2016-04-22 22:52:33 +0000 | [diff] [blame] | 97 | extern const mp_obj_module_t mp_module_thread; |
Paul Sokolovsky | 8215847 | 2014-06-28 03:03:47 +0300 | [diff] [blame] | 98 | |
Damien George | 78d702c | 2014-12-09 16:19:48 +0000 | [diff] [blame] | 99 | extern const mp_obj_dict_t mp_module_builtins_globals; |
Damien George | 78d702c | 2014-12-09 16:19:48 +0000 | [diff] [blame] | 100 | |
Paul Sokolovsky | 8215847 | 2014-06-28 03:03:47 +0300 | [diff] [blame] | 101 | // extmod modules |
Damien George | 596a3fe | 2016-05-10 10:54:25 +0100 | [diff] [blame] | 102 | extern const mp_obj_module_t mp_module_uerrno; |
Paul Sokolovsky | 8215847 | 2014-06-28 03:03:47 +0300 | [diff] [blame] | 103 | extern const mp_obj_module_t mp_module_uctypes; |
Paul Sokolovsky | 3416287 | 2014-10-12 08:16:34 -0700 | [diff] [blame] | 104 | extern const mp_obj_module_t mp_module_uzlib; |
Damien George | 612045f | 2014-09-17 22:56:34 +0100 | [diff] [blame] | 105 | extern const mp_obj_module_t mp_module_ujson; |
Paul Sokolovsky | c71e045 | 2014-09-12 18:48:07 +0300 | [diff] [blame] | 106 | extern const mp_obj_module_t mp_module_ure; |
Damien George | f5d6979 | 2014-10-22 17:37:18 +0000 | [diff] [blame] | 107 | extern const mp_obj_module_t mp_module_uheapq; |
Paul Sokolovsky | f4b19c8 | 2014-11-22 01:19:13 +0200 | [diff] [blame] | 108 | extern const mp_obj_module_t mp_module_uhashlib; |
Paul Sokolovsky | bfdc205 | 2014-11-29 06:19:30 +0200 | [diff] [blame] | 109 | extern const mp_obj_module_t mp_module_ubinascii; |
Paul Sokolovsky | a58a91e | 2016-01-17 12:10:28 +0200 | [diff] [blame] | 110 | extern const mp_obj_module_t mp_module_urandom; |
Paul Sokolovsky | 8f5bc3f | 2016-11-20 23:49:45 +0300 | [diff] [blame] | 111 | extern const mp_obj_module_t mp_module_uselect; |
Paul Sokolovsky | aaa8867 | 2015-10-06 18:10:00 +0300 | [diff] [blame] | 112 | extern const mp_obj_module_t mp_module_ussl; |
Paul Sokolovsky | d02f6a9 | 2016-12-22 00:29:32 +0300 | [diff] [blame] | 113 | extern const mp_obj_module_t mp_module_utimeq; |
Paul Sokolovsky | 0116218 | 2015-05-03 20:25:40 +0300 | [diff] [blame] | 114 | extern const mp_obj_module_t mp_module_machine; |
Paul Sokolovsky | e0d7740 | 2015-10-27 00:04:33 +0300 | [diff] [blame] | 115 | extern const mp_obj_module_t mp_module_lwip; |
Paul Sokolovsky | 24342dd | 2016-03-24 19:14:12 +0200 | [diff] [blame] | 116 | extern const mp_obj_module_t mp_module_websocket; |
Paul Sokolovsky | 25d0f7d | 2016-04-29 00:52:52 +0300 | [diff] [blame] | 117 | extern const mp_obj_module_t mp_module_webrepl; |
Damien George | 53ad681 | 2016-04-08 11:08:37 +0100 | [diff] [blame] | 118 | extern const mp_obj_module_t mp_module_framebuf; |
Paul Sokolovsky | 337111b | 2016-06-15 00:52:45 +0300 | [diff] [blame] | 119 | extern const mp_obj_module_t mp_module_btree; |
Damien George | 51dfcb4 | 2015-01-01 20:27:54 +0000 | [diff] [blame] | 120 | |
Damien George | da8c4c2 | 2017-09-12 16:03:52 +1000 | [diff] [blame] | 121 | extern const char MICROPY_PY_BUILTINS_HELP_TEXT[]; |
Damien George | 9f04dfb | 2017-01-21 23:17:51 +1100 | [diff] [blame] | 122 | |
Alexander Steffen | 299bc62 | 2017-06-29 23:14:58 +0200 | [diff] [blame] | 123 | #endif // MICROPY_INCLUDED_PY_BUILTIN_H |