PyObject *gccipher_pywrap(gccipher *cc)
{
- gccipher_pyobj *g = newtype(gccipher_pytype, 0);
+ gccipher_pyobj *g = newtype(gccipher_pytype, 0, cc->name);
g->cc = cc;
- g->ty.tp_name = (/*unconst*/ char *)cc->name;
- g->ty.tp_basicsize = sizeof(gcipher_pyobj);
- g->ty.tp_base = gcipher_pytype;
+ g->ty.type.tp_basicsize = sizeof(gcipher_pyobj);
+ g->ty.type.tp_base = gcipher_pytype;
Py_INCREF(gcipher_pytype);
- g->ty.tp_flags = (Py_TPFLAGS_DEFAULT |
- Py_TPFLAGS_BASETYPE |
- Py_TPFLAGS_HEAPTYPE);
- g->ty.tp_alloc = PyType_GenericAlloc;
- g->ty.tp_free = 0;
- g->ty.tp_new = gcipher_pynew;
- PyType_Ready(&g->ty);
+ g->ty.type.tp_flags = (Py_TPFLAGS_DEFAULT |
+ Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_HEAPTYPE);
+ g->ty.type.tp_alloc = PyType_GenericAlloc;
+ g->ty.type.tp_free = 0;
+ g->ty.type.tp_new = gcipher_pynew;
+ PyType_Ready(&g->ty.type);
return ((PyObject *)g);
}
PyObject *gchash_pywrap(gchash *ch)
{
- gchash_pyobj *g = newtype(gchash_pytype, 0);
+ gchash_pyobj *g = newtype(gchash_pytype, 0, ch->name);
g->ch = ch;
- g->ty.tp_name = (/*unconst*/ char *)ch->name;
- g->ty.tp_basicsize = sizeof(ghash_pyobj);
- g->ty.tp_base = ghash_pytype;
+ g->ty.type.tp_basicsize = sizeof(ghash_pyobj);
+ g->ty.type.tp_base = ghash_pytype;
Py_INCREF(ghash_pytype);
- g->ty.tp_flags = (Py_TPFLAGS_DEFAULT |
- Py_TPFLAGS_BASETYPE |
- Py_TPFLAGS_HEAPTYPE);
- g->ty.tp_alloc = PyType_GenericAlloc;
- g->ty.tp_free = 0;
- g->ty.tp_new = ghash_pynew;
- PyType_Ready(&g->ty);
+ g->ty.type.tp_flags = (Py_TPFLAGS_DEFAULT |
+ Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_HEAPTYPE);
+ g->ty.type.tp_alloc = PyType_GenericAlloc;
+ g->ty.type.tp_free = 0;
+ g->ty.type.tp_new = ghash_pynew;
+ PyType_Ready(&g->ty.type);
return ((PyObject *)g);
}
PyObject *gcmac_pywrap(gcmac *cm)
{
- gcmac_pyobj *g = newtype(gcmac_pytype, 0);
+ gcmac_pyobj *g = newtype(gcmac_pytype, 0, cm->name);
g->cm = cm;
- g->ty.tp_name = (/*unconst*/ char *)cm->name;
- g->ty.tp_basicsize = sizeof(gmac_pyobj);
- g->ty.tp_base = gmac_pytype;
+ g->ty.type.tp_basicsize = sizeof(gmac_pyobj);
+ g->ty.type.tp_base = gmac_pytype;
Py_INCREF(gmac_pytype);
- g->ty.tp_flags = (Py_TPFLAGS_DEFAULT |
+ g->ty.type.tp_flags = (Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE |
Py_TPFLAGS_HEAPTYPE);
- g->ty.tp_alloc = PyType_GenericAlloc;
- g->ty.tp_free = 0;
- g->ty.tp_new = gmac_pynew;
- PyType_Ready(&g->ty);
+ g->ty.type.tp_alloc = PyType_GenericAlloc;
+ g->ty.type.tp_free = 0;
+ g->ty.type.tp_new = gmac_pynew;
+ PyType_Ready(&g->ty.type);
return ((PyObject *)g);
}
gmac_pyobj *g;
if (!cobj) cobj = gcmac_pywrap((/*unconst*/ gcmac *)GM_CLASS(m));
else Py_INCREF(cobj);
- g = newtype((PyTypeObject *)cobj, 0);
- g->nameobj = PyString_FromFormat("%s(keyed)", m->ops->c->name);
- g->ty.tp_name = PyString_AS_STRING(g->nameobj);
- g->ty.tp_base = gmhash_pytype;
+ g = newtype((PyTypeObject *)cobj, 0, 0);
+ g->ty.name = PyString_FromFormat("%s(keyed)", m->ops->c->name);
+ g->ty.type.tp_name = PyString_AS_STRING(g->ty.name);
+ g->ty.type.tp_base = gmhash_pytype;
Py_INCREF(gmac_pytype);
- g->ty.tp_flags = (Py_TPFLAGS_DEFAULT |
- Py_TPFLAGS_BASETYPE |
- Py_TPFLAGS_HEAPTYPE);
- g->ty.tp_alloc = PyType_GenericAlloc;
- g->ty.tp_free = 0;
- g->ty.tp_new = gmhash_pynew;
- PyType_Ready(&g->ty);
+ g->ty.type.tp_flags = (Py_TPFLAGS_DEFAULT |
+ Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_HEAPTYPE);
+ g->ty.type.tp_alloc = PyType_GenericAlloc;
+ g->ty.type.tp_free = 0;
+ g->ty.type.tp_new = gmhash_pynew;
+ PyType_Ready(&g->ty.type);
g->m = m;
g->f = f;
return ((PyObject *)g);
if (GMAC_F(me) & f_freeme)
GM_DESTROY(GMAC_M(me));
Py_DECREF(me->ob_type);
- Py_DECREF(GMAC_NAMEOBJ(me));
PyType_Type.tp_dealloc(me);
}