]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoder.c
make time/duration work, at least when loading from a session file
[libsigrokdecode.git] / decoder.c
index 7753a33f00de04663f486bba8e533a744a0ec6fe..5d719d3d75ffc7f8690422d44751aa09a3b09441 100644 (file)
--- a/decoder.c
+++ b/decoder.c
@@ -23,8 +23,8 @@
 #include <dirent.h>
 
 /* The list of protocol decoders. */
-GSList *list_pds = NULL;
-GSList *decoders = NULL;
+GSList *pd_list = NULL;
+GSList *di_list = NULL;
 
 
 /**
@@ -37,7 +37,7 @@ GSList *decoders = NULL;
 GSList *srd_list_decoders(void)
 {
 
-       return list_pds;
+       return pd_list;
 }
 
 
@@ -96,8 +96,8 @@ int srd_load_decoder(const char *name, struct srd_decoder **dec)
        if (!(d = malloc(sizeof(struct srd_decoder))))
                return SRD_ERR_MALLOC;
 
-       /* We'll just use the name of the module for the ID. */
-       d->id = strdup(name);
+       if ((r = h_str(py_res, py_mod, "id", &(d->id))) < 0)
+               return r;
 
        if ((r = h_str(py_res, py_mod, "name", &(d->name))) < 0)
                return r;
@@ -194,7 +194,7 @@ int srd_load_all_decoders(void)
                /* TODO: Warning if loading fails for a decoder. */
                if ((ret = srd_load_decoder(decodername, &dec)) == SRD_OK) {
                        /* Append it to the list of supported/loaded decoders. */
-                       list_pds = g_slist_append(list_pds, dec);
+                       pd_list = g_slist_append(pd_list, dec);
                }
        }
        closedir(dir);