summaryrefslogtreecommitdiff
path: root/py/objnamedtuple.h
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2018-07-13 22:51:10 -0400
committerDan Halbert <halbert@halwitz.org>2018-07-13 22:51:10 -0400
commite2e01efa84d2ed46d004edf48076e4701accc176 (patch)
tree8c877ce226b6404b117990db92c9cfc93950df60 /py/objnamedtuple.h
parent0d27f4d9a66dcb47b545e715d1833094b0c7b484 (diff)
compiles and runs; hangs on import storage;storage.VfsFat.<tab>
Diffstat (limited to 'py/objnamedtuple.h')
-rw-r--r--py/objnamedtuple.h26
1 files changed, 20 insertions, 6 deletions
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 <string.h>
+
+#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