chiark / gitweb /
algorithms.c: Fix docstring for `GCHash.hashsz'.
[catacomb-python] / algorithms.c
index b672498ae9db4f31402660b1bc50641f1ab719a0..06fdc3271200f7a99f36fe2786c024dc28bd2e6a 100644 (file)
@@ -230,7 +230,7 @@ static PyMemberDef keyszset_pymembers[] = {
 
 static PyTypeObject keysz_pytype_skel = {
   PyObject_HEAD_INIT(0) 0,             /* Header */
-  "catacomb.KeySZ",                    /* @tp_name@ */
+  "KeySZ",                             /* @tp_name@ */
   sizeof(keysz_pyobj),                 /* @tp_basicsize@ */
   0,                                   /* @tp_itemsize@ */
 
@@ -278,7 +278,7 @@ static PyTypeObject keysz_pytype_skel = {
 
 static PyTypeObject keyszany_pytype_skel = {
   PyObject_HEAD_INIT(0) 0,             /* Header */
-  "catacomb.KeySZAny",                 /* @tp_name@ */
+  "KeySZAny",                          /* @tp_name@ */
   sizeof(keysz_pyobj),                 /* @tp_basicsize@ */
   0,                                   /* @tp_itemsize@ */
 
@@ -326,7 +326,7 @@ static PyTypeObject keyszany_pytype_skel = {
 
 static PyTypeObject keyszrange_pytype_skel = {
   PyObject_HEAD_INIT(0) 0,             /* Header */
-  "catacomb.KeySZRange",               /* @tp_name@ */
+  "KeySZRange",                                /* @tp_name@ */
   sizeof(keyszrange_pyobj),            /* @tp_basicsize@ */
   0,                                   /* @tp_itemsize@ */
 
@@ -375,7 +375,7 @@ sizes, and requires the key length to be a multiple of some value.",
 
 static PyTypeObject keyszset_pytype_skel = {
   PyObject_HEAD_INIT(0) 0,             /* Header */
-  "catacomb.KeySZSet",                 /* @tp_name@ */
+  "KeySZSet",                          /* @tp_name@ */
   sizeof(keyszset_pyobj),              /* @tp_basicsize@ */
   0,                                   /* @tp_itemsize@ */
 
@@ -487,7 +487,7 @@ PyObject *gccipher_pywrap(gccipher *cc)
   g->ty.ht_type.tp_alloc = PyType_GenericAlloc;
   g->ty.ht_type.tp_free = 0;
   g->ty.ht_type.tp_new = gcipher_pynew;
-  PyType_Ready(&g->ty.ht_type);
+  typeready(&g->ty.ht_type);
   return ((PyObject *)g);
 }
 
@@ -607,7 +607,7 @@ static PyMethodDef gcipher_pymethods[] = {
 
 static PyTypeObject gccipher_pytype_skel = {
   PyObject_HEAD_INIT(0) 0,             /* Header */
-  "catacomb.GCCipher",                 /* @tp_name@ */
+  "GCCipher",                          /* @tp_name@ */
   sizeof(gccipher_pyobj),              /* @tp_basicsize@ */
   0,                                   /* @tp_itemsize@ */
 
@@ -655,7 +655,7 @@ static PyTypeObject gccipher_pytype_skel = {
 
 static PyTypeObject gcipher_pytype_skel = {
   PyObject_HEAD_INIT(0) 0,             /* Header */
-  "catacomb.GCipher",                  /* @tp_name@ */
+  "GCipher",                           /* @tp_name@ */
   sizeof(gcipher_pyobj),               /* @tp_basicsize@ */
   0,                                   /* @tp_itemsize@ */
 
@@ -731,7 +731,7 @@ PyObject *gchash_pywrap(gchash *ch)
   g->ty.ht_type.tp_alloc = PyType_GenericAlloc;
   g->ty.ht_type.tp_free = 0;
   g->ty.ht_type.tp_new = ghash_pynew;
-  PyType_Ready(&g->ty.ht_type);
+  typeready(&g->ty.ht_type);
   return ((PyObject *)g);
 }
 
@@ -787,7 +787,7 @@ static PyObject *ghmeth_done(PyObject *me, PyObject *arg)
 static PyGetSetDef gchash_pygetset[] = {
 #define GETSETNAME(op, name) gch##op##_##name
   GET  (bufsz,                 "CH.bufsz -> hash buffer size, or zero")
-  GET  (hashsz,                "CH.blksz -> hash output size")
+  GET  (hashsz,                "CH.hashsz -> hash output size")
   GET  (name,                  "CH.name -> name of this kind of hash")
 #undef GETSETNAME
   { 0 }
@@ -842,7 +842,7 @@ static PyMethodDef ghash_pymethods[] = {
 
 static PyTypeObject gchash_pytype_skel = {
   PyObject_HEAD_INIT(0) 0,             /* Header */
-  "catacomb.GCHash",                   /* @tp_name@ */
+  "GCHash",                            /* @tp_name@ */
   sizeof(gchash_pyobj),                        /* @tp_basicsize@ */
   0,                                   /* @tp_itemsize@ */
 
@@ -890,7 +890,7 @@ static PyTypeObject gchash_pytype_skel = {
 
 static PyTypeObject ghash_pytype_skel = {
   PyObject_HEAD_INIT(0) 0,             /* Header */
-  "catacomb.GHash",                    /* @tp_name@ */
+  "GHash",                             /* @tp_name@ */
   sizeof(ghash_pyobj),                 /* @tp_basicsize@ */
   0,                                   /* @tp_itemsize@ */
 
@@ -986,7 +986,7 @@ PyObject *gcmac_pywrap(gcmac *cm)
   g->ty.ht_type.tp_alloc = PyType_GenericAlloc;
   g->ty.ht_type.tp_free = 0;
   g->ty.ht_type.tp_new = gmac_pynew;
-  PyType_Ready(&g->ty.ht_type);
+  typeready(&g->ty.ht_type);
   return ((PyObject *)g);
 }
 
@@ -996,6 +996,7 @@ PyObject *gmac_pywrap(PyObject *cobj, gmac *m, unsigned f)
   if (!cobj) cobj = gcmac_pywrap((/*unconst*/ gcmac *)GM_CLASS(m));
   else Py_INCREF(cobj);
   g = newtype((PyTypeObject *)cobj, 0, 0);
+  g->ty.ht_type.tp_basicsize = sizeof(ghash_pyobj);
   g->ty.ht_name = PyString_FromFormat("%s(keyed)", m->ops->c->name);
   g->ty.ht_type.tp_name = PyString_AS_STRING(g->ty.ht_name);
   g->ty.ht_type.tp_base = gmhash_pytype;
@@ -1006,7 +1007,7 @@ PyObject *gmac_pywrap(PyObject *cobj, gmac *m, unsigned f)
   g->ty.ht_type.tp_alloc = PyType_GenericAlloc;
   g->ty.ht_type.tp_free = 0;
   g->ty.ht_type.tp_new = gmhash_pynew;
-  PyType_Ready(&g->ty.ht_type);
+  typeready(&g->ty.ht_type);
   g->m = m;
   g->f = f;
   return ((PyObject *)g);
@@ -1040,7 +1041,7 @@ static PyGetSetDef gcmac_pygetset[] = {
 
 static PyTypeObject gcmac_pytype_skel = {
   PyObject_HEAD_INIT(0) 0,             /* Header */
-  "catacomb.GCMAC",                    /* @tp_name@ */
+  "GCMAC",                             /* @tp_name@ */
   sizeof(gchash_pyobj),                        /* @tp_basicsize@ */
   0,                                   /* @tp_itemsize@ */
 
@@ -1088,7 +1089,7 @@ static PyTypeObject gcmac_pytype_skel = {
 
 static PyTypeObject gmac_pytype_skel = {
   PyObject_HEAD_INIT(0) 0,             /* Header */
-  "catacomb.GMAC",                     /* @tp_name@ */
+  "GMAC",                              /* @tp_name@ */
   sizeof(gmac_pyobj),                  /* @tp_basicsize@ */
   0,                                   /* @tp_itemsize@ */
 
@@ -1136,7 +1137,7 @@ static PyTypeObject gmac_pytype_skel = {
 
 static PyTypeObject gmhash_pytype_skel = {
   PyObject_HEAD_INIT(0) 0,             /* Header */
-  "catacomb.GMACHash",                 /* @tp_name@ */
+  "GMACHash",                          /* @tp_name@ */
   sizeof(ghash_pyobj),                 /* @tp_basicsize@ */
   0,                                   /* @tp_itemsize@ */
 
@@ -1275,7 +1276,7 @@ static PyObject *gcprp_pywrap(const prpinfo *prp)
   g->ty.ht_type.tp_alloc = PyType_GenericAlloc;
   g->ty.ht_type.tp_free = 0;
   g->ty.ht_type.tp_new = gprp_pynew;
-  PyType_Ready(&g->ty.ht_type);
+  typeready(&g->ty.ht_type);
   return ((PyObject *)g);
 }
 
@@ -1333,7 +1334,7 @@ static PyMethodDef gprp_pymethods[] = {
 
 static PyTypeObject gcprp_pytype_skel = {
   PyObject_HEAD_INIT(0) 0,             /* Header */
-  "catacomb.GCPRP",                    /* @tp_name@ */
+  "GCPRP",                             /* @tp_name@ */
   sizeof(gcprp_pyobj),                 /* @tp_basicsize@ */
   0,                                   /* @tp_itemsize@ */
 
@@ -1381,7 +1382,7 @@ static PyTypeObject gcprp_pytype_skel = {
 
 static PyTypeObject gprp_pytype_skel = {
   PyObject_HEAD_INIT(0) 0,             /* Header */
-  "catacomb.GPRP",                     /* @tp_name@ */
+  "GPRP",                              /* @tp_name@ */
   sizeof(gprp_pyobj),                  /* @tp_basicsize@ */
   0,                                   /* @tp_itemsize@ */