X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/blobdiff_plain/ddd4720bd8a7e04bb37ba6825b46f1bbdce9d3e7..cc36f2d8913cf55b43ed32d3f2f06622906038af:/key.c?ds=sidebyside diff --git a/key.c b/key.c index 919b8f9..a78b15e 100644 --- a/key.c +++ b/key.c @@ -2060,6 +2060,21 @@ static const PyTypeObject keyfile_pytype_skel = { /*----- Initialization ----------------------------------------------------*/ +static const struct nameval consts[] = { + CONST(KOPEN_READ), CONST(KOPEN_WRITE), CONST(KOPEN_NOFILE), + CONST(KEXP_FOREVER), CONST(KEXP_EXPIRE), + CONST(KF_ENCMASK), CONST(KENC_BINARY), CONST(KENC_MP), CONST(KENC_STRUCT), + CONST(KENC_ENCRYPT), CONST(KENC_STRING), CONST(KENC_EC), + CONST(KF_CATMASK), CONST(KCAT_SYMM), CONST(KCAT_PRIV), CONST(KCAT_PUB), + CONST(KCAT_SHARE), + CONST(KF_NONSECRET), + CONST(KF_BURN), CONST(KF_OPT), +#define ENTRY(tag, val, str) CONSTFLAG(CF_SIGNED, KERR_##tag), + KEY_ERRORS(ENTRY) +#undef ENTRY + { 0 } +}; + void key_pyinit(void) { INITTYPE(keyfile, root); @@ -2095,6 +2110,7 @@ void key_pyinsert(PyObject *mod) INSERT("KeyDataString", keydatastr_pytype); INSERT("KeyDataStructured", keydatastruct_pytype); INSERT("SubKeyIter", subkeyiter_pytype); + setconstants(mod, consts); } /*----- That's all, folks -------------------------------------------------*/