builtin.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /*
  2. * This file is part of the MicroPython project, http://micropython.org/
  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. */
  26. #ifndef MICROPY_INCLUDED_PY_BUILTIN_H
  27. #define MICROPY_INCLUDED_PY_BUILTIN_H
  28. #include "py/obj.h"
  29. mp_obj_t mp_builtin___import__(size_t n_args, const mp_obj_t *args);
  30. mp_obj_t mp_builtin_open(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs);
  31. mp_obj_t mp_micropython_mem_info(size_t n_args, const mp_obj_t *args);
  32. MP_DECLARE_CONST_FUN_OBJ_VAR(mp_builtin___build_class___obj);
  33. MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin___import___obj);
  34. MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin___repl_print___obj);
  35. MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_abs_obj);
  36. MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_all_obj);
  37. MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_any_obj);
  38. MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_bin_obj);
  39. MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_callable_obj);
  40. MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_compile_obj);
  41. MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_chr_obj);
  42. MP_DECLARE_CONST_FUN_OBJ_2(mp_builtin_delattr_obj);
  43. MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_dir_obj);
  44. MP_DECLARE_CONST_FUN_OBJ_2(mp_builtin_divmod_obj);
  45. MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_eval_obj);
  46. MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_exec_obj);
  47. MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_execfile_obj);
  48. MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_getattr_obj);
  49. MP_DECLARE_CONST_FUN_OBJ_3(mp_builtin_setattr_obj);
  50. MP_DECLARE_CONST_FUN_OBJ_0(mp_builtin_globals_obj);
  51. MP_DECLARE_CONST_FUN_OBJ_2(mp_builtin_hasattr_obj);
  52. MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_hash_obj);
  53. MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_help_obj);
  54. MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_hex_obj);
  55. MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_id_obj);
  56. MP_DECLARE_CONST_FUN_OBJ_2(mp_builtin_isinstance_obj);
  57. MP_DECLARE_CONST_FUN_OBJ_2(mp_builtin_issubclass_obj);
  58. MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_iter_obj);
  59. MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_len_obj);
  60. MP_DECLARE_CONST_FUN_OBJ_0(mp_builtin_locals_obj);
  61. MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_max_obj);
  62. MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_min_obj);
  63. MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_next_obj);
  64. MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_oct_obj);
  65. MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_ord_obj);
  66. MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_pow_obj);
  67. MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_print_obj);
  68. MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_repr_obj);
  69. MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_round_obj);
  70. MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_sorted_obj);
  71. MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_sum_obj);
  72. // Defined by a port, but declared here for simplicity
  73. MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_input_obj);
  74. MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_open_obj);
  75. MP_DECLARE_CONST_FUN_OBJ_2(mp_namedtuple_obj);
  76. MP_DECLARE_CONST_FUN_OBJ_2(mp_op_contains_obj);
  77. MP_DECLARE_CONST_FUN_OBJ_2(mp_op_getitem_obj);
  78. MP_DECLARE_CONST_FUN_OBJ_3(mp_op_setitem_obj);
  79. MP_DECLARE_CONST_FUN_OBJ_2(mp_op_delitem_obj);
  80. extern const mp_obj_module_t mp_module___main__;
  81. extern const mp_obj_module_t mp_module_builtins;
  82. extern const mp_obj_module_t mp_module_array;
  83. extern const mp_obj_module_t mp_module_collections;
  84. extern const mp_obj_module_t mp_module_io;
  85. extern const mp_obj_module_t mp_module_math;
  86. extern const mp_obj_module_t mp_module_cmath;
  87. extern const mp_obj_module_t mp_module_micropython;
  88. extern const mp_obj_module_t mp_module_ustruct;
  89. extern const mp_obj_module_t mp_module_sys;
  90. extern const mp_obj_module_t mp_module_gc;
  91. extern const mp_obj_module_t mp_module_thread;
  92. extern const mp_obj_dict_t mp_module_builtins_globals;
  93. // extmod modules
  94. extern const mp_obj_module_t mp_module_uerrno;
  95. extern const mp_obj_module_t mp_module_uctypes;
  96. extern const mp_obj_module_t mp_module_uzlib;
  97. extern const mp_obj_module_t mp_module_ujson;
  98. extern const mp_obj_module_t mp_module_ure;
  99. extern const mp_obj_module_t mp_module_uheapq;
  100. extern const mp_obj_module_t mp_module_uhashlib;
  101. extern const mp_obj_module_t mp_module_ucryptolib;
  102. extern const mp_obj_module_t mp_module_ubinascii;
  103. extern const mp_obj_module_t mp_module_urandom;
  104. extern const mp_obj_module_t mp_module_uselect;
  105. extern const mp_obj_module_t mp_module_ussl;
  106. extern const mp_obj_module_t mp_module_utimeq;
  107. extern const mp_obj_module_t mp_module_machine;
  108. extern const mp_obj_module_t mp_module_lwip;
  109. extern const mp_obj_module_t mp_module_websocket;
  110. extern const mp_obj_module_t mp_module_webrepl;
  111. extern const mp_obj_module_t mp_module_framebuf;
  112. extern const mp_obj_module_t mp_module_btree;
  113. extern const char MICROPY_PY_BUILTINS_HELP_TEXT[];
  114. #endif // MICROPY_INCLUDED_PY_BUILTIN_H