*/
#include "config.h"
-#include "libsigrokdecode.h" /* First, so we avoid a _POSIX_C_SOURCE warning. */
-#include "libsigrokdecode-internal.h"
+#include "libsigrokdecode-internal.h" /* First, so we avoid a _POSIX_C_SOURCE warning. */
+#include "libsigrokdecode.h"
#include <glib.h>
/**
/**
* Returns the list of supported/loaded protocol decoders.
*
- * This is a GSList containing the names of the decoders as strings.
+ * This is a GSList of pointers to struct srd_decoder items.
*
* @return List of decoders, NULL if none are supported or loaded.
*
break;
}
- if (!(pdch = g_try_malloc(sizeof(struct srd_channel)))) {
- srd_err("Failed to g_malloc() struct srd_channel.");
- ret = SRD_ERR_MALLOC;
- break;
- }
+ pdch = g_malloc(sizeof(struct srd_channel));
if ((py_dictitem_as_str(py_entry, "id", &pdch->id)) != SRD_OK) {
ret = SRD_ERR_PYTHON;
py_basedec = py_method = py_attr = NULL;
- if (!(d = g_try_malloc0(sizeof(struct srd_decoder)))) {
- srd_dbg("Failed to g_malloc() struct srd_decoder.");
- ret = SRD_ERR_MALLOC;
- goto err_out;
- }
+ d = g_malloc0(sizeof(struct srd_decoder));
ret = SRD_ERR_PYTHON;
Py_CLEAR(py_basedec);
/*
- * Check that thіs decoder has the correct PD API version.
+ * Check that this decoder has the correct PD API version.
* PDs of different API versions are incompatible and cannot work.
*/
py_long = PyObject_GetAttrString(d->py_dec, "api_version");