X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/blobdiff_plain/24b3d57bcf320d9d7a90a40d5f6176b1f087ab3e..49915b4a09cc89ccd426b29f7113b380828361d3:/key.c diff --git a/key.c b/key.c index 54054bf..cd330c7 100644 --- a/key.c +++ b/key.c @@ -7,7 +7,7 @@ * (c) 2005 Straylight/Edgeware */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of the Python interface to Catacomb. * @@ -15,12 +15,12 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * Catacomb/Python is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with Catacomb/Python; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -336,7 +336,7 @@ static void keydata_pydealloc(PyObject *me) static PyObject *kdmeth_matchp(PyObject *me, PyObject *arg) { key_filter f; - + if (!PyArg_ParseTuple(arg, "O&:matchp", convfilter, &f)) return (0); return (getbool(KEY_MATCH(KEYDATA_KD(me), &f))); @@ -388,7 +388,7 @@ static PyObject *kdmeth_plock(PyObject *me, PyObject *arg) int err; PyObject *rc = 0; key_data *kd; - + if (!PyArg_ParseTuple(arg, "s:plock", &tag)) goto end; if ((err = key_plock(&kd, KEYDATA_KD(me), tag)) != 0) @@ -404,7 +404,7 @@ static PyObject *kdmeth_lock(PyObject *me, PyObject *arg) int n; PyObject *rc = 0; key_data *kd; - + if (!PyArg_ParseTuple(arg, "s#:lock", &p, &n)) goto end; key_lock(&kd, KEYDATA_KD(me), p, n); @@ -440,7 +440,7 @@ static PyObject *meth__KeyData_decode(PyObject *me, PyObject *arg) goto end; if ((kd = key_decode(p, n)) == 0) KEYERR(KERR_MALFORMED); - rc = keydata_pywrap(kd); + rc = keydata_pywrap(kd); end: return (rc); } @@ -635,7 +635,7 @@ static PyObject *kdemeth_punlock(PyObject *me, PyObject *arg) int err; PyObject *rc = 0; key_data *kd; - + if (!PyArg_ParseTuple(arg, "s:punlock", &tag)) goto end; if ((err = key_punlock(&kd, KEYDATA_KD(me), tag)) != 0) @@ -652,7 +652,7 @@ static PyObject *kdemeth_unlock(PyObject *me, PyObject *arg) int err; PyObject *rc = 0; key_data *kd; - + if (!PyArg_ParseTuple(arg, "s#:unlock", &p, &n)) goto end; if ((err = key_unlock(&kd, KEYDATA_KD(me), p, n)) != 0) @@ -1395,7 +1395,7 @@ static void key_pydealloc(PyObject *me) static PyObject *kmeth_delete(PyObject *me, PyObject *arg) { int err; - + if (!PyArg_ParseTuple(arg, ":delete")) goto end; if ((err = key_delete(KEY_KF(me), KEY_K(me))) != 0) KEYERR(err); RETURN_ME; @@ -1406,7 +1406,7 @@ end: static PyObject *kmeth_expire(PyObject *me, PyObject *arg) { int err; - + if (!PyArg_ParseTuple(arg, ":expire")) goto end; if ((err = key_expire(KEY_KF(me), KEY_K(me))) != 0) KEYERR(err); RETURN_ME; @@ -1418,7 +1418,7 @@ static PyObject *kmeth_used(PyObject *me, PyObject *arg) { long t; int err; - + if (!PyArg_ParseTuple(arg, "l:used", &t)) goto end; if ((err = key_used(KEY_KF(me), KEY_K(me), t)) != 0) KEYERR(err); RETURN_ME; @@ -1670,7 +1670,7 @@ static PyObject *keyiter_pynext(PyObject *me) if ((k = key_next(KEYITER_I(me))) == 0) return (0); - return (key_pywrap(KEYITER_KFOBJ(me), k)); + return (getulong(k->id)); } static void keyiter_pydealloc(PyObject *me) @@ -1909,7 +1909,7 @@ static PyObject *keyfile_pylookup(PyObject *me, PyObject *key) } end: return (rc); -} +} static PyObject *kfmeth_newkey(PyObject *me, PyObject *arg, PyObject *kw) {