blob: d8ff7158ff2ad97c2d958ec5270fa67388eeeb2c [file] [log] [blame]
Damien Georgecaac5422014-03-25 14:18:18 +00001#include "misc.h"
2#include "mpconfig.h"
3#include "qstr.h"
4#include "obj.h"
Damien Georgecaac5422014-03-25 14:18:18 +00005#include "builtin.h"
6
7STATIC const mp_map_elem_t mp_module_array_globals_table[] = {
8 { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_array) },
9 { MP_OBJ_NEW_QSTR(MP_QSTR_array), (mp_obj_t)&mp_type_array },
10};
11
Damien George8b0535e2014-04-05 21:53:54 +010012STATIC const mp_obj_dict_t mp_module_array_globals = {
13 .base = {&mp_type_dict},
14 .map = {
15 .all_keys_are_qstrs = 1,
16 .table_is_fixed_array = 1,
17 .used = sizeof(mp_module_array_globals_table) / sizeof(mp_map_elem_t),
18 .alloc = sizeof(mp_module_array_globals_table) / sizeof(mp_map_elem_t),
19 .table = (mp_map_elem_t*)mp_module_array_globals_table,
20 },
Damien Georgecaac5422014-03-25 14:18:18 +000021};
22
23const mp_obj_module_t mp_module_array = {
24 .base = { &mp_type_module },
25 .name = MP_QSTR_array,
Damien George8b0535e2014-04-05 21:53:54 +010026 .globals = (mp_obj_dict_t*)&mp_module_array_globals,
Damien Georgecaac5422014-03-25 14:18:18 +000027};