* PDs of different API versions are incompatible and cannot work.
*/
apiver = srd_decoder_apiver(d);
- if (apiver != 2) {
- srd_exception_catch("Only PD API version 2 is supported, "
+ if (apiver != 2 && apiver != 3) {
+ srd_exception_catch("Only PD API version 2/3 is supported, "
"decoder %s has version %ld", module_name, apiver);
fail_txt = "API version mismatch";
goto err_out;
*/
SRD_API int srd_decoder_unload_all(void)
{
- GSList *l;
- struct srd_decoder *dec;
-
- for (l = pd_list; l; l = l->next) {
- dec = l->data;
- srd_decoder_unload(dec);
- }
+ g_slist_foreach(pd_list, (GFunc)srd_decoder_unload, NULL);
g_slist_free(pd_list);
pd_list = NULL;