From e2e01efa84d2ed46d004edf48076e4701accc176 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 13 Jul 2018 22:51:10 -0400 Subject: compiles and runs; hangs on import storage;storage.VfsFat. --- py/objnamedtuple.h | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'py/objnamedtuple.h') diff --git a/py/objnamedtuple.h b/py/objnamedtuple.h index d32af35af..a36404b8d 100644 --- a/py/objnamedtuple.h +++ b/py/objnamedtuple.h @@ -1,9 +1,10 @@ /* - * This file is part of the MicroPython project, http://micropython.org/ + * This file is part of the Micro Python project, http://micropython.org/ * * The MIT License (MIT) * - * Copyright (c) 2014-2017 Paul Sokolovsky + * Copyright (c) 2013, 2014 Damien P. George + * Copyright (c) 2014 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -23,14 +24,22 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ + #ifndef MICROPY_INCLUDED_PY_OBJNAMEDTUPLE_H #define MICROPY_INCLUDED_PY_OBJNAMEDTUPLE_H +#include + +#include "py/nlr.h" #include "py/objtuple.h" +#include "py/runtime.h" +#include "py/objstr.h" + +#if MICROPY_PY_COLLECTIONS typedef struct _mp_obj_namedtuple_type_t { mp_obj_type_t base; - size_t n_fields; + mp_uint_t n_fields; qstr fields[]; } mp_obj_namedtuple_type_t; @@ -38,7 +47,12 @@ typedef struct _mp_obj_namedtuple_t { mp_obj_tuple_t tuple; } mp_obj_namedtuple_t; -size_t mp_obj_namedtuple_find_field(const mp_obj_namedtuple_type_t *type, qstr name); -mp_obj_namedtuple_type_t *mp_obj_new_namedtuple_base(size_t n_fields, mp_obj_t *fields); +void namedtuple_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind); + +void namedtuple_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest); + +mp_obj_t namedtuple_make_new(const mp_obj_type_t *type_in, size_t n_args, size_t n_kw, const mp_obj_t *args); + +#endif // MICROPY_PY_COLLECTIONS -#endif // MICROPY_INCLUDED_PY_OBJNAMEDTUPLE_H +#endif // MICROPY_INCLUDED_PY_OBJNAMEDTUPLE_H -- cgit v1.2.3