blob: 84b99a8a4f2ea0a794fedf1ca26320407be47222 [file] [log] [blame]
Damien George04b91472014-05-03 23:27:38 +01001/*
Alexander Steffen55f33242017-06-30 09:22:17 +02002 * This file is part of the MicroPython project, http://micropython.org/
Damien George04b91472014-05-03 23:27:38 +01003 *
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 Steffen299bc622017-06-29 23:14:58 +020026#ifndef MICROPY_INCLUDED_PY_BUILTIN_H
27#define MICROPY_INCLUDED_PY_BUILTIN_H
Damien George51dfcb42015-01-01 20:27:54 +000028
29#include "py/obj.h"
Damien George04b91472014-05-03 23:27:38 +010030
Damien George4b72b3a2016-01-03 14:21:40 +000031mp_obj_t mp_builtin___import__(size_t n_args, const mp_obj_t *args);
32mp_obj_t mp_builtin_open(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs);
33mp_obj_t mp_micropython_mem_info(size_t n_args, const mp_obj_t *args);
Damiend99b0522013-12-21 18:17:45 +000034
Damien George4ebdb1f2016-10-18 11:06:20 +110035MP_DECLARE_CONST_FUN_OBJ_VAR(mp_builtin___build_class___obj);
36MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin___import___obj);
37MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin___repl_print___obj);
38MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_abs_obj);
39MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_all_obj);
40MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_any_obj);
41MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_bin_obj);
42MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_callable_obj);
43MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_compile_obj);
44MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_chr_obj);
Damien George5076e5c2016-10-24 13:50:03 +110045MP_DECLARE_CONST_FUN_OBJ_2(mp_builtin_delattr_obj);
Damien George4ebdb1f2016-10-18 11:06:20 +110046MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_dir_obj);
47MP_DECLARE_CONST_FUN_OBJ_2(mp_builtin_divmod_obj);
48MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_eval_obj);
49MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_exec_obj);
50MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_execfile_obj);
51MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_getattr_obj);
52MP_DECLARE_CONST_FUN_OBJ_3(mp_builtin_setattr_obj);
53MP_DECLARE_CONST_FUN_OBJ_0(mp_builtin_globals_obj);
54MP_DECLARE_CONST_FUN_OBJ_2(mp_builtin_hasattr_obj);
55MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_hash_obj);
Damien George9f04dfb2017-01-21 23:17:51 +110056MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_help_obj);
Damien George4ebdb1f2016-10-18 11:06:20 +110057MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_hex_obj);
58MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_id_obj);
59MP_DECLARE_CONST_FUN_OBJ_2(mp_builtin_isinstance_obj);
60MP_DECLARE_CONST_FUN_OBJ_2(mp_builtin_issubclass_obj);
61MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_iter_obj);
62MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_len_obj);
63MP_DECLARE_CONST_FUN_OBJ_0(mp_builtin_locals_obj);
64MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_max_obj);
65MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_min_obj);
66MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_next_obj);
67MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_oct_obj);
68MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_ord_obj);
69MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_pow_obj);
70MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_print_obj);
71MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_repr_obj);
72MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_round_obj);
73MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_sorted_obj);
74MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_sum_obj);
Paul Sokolovsky9b0714b2016-04-15 00:07:56 +030075// Defined by a port, but declared here for simplicity
Damien George4ebdb1f2016-10-18 11:06:20 +110076MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_input_obj);
77MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_open_obj);
Paul Sokolovsky440cc3f2014-01-20 01:53:15 +020078
Damien George4ebdb1f2016-10-18 11:06:20 +110079MP_DECLARE_CONST_FUN_OBJ_2(mp_namedtuple_obj);
Paul Sokolovskyd08fd682014-02-27 22:22:04 +020080
Damien George4ebdb1f2016-10-18 11:06:20 +110081MP_DECLARE_CONST_FUN_OBJ_2(mp_op_contains_obj);
82MP_DECLARE_CONST_FUN_OBJ_2(mp_op_getitem_obj);
83MP_DECLARE_CONST_FUN_OBJ_3(mp_op_setitem_obj);
84MP_DECLARE_CONST_FUN_OBJ_2(mp_op_delitem_obj);
Paul Sokolovsky68e7c512014-04-13 11:53:15 +030085
Paul Sokolovskyc6813d92014-04-04 20:08:21 +030086extern const mp_obj_module_t mp_module___main__;
Damien George78d702c2014-12-09 16:19:48 +000087extern const mp_obj_module_t mp_module_builtins;
Damien Georgecaac5422014-03-25 14:18:18 +000088extern const mp_obj_module_t mp_module_array;
89extern const mp_obj_module_t mp_module_collections;
Paul Sokolovsky98a627d2014-04-03 14:57:53 +030090extern const mp_obj_module_t mp_module_io;
Damien George0c36da02014-03-08 15:24:39 +000091extern const mp_obj_module_t mp_module_math;
Damien Georgedbdfee12014-04-17 17:11:03 +010092extern const mp_obj_module_t mp_module_cmath;
Damien George0c36da02014-03-08 15:24:39 +000093extern const mp_obj_module_t mp_module_micropython;
Paul Sokolovsky3d3ef362015-05-04 16:35:40 +030094extern const mp_obj_module_t mp_module_ustruct;
Paul Sokolovsky5500cde2014-04-13 06:43:18 +030095extern const mp_obj_module_t mp_module_sys;
Paul Sokolovskyf9e54e02014-05-06 02:16:43 +030096extern const mp_obj_module_t mp_module_gc;
Damien George27cc0772016-04-22 22:52:33 +000097extern const mp_obj_module_t mp_module_thread;
Paul Sokolovsky82158472014-06-28 03:03:47 +030098
Damien George78d702c2014-12-09 16:19:48 +000099extern const mp_obj_dict_t mp_module_builtins_globals;
Damien George78d702c2014-12-09 16:19:48 +0000100
Paul Sokolovsky82158472014-06-28 03:03:47 +0300101// extmod modules
Damien George596a3fe2016-05-10 10:54:25 +0100102extern const mp_obj_module_t mp_module_uerrno;
Paul Sokolovsky82158472014-06-28 03:03:47 +0300103extern const mp_obj_module_t mp_module_uctypes;
Paul Sokolovsky34162872014-10-12 08:16:34 -0700104extern const mp_obj_module_t mp_module_uzlib;
Damien George612045f2014-09-17 22:56:34 +0100105extern const mp_obj_module_t mp_module_ujson;
Paul Sokolovskyc71e0452014-09-12 18:48:07 +0300106extern const mp_obj_module_t mp_module_ure;
Damien Georgef5d69792014-10-22 17:37:18 +0000107extern const mp_obj_module_t mp_module_uheapq;
Paul Sokolovskyf4b19c82014-11-22 01:19:13 +0200108extern const mp_obj_module_t mp_module_uhashlib;
Paul Sokolovskybfdc2052014-11-29 06:19:30 +0200109extern const mp_obj_module_t mp_module_ubinascii;
Paul Sokolovskya58a91e2016-01-17 12:10:28 +0200110extern const mp_obj_module_t mp_module_urandom;
Paul Sokolovsky8f5bc3f2016-11-20 23:49:45 +0300111extern const mp_obj_module_t mp_module_uselect;
Paul Sokolovskyaaa88672015-10-06 18:10:00 +0300112extern const mp_obj_module_t mp_module_ussl;
Paul Sokolovskyd02f6a92016-12-22 00:29:32 +0300113extern const mp_obj_module_t mp_module_utimeq;
Paul Sokolovsky01162182015-05-03 20:25:40 +0300114extern const mp_obj_module_t mp_module_machine;
Paul Sokolovskye0d77402015-10-27 00:04:33 +0300115extern const mp_obj_module_t mp_module_lwip;
Paul Sokolovsky24342dd2016-03-24 19:14:12 +0200116extern const mp_obj_module_t mp_module_websocket;
Paul Sokolovsky25d0f7d2016-04-29 00:52:52 +0300117extern const mp_obj_module_t mp_module_webrepl;
Damien George53ad6812016-04-08 11:08:37 +0100118extern const mp_obj_module_t mp_module_framebuf;
Paul Sokolovsky337111b2016-06-15 00:52:45 +0300119extern const mp_obj_module_t mp_module_btree;
Damien George51dfcb42015-01-01 20:27:54 +0000120
Damien Georgeda8c4c22017-09-12 16:03:52 +1000121extern const char MICROPY_PY_BUILTINS_HELP_TEXT[];
Damien George9f04dfb2017-01-21 23:17:51 +1100122
Alexander Steffen299bc622017-06-29 23:14:58 +0200123#endif // MICROPY_INCLUDED_PY_BUILTIN_H