X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb-python/blobdiff_plain/f368b46e168e8accdb0c578ccbba7e7d2ee8c0de..bf8910bde6a430a64868ef70319f94e94114c82c:/catacomb-python.h diff --git a/catacomb-python.h b/catacomb-python.h index 40ac758..722d7ad 100644 --- a/catacomb-python.h +++ b/catacomb-python.h @@ -237,8 +237,7 @@ extern int convszt(PyObject *, void *); extern int convbool(PyObject *, void *); extern PyObject *abstract_pynew(PyTypeObject *, PyObject *, PyObject *); extern PyObject *getbool(int); -#define DECL_GETU_(n) extern PyObject *getu##n(uint##n); -DOUINTSZ(DECL_GETU_) +extern PyObject *getulong(unsigned long); extern void *newtype(PyTypeObject *, const PyTypeObject *, const char *); extern PyObject * mkexc(PyObject *, PyObject *, const char *, PyMethodDef *); @@ -256,7 +255,7 @@ extern PyMethodDef *donemethods(void); #define GMAP_KWMETHDECL(func, doc) \ extern PyObject *gmapmeth_##func(PyObject *, PyObject *, PyObject *); -#define GMAP_DOMETHODS(METH, KWMETH) \ +#define GMAP_DOROMETHODS(METH, KWMETH) \ METH (has_key, "D.has_key(KEY) -> BOOL") \ METH (keys, "D.keys() -> LIST") \ METH (values, "D.values() -> LIST") \ @@ -264,14 +263,18 @@ extern PyMethodDef *donemethods(void); METH (iterkeys, "D.iterkeys() -> ITER") \ METH (itervalues, "D.itervalues() -> ITER") \ METH (iteritems, "D.iteritems() -> ITER") \ - METH (clear, "D.clear()") \ KWMETH(get, "D.get(KEY, [default = None]) -> VALUE") \ + +#define GMAP_DOMETHODS(METH, KWMETH) \ + GMAP_DOROMETHODS(METH, KWMETH) \ + METH (clear, "D.clear()") \ KWMETH(setdefault, "D.setdefault(K, [default = None]) -> VALUE") \ KWMETH(pop, "D.pop(KEY, [default = ]) -> VALUE") \ METH (popitem, "D.popitem() -> (KEY, VALUE)") \ METH (update, "D.update(MAP)") GMAP_DOMETHODS(GMAP_METHDECL, GMAP_KWMETHDECL) +#define GMAP_ROMETHODS GMAP_DOROMETHODS(GMAP_METH, GMAP_KWMETH) #define GMAP_METHODS GMAP_DOMETHODS(GMAP_METH, GMAP_KWMETH) extern int gmap_pysize(PyObject *); extern PySequenceMethods gmap_pysequence;