X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=decoder.c;h=5d719d3d75ffc7f8690422d44751aa09a3b09441;hp=7753a33f00de04663f486bba8e533a744a0ec6fe;hb=1aef2f93a29f01168c04fd0478b29af290d8756b;hpb=b2c19614a6c4eaa0170971d1261a1bb25212e277 diff --git a/decoder.c b/decoder.c index 7753a33..5d719d3 100644 --- a/decoder.c +++ b/decoder.c @@ -23,8 +23,8 @@ #include /* 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);