- METH (__init__, "KeyError(CODE)")
- METH (__str__, "E.__str__() -> STRING")
+ METH (__init__, "KeyError(CODE)")
+ METH (__str__, "E.__str__() -> STRING")
- if (!PyArg_ParseTupleAndKeywords(arg, kw, "|O&:copy", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(arg, kw, "|O&:copy", KWLIST,
- if (!PyArg_ParseTupleAndKeywords(arg, kw, "|O&:write", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(arg, kw, "|O&:write", KWLIST,
- if (!PyArg_ParseTupleAndKeywords(arg, kw, "|O&:encode", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(arg, kw, "|O&:encode", KWLIST,
static PyObject *kdget_flags(PyObject *me, void *hunoz)
{ return (getulong(KEYDATA_KD(me)->e)); }
static PyObject *kdget_flags(PyObject *me, void *hunoz)
{ return (getulong(KEYDATA_KD(me)->e)); }
- METH (matchp, "KD.matchp(FILTER) -> BOOL")
- METH (split, "KD.split()")
- KWMETH(write, "KD.write([filter = <any>]) -> STRING")
- KWMETH(encode, "KD.encode([filter = <any>]) -> BYTES")
- KWMETH(copy, "KD.copy([filter = <any>]) -> KD")
- METH (plock, "KD.plock(TAG) -> ENCRYPTED-KD")
- METH (lock, "KD.lock(KEY) -> ENCRYPTED-KD")
+ METH (matchp, "KD.matchp(FILTER) -> BOOL")
+ METH (split, "KD.split()")
+ KWMETH(write, "KD.write([filter = <any>]) -> STRING")
+ KWMETH(encode, "KD.encode([filter = <any>]) -> BYTES")
+ KWMETH(copy, "KD.copy([filter = <any>]) -> KD")
+ METH (plock, "KD.plock(TAG) -> ENCRYPTED-KD")
+ METH (lock, "KD.lock(KEY) -> ENCRYPTED-KD")
- if (!PyArg_ParseTupleAndKeywords(arg, kw, "s#|O&:new", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(arg, kw, "s#|O&:new", KWLIST,
{ return (bytestring_pywrap(KEYDATA_KD(me)->u.k.k,
KEYDATA_KD(me)->u.k.sz)); }
{ return (bytestring_pywrap(KEYDATA_KD(me)->u.k.k,
KEYDATA_KD(me)->u.k.sz)); }
- if (!PyArg_ParseTupleAndKeywords(arg, kw, "s#|O&:new", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(arg, kw, "s#|O&:new", KWLIST,
- METH (plock, "KD.plock(TAG) -> ENCRYPTED-KD")
- METH (lock, "KD.lock(KEY) -> ENCRYPTED-KD")
- METH (punlock, "KD.punlock(TAG) -> KD")
- METH (unlock, "KD.unlock(KEY) -> KD")
+ METH (plock, "KD.plock(TAG) -> ENCRYPTED-KD")
+ METH (lock, "KD.lock(KEY) -> ENCRYPTED-KD")
+ METH (punlock, "KD.punlock(TAG) -> KD")
+ METH (unlock, "KD.unlock(KEY) -> KD")
- if (!PyArg_ParseTupleAndKeywords(arg, kw, "O&|O&:new", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(arg, kw, "O&|O&:new", KWLIST,
convmp, &x, convflags, &f))
goto end;
me = (keydata_pyobj *)ty->tp_alloc(ty, 0);
convmp, &x, convflags, &f))
goto end;
me = (keydata_pyobj *)ty->tp_alloc(ty, 0);
static PyObject *kdmget_mp(PyObject *me, void *hunoz)
{ return (mp_pywrap(MP_COPY(KEYDATA_KD(me)->u.m))); }
static PyObject *kdmget_mp(PyObject *me, void *hunoz)
{ return (mp_pywrap(MP_COPY(KEYDATA_KD(me)->u.m))); }
- if (!PyArg_ParseTupleAndKeywords(arg, kw, "s|O&:new", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(arg, kw, "s|O&:new", KWLIST,
static PyObject *kdsget_str(PyObject *me, void *hunoz)
{ return (PyString_FromString(KEYDATA_KD(me)->u.p)); }
static PyObject *kdsget_str(PyObject *me, void *hunoz)
{ return (PyString_FromString(KEYDATA_KD(me)->u.p)); }
- if (!PyArg_ParseTupleAndKeywords(arg, kw, "O&|O&:new", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(arg, kw, "O&|O&:new", KWLIST,
convecpt, &x, convflags, &f))
goto end;
me = (keydata_pyobj *)ty->tp_alloc(ty, 0);
convecpt, &x, convflags, &f))
goto end;
me = (keydata_pyobj *)ty->tp_alloc(ty, 0);
- if (!PyArg_ParseTupleAndKeywords(arg, kw, "|O:new", kwlist, &sub))
+ if (!PyArg_ParseTupleAndKeywords(arg, kw, "|O:new", KWLIST, &sub))
if ((tag = PyString_AsString(key)) == 0)
goto end;
if ((kd = key_structfind(KEYDATA_KD(me), tag)) == 0)
if ((tag = PyString_AsString(key)) == 0)
goto end;
if ((kd = key_structfind(KEYDATA_KD(me), tag)) == 0)
key_structset(KEYDATA_KD(me), tag, KEYDATA_KD(value));
} else {
if (!key_structfind(KEYDATA_KD(me), tag))
key_structset(KEYDATA_KD(me), tag, KEYDATA_KD(value));
} else {
if (!key_structfind(KEYDATA_KD(me), tag))
gmap_pysize, /* @mp_length@ */
keydatastruct_pylookup, /* @mp_subscript@ */
keydatastruct_pystore /* @mp_ass_subscript@ */
gmap_pysize, /* @mp_length@ */
keydatastruct_pylookup, /* @mp_subscript@ */
keydatastruct_pystore /* @mp_ass_subscript@ */
0, /* @tp_weaklistoffset@ */
subkeyiter_make, /* @tp_iter@ */
0, /* @tp_iternext@ */
0, /* @tp_weaklistoffset@ */
subkeyiter_make, /* @tp_iter@ */
0, /* @tp_iternext@ */
if ((attr = PyString_AsString(key)) == 0)
goto end;
if ((value = key_getattr(KEYATTRS_KF(me), KEYATTRS_K(me), attr)) == 0)
if ((attr = PyString_AsString(key)) == 0)
goto end;
if ((value = key_getattr(KEYATTRS_KF(me), KEYATTRS_K(me), attr)) == 0)
if ((err = key_putattr(KEYATTRS_KF(me), KEYATTRS_K(me), attr, 0)) != 0)
KEYERR(err);
}
if ((err = key_putattr(KEYATTRS_KF(me), KEYATTRS_K(me), attr, 0)) != 0)
KEYERR(err);
}
gmap_pysize, /* @mp_length@ */
keyattrs_pylookup, /* @mp_subscript@ */
keyattrs_pystore /* @mp_ass_subscript@ */
gmap_pysize, /* @mp_length@ */
keyattrs_pylookup, /* @mp_subscript@ */
keyattrs_pystore /* @mp_ass_subscript@ */
- &gmap_pysequence, /* @tp_as_sequence@ */
- &keyattrs_pymapping, /* @tp_as_mapping@ */
+ PYSEQUENCE(gmap), /* @tp_as_sequence@ */
+ PYMAPPING(keyattrs), /* @tp_as_mapping@ */
0, /* @tp_weaklistoffset@ */
keyattriter_make, /* @tp_iter@ */
0, /* @tp_iternext@ */
0, /* @tp_weaklistoffset@ */
keyattriter_make, /* @tp_iter@ */
0, /* @tp_iternext@ */
- static char *kwlist[] = { "keyfile", "id", "type", "exptime", 0 };
+ static const char *const kwlist[] =
+ { "keyfile", "id", "type", "exptime", 0 };
- if (!PyArg_ParseTupleAndKeywords(arg, kw, "O!O&s|O&:new", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(arg, kw, "O!O&s|O&:new", KWLIST,
keyfile_pytype, &kfobj, convu32, &id,
&type, convulong, &exptime))
goto end;
keyfile_pytype, &kfobj, convu32, &id,
&type, convulong, &exptime))
goto end;
- if (!PyArg_ParseTupleAndKeywords(arg, kw, "O!|O&:extract", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(arg, kw, "O!|O&:extract", KWLIST,
- if (!PyArg_ParseTupleAndKeywords(arg, kw, "O&|O&:fingerprint", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(arg, kw, "O&|O&:fingerprint", KWLIST,
convghash, &h, convfilter, &f))
return (0);
return (getbool(key_fingerprint(KEY_K(me), h, &f)));
convghash, &h, convfilter, &f))
return (0);
return (getbool(key_fingerprint(KEY_K(me), h, &f)));
#define METHNAME(func) kmeth_##func
METH (delete, "KEY.delete()")
METH (expire, "KEY.expire()")
#define METHNAME(func) kmeth_##func
METH (delete, "KEY.delete()")
METH (expire, "KEY.expire()")
#define GETSETNAME(op, name) k##op##_##name
GET (file, "KEY.file -> KF")
GET (id, "KEY.id -> ID")
#define GETSETNAME(op, name) k##op##_##name
GET (file, "KEY.file -> KF")
GET (id, "KEY.id -> ID")
- static char *kwlist[] = { "file", "how", "report", 0 };
+ static const char *const kwlist[] = { "file", "how", "report", 0 };
- if (!PyArg_ParseTupleAndKeywords(arg, kw, "s|iO:new", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(arg, kw, "s|iO:new", KWLIST,
- if (!PyArg_ParseTupleAndKeywords(arg, kw, "O!|O:merge", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(arg, kw, "O!|O:merge", KWLIST,
&PyFile_Type, &x, &ri.func))
goto end;
if (ri.func && !PyCallable_Check(ri.func))
&PyFile_Type, &x, &ri.func))
goto end;
if (ri.func && !PyCallable_Check(ri.func))
- static char *kwlist[] = { "id", "type", "exptime", 0 };
+ static const char *const kwlist[] = { "id", "type", "exptime", 0 };
- if (!PyArg_ParseTupleAndKeywords(arg, kw, "O&s|l:newkey", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(arg, kw, "O&s|l:newkey", KWLIST,
convu32, &id, &type, &exptime))
goto end;
if ((err = key_new(KEYFILE_KF(me), id, type, exptime, &k)) != 0)
convu32, &id, &type, &exptime))
goto end;
if ((err = key_new(KEYFILE_KF(me), id, type, exptime, &k)) != 0)
- if (!PyArg_ParseTupleAndKeywords(arg, kw, "s|O!:qtag", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(arg, kw, "s|O!:qtag", KWLIST,
&tag, keydata_pytype, &newkdobj))
goto end;
if (key_qtag(KEYFILE_KF(me), tag, &d, &k, &kd))
&tag, keydata_pytype, &newkdobj))
goto end;
if (key_qtag(KEYFILE_KF(me), tag, &d, &k, &kd))
static PyObject *kfget_filep(PyObject *me, void *hunoz)
{ return (getbool(!!KEYFILE_KF(me)->fp)); }
static PyObject *kfget_filep(PyObject *me, void *hunoz)
{ return (getbool(!!KEYFILE_KF(me)->fp)); }
#define METHNAME(func) kfmeth_##func
METH (save, "KF.save()")
KWMETH(merge, "KF.merge(FILE, [report = <built-in-reporter>])")
#define METHNAME(func) kfmeth_##func
METH (save, "KF.save()")
KWMETH(merge, "KF.merge(FILE, [report = <built-in-reporter>])")
- KWMETH(newkey, "KF.newkey(ID, TYPE, "
- "[exptime = KEXP_FOREVER]) -> KEY")
+ KWMETH(newkey, "KF.newkey(ID, TYPE, [exptime = KEXP_FOREVER]) "
+ "-> KEY")
METH (byid, "KF.byid(KEYID) -> KEY|None")
METH (bytype, "KF.bytype(TYPE) -> KEY|None")
METH (bytag, "KF.bytag(TAG) -> KEY|None")
METH (byid, "KF.byid(KEYID) -> KEY|None")
METH (bytype, "KF.bytype(TYPE) -> KEY|None")
METH (bytag, "KF.bytag(TAG) -> KEY|None")
#define GETSETNAME(op, name) kf##op##_##name
GET (name, "KF.name -> file name")
GET (modifiedp, "KF.modifiedp -> has keyring been modified?")
#define GETSETNAME(op, name) kf##op##_##name
GET (name, "KF.name -> file name")
GET (modifiedp, "KF.modifiedp -> has keyring been modified?")
- &gmap_pysequence, /* @tp_as_sequence@ */
- &keyfile_pymapping, /* @tp_as_mapping@ */
+ PYSEQUENCE(gmap), /* @tp_as_sequence@ */
+ PYMAPPING(keyfile), /* @tp_as_mapping@ */
+ "KeyFile(FILE, [how = KOPEN_READ], [report = ?]): Keyring file.\n"
+ " calls REPORT(FILE, LINE, MSG) on problems",
0, /* @tp_weaklistoffset@ */
keyiter_new, /* @tp_iter@ */
0, /* @tp_iternext@ */
0, /* @tp_weaklistoffset@ */
keyiter_new, /* @tp_iter@ */
0, /* @tp_iternext@ */
- METH (_KeyData_readflags,
- "KeyData.readflags(STRING) -> (FLAGS, MASK, REST)")
- METH (_KeyData_writeflags, "KeyData.writeflags(FLAGS) -> STRING")
- METH (_KeyData_read, "KeyData.read(STRING) -> (KD, REST)")
- METH (_KeyData_decode, "KeyData.decode(BYTES) -> KD")
- METH (barf, "barf(ERR)")
+ METH (_KeyData_readflags, "KeyData.readflags(STRING) "
+ "-> (FLAGS, MASK, REST)")
+ METH (_KeyData_writeflags, "KeyData.writeflags(FLAGS) -> STRING")
+ METH (_KeyData_read, "KeyData.read(STRING) -> (KD, REST)")
+ METH (_KeyData_decode, "KeyData.decode(BYTES) -> KD")