~mdw
/
pyke
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
catacomb-python.h: Promote `util' to the head of the list.
[pyke]
/
util.c
diff --git
a/util.c
b/util.c
index
89130cb
..
717c3d9
100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-1,7
+1,5
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id$
- *
* Miscellaneous utilities (not Catacomb-specific)
*
* (c) 2005 Straylight/Edgeware
* Miscellaneous utilities (not Catacomb-specific)
*
* (c) 2005 Straylight/Edgeware
@@
-165,16
+163,19
@@
void *newtype(PyTypeObject *metaty,
ty->ht_name = PyString_FromString(ty->ht_type.tp_name);
if (ty->ht_name)
ty->ht_type.tp_name = PyString_AS_STRING(ty->ht_name);
ty->ht_name = PyString_FromString(ty->ht_type.tp_name);
if (ty->ht_name)
ty->ht_type.tp_name = PyString_AS_STRING(ty->ht_name);
-
PyObject_INIT(&ty->ht_type, metaty
);
+
DISCARD(PyObject_INIT(&ty->ht_type, metaty)
);
Py_INCREF(metaty);
return (ty);
}
PyTypeObject *inittype(PyTypeObject *tyskel)
{
Py_INCREF(metaty);
return (ty);
}
PyTypeObject *inittype(PyTypeObject *tyskel)
{
+ static PyObject *modname = 0;
PyTypeObject *ty = newtype(&PyType_Type, tyskel, 0);
PyTypeObject *ty = newtype(&PyType_Type, tyskel, 0);
+ if (!modname) modname = PyString_FromString("catacomb");
ty->tp_flags |= Py_TPFLAGS_HEAPTYPE;
PyType_Ready(ty);
ty->tp_flags |= Py_TPFLAGS_HEAPTYPE;
PyType_Ready(ty);
+ PyDict_SetItemString(ty->tp_dict, "__module__", modname);
return (ty);
}
return (ty);
}
@@
-634,13
+635,13
@@
PyMethodDef gmap_pymethods[] = {
/*----- Initialization ----------------------------------------------------*/
/*----- Initialization ----------------------------------------------------*/
-void util_init(void)
+void util_
py
init(void)
{
INITTYPE(itemiter, root);
INITTYPE(valiter, root);
}
{
INITTYPE(itemiter, root);
INITTYPE(valiter, root);
}
-void util_insert(PyObject *mod)
+void util_
py
insert(PyObject *mod)
{
INSERT("ItemIter", itemiter_pytype);
INSERT("ValueIter", valiter_pytype);
{
INSERT("ItemIter", itemiter_pytype);
INSERT("ValueIter", valiter_pytype);