diff options
author | Damien George <damien.p.george@gmail.com> | 2014-10-22 17:37:18 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-10-22 23:20:15 +0100 |
commit | f5d69794a86f7647de3f3b3efd282ed288b1cba6 (patch) | |
tree | dd81cfcca993bad937830aa7e9cc37f8c74a753c /py | |
parent | e72be1b999a3337f74a8e5a8f61705666f834d2b (diff) |
extmod: Add uheapq module.
Diffstat (limited to 'py')
-rw-r--r-- | py/builtin.h | 1 | ||||
-rw-r--r-- | py/builtintables.c | 3 | ||||
-rw-r--r-- | py/mpconfig.h | 4 | ||||
-rw-r--r-- | py/py.mk | 1 | ||||
-rw-r--r-- | py/qstrdefs.h | 7 |
5 files changed, 16 insertions, 0 deletions
diff --git a/py/builtin.h b/py/builtin.h index a69712bec..58b821bf3 100644 --- a/py/builtin.h +++ b/py/builtin.h @@ -91,3 +91,4 @@ extern const mp_obj_module_t mp_module_uctypes; extern const mp_obj_module_t mp_module_uzlib; extern const mp_obj_module_t mp_module_ujson; extern const mp_obj_module_t mp_module_ure; +extern const mp_obj_module_t mp_module_uheapq; diff --git a/py/builtintables.c b/py/builtintables.c index 0e5daf6d8..238d78872 100644 --- a/py/builtintables.c +++ b/py/builtintables.c @@ -211,6 +211,9 @@ STATIC const mp_map_elem_t mp_builtin_module_table[] = { #if MICROPY_PY_URE { MP_OBJ_NEW_QSTR(MP_QSTR_ure), (mp_obj_t)&mp_module_ure }, #endif +#if MICROPY_PY_UHEAPQ + { MP_OBJ_NEW_QSTR(MP_QSTR_uheapq), (mp_obj_t)&mp_module_uheapq }, +#endif // extra builtin modules as defined by a port MICROPY_PORT_BUILTIN_MODULES diff --git a/py/mpconfig.h b/py/mpconfig.h index 4efe21d4b..201621ea1 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -403,6 +403,10 @@ typedef double mp_float_t; #define MICROPY_PY_URE (0) #endif +#ifndef MICROPY_PY_UHEAPQ +#define MICROPY_PY_UHEAPQ (0) +#endif + /*****************************************************************************/ /* Hooks for a port to add builtins */ @@ -114,6 +114,7 @@ PY_O_BASENAME = \ ../extmod/modujson.o \ ../extmod/modure.o \ ../extmod/moduzlib.o \ + ../extmod/moduheapq.o \ # prepend the build destination prefix to the py object files PY_O = $(addprefix $(PY_BUILD)/, $(PY_O_BASENAME)) diff --git a/py/qstrdefs.h b/py/qstrdefs.h index 0f520719f..d1bb4dc24 100644 --- a/py/qstrdefs.h +++ b/py/qstrdefs.h @@ -485,3 +485,10 @@ Q(search) Q(group) Q(DEBUG) #endif + +#if MICROPY_PY_UHEAPQ +Q(uheapq) +Q(heappush) +Q(heappop) +Q(heapify) +#endif |