X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/blobdiff_plain/c461c9b380b56a41399e5f540e4bb97cfd9ceffe..8ebc32d8616aeac9892d20cebfbdc1b531b29d2c:/passphrase.c diff --git a/passphrase.c b/passphrase.c index 7e28f93..4c8caf4 100644 --- a/passphrase.c +++ b/passphrase.c @@ -54,11 +54,11 @@ end: static PyObject *pixie_pynew(PyTypeObject *ty, PyObject *arg, PyObject *kw) { pixie_pyobj *rc = 0; - char *kwlist[] = { "socket", 0 }; + static const char *const kwlist[] = { "socket", 0 }; char *sock = 0; int fd; - if (!PyArg_ParseTupleAndKeywords(arg, kw, "|s:new", kwlist, &sock)) + if (!PyArg_ParseTupleAndKeywords(arg, kw, "|s:new", KWLIST, &sock)) goto end; if ((fd = pixie_open(sock)) < 0) OSERR(sock); @@ -78,12 +78,12 @@ static PyObject *pixmeth_read(PyObject *me, PyObject *arg, PyObject *kw) { unsigned mode = PMODE_READ; char *tag; - char *kwlist[] = { "tag", "mode", 0 }; + static const char *const kwlist[] = { "tag", "mode", 0 }; PyObject *rc = 0; int r; char buf[1024]; - if (!PyArg_ParseTupleAndKeywords(arg, kw, "s|O&:read", kwlist, + if (!PyArg_ParseTupleAndKeywords(arg, kw, "s|O&:read", KWLIST, &tag, convuint, &mode)) goto end; r = pixie_read(PIXIE_FD(me), tag, mode, buf, sizeof(buf)); @@ -152,7 +152,7 @@ static PyTypeObject pixie_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Passphrase pixie connection.", + "Pixie([socket = ?]): passphrase pixie connection.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -182,10 +182,10 @@ static PyObject *meth_ppread(PyObject *me, PyObject *arg, PyObject *kw) char *tag; unsigned f = PMODE_READ; PyObject *rc = 0; - char *kwlist[] = { "tag", "mode", 0 }; + static const char *const kwlist[] = { "tag", "mode", 0 }; char buf[1024]; - if (!PyArg_ParseTupleAndKeywords(arg, kw, "s|O&:ppread", kwlist, + if (!PyArg_ParseTupleAndKeywords(arg, kw, "s|O&:ppread", KWLIST, &tag, convuint, &f)) goto end; if (passphrase_read(tag, f, buf, sizeof(buf))) @@ -222,9 +222,9 @@ end: static PyMethodDef methods[] = { #define METHNAME(name) meth_##name - KWMETH(ppread, "ppread(TAG, [mode = PMODE_READ]) -> STRING") - METH (ppcancel, "ppcancel(TAG)") - METH (getpass, "getpass(PROMPT) -> STRING") + KWMETH(ppread, "ppread(TAG, [mode = PMODE_READ]) -> STRING") + METH (ppcancel, "ppcancel(TAG)") + METH (getpass, "getpass(PROMPT) -> STRING") #undef METHNAME { 0 } };