~mdw
/
pyke
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
pyke/pyke.[ch]: Make type skeleton structures be read-only.
[pyke]
/
pyke.h
diff --git
a/pyke.h
b/pyke.h
index
3076bb5
..
138a9fb
100644
(file)
--- a/
pyke.h
+++ b/
pyke.h
@@
-208,11
+208,11
@@
extern void *newtype(PyTypeObject */*meta*/,
extern void typeready(PyTypeObject *);
/* The type object is now ready to be used. */
extern void typeready(PyTypeObject *);
/* The type object is now ready to be used. */
-extern PyTypeObject *inittype(PyTypeObject */*skel*/,
+extern PyTypeObject *inittype(const PyTypeObject */*skel*/,
+ PyTypeObject */*base*/,
PyTypeObject */*meta*/);
/* All-in-one function to construct a working type from a type skeleton
PyTypeObject */*meta*/);
/* All-in-one function to construct a working type from a type skeleton
- * SKEL, with metaclass META. The caller is expected to have filled in the
- * direct superclass in SKEL->tp_base.
+ * SKEL, with known base type BASE (null for `object') and metaclass.
*/
/* Alias for built-in types, to fit in with Pyke naming conventions. */
*/
/* Alias for built-in types, to fit in with Pyke naming conventions. */
@@
-220,8
+220,7
@@
extern PyTypeObject *inittype(PyTypeObject */*skel*/,
#define type_pytype &PyType_Type
#define INITTYPE_META(ty, base, meta) do { \
#define type_pytype &PyType_Type
#define INITTYPE_META(ty, base, meta) do { \
- ty##_pytype_skel.tp_base = base##_pytype; \
- ty##_pytype = inittype(&ty##_pytype_skel, meta##_pytype); \
+ ty##_pytype = inittype(&ty##_pytype_skel, base##_pytype, meta##_pytype); \
} while (0)
#define INITTYPE(ty, base) INITTYPE_META(ty, base, type)
/* Macros to initialize a type from its skeleton. */
} while (0)
#define INITTYPE(ty, base) INITTYPE_META(ty, base, type)
/* Macros to initialize a type from its skeleton. */