From: Uwe Hermann Date: Sun, 6 Feb 2011 16:36:32 +0000 (+0100) Subject: struct srd_decoder: Add more string fields. X-Git-Tag: libsigrokdecode-0.1.0~289 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=75a282e54f566cb6bc9b684dd1bf63d7e36a68b3;p=libsigrokdecode.git struct srd_decoder: Add more string fields. Get the following string fields from the .py decoders' register() function and store them in the respective 'struct srd_decoder': - longname - longdesc - author - email - license --- diff --git a/decode.c b/decode.c index 9f8c034..026a613 100644 --- a/decode.c +++ b/decode.c @@ -225,9 +225,26 @@ static int srd_load_decoder(const char *name, if ((r = h_str(py_res, py_func, py_mod, "name", &(d->name))) < 0) return r; + if ((r = h_str(py_res, py_func, py_mod, "longname", + &(d->longname))) < 0) + return r; + if ((r = h_str(py_res, py_func, py_mod, "desc", &(d->desc))) < 0) return r; + if ((r = h_str(py_res, py_func, py_mod, "longdesc", + &(d->longdesc))) < 0) + return r; + + if ((r = h_str(py_res, py_func, py_mod, "author", &(d->author))) < 0) + return r; + + if ((r = h_str(py_res, py_func, py_mod, "email", &(d->email))) < 0) + return r; + + if ((r = h_str(py_res, py_func, py_mod, "license", &(d->license))) < 0) + return r; + d->py_mod = py_mod; Py_XDECREF(py_res); diff --git a/sigrokdecode.h b/sigrokdecode.h index c0de99f..ccfb6c1 100644 --- a/sigrokdecode.h +++ b/sigrokdecode.h @@ -57,8 +57,15 @@ extern "C" { struct srd_decoder { char *id; char *name; + char *longname; char *desc; + char *longdesc; + char *author; + char *email; + char *license; + char *func; + GSList *inputformats; GSList *outputformats;