struct srd_decoder: Add more string fields.
authorUwe Hermann <uwe@hermann-uwe.de>
Sun, 6 Feb 2011 16:36:32 +0000 (17:36 +0100)
committerUwe Hermann <uwe@hermann-uwe.de>
Sun, 6 Feb 2011 16:36:32 +0000 (17:36 +0100)
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

decode.c
sigrokdecode.h

index 9f8c03408113ed45216b206f853431340dd76b04..026a6133a7956a5344a416b84bbbfab8e9e34efa 100644 (file)
--- 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);
index c0de99f9c756e7821c982ef2d030cb43cb1d8be7..ccfb6c156e6b36dc6504e22b5ada66092aa0d7e3 100644 (file)
@@ -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;