* Get the decoder with the specified ID.
*
* @param id The ID string of the decoder to return.
+ *
* @return The decoder with the specified ID, or NULL if not found.
*/
SRD_API struct srd_decoder *srd_get_decoder_by_id(const char *id)
}
if (!(p = g_try_malloc(sizeof(struct srd_probe)))) {
+ srd_err("Failed to g_malloc() struct srd_probe.");
ret = SRD_ERR_MALLOC;
goto err_out;
}
py_basedec = py_method = py_attr = NULL;
if (!(d = g_try_malloc0(sizeof(struct srd_decoder)))) {
- srd_dbg("Failed to malloc struct srd_decoder.");
+ srd_dbg("Failed to g_malloc() struct srd_decoder.");
ret = SRD_ERR_MALLOC;
goto err_out;
}
return ret;
}
+/**
+ * Return a protocol decoder's docstring.
+ *
+ * @param dec The loaded protocol decoder.
+ *
+ * @return A newly allocated buffer containing the docstring. The caller should
+ * free this after use.
+ */
SRD_API char *srd_decoder_doc(struct srd_decoder *dec)
{
PyObject *py_str;
* but they could be anywhere in the stack, just free the entire
* stack. A frontend reloading a decoder thus has to restart all
* instances, and rebuild the stack. */
- srd_instance_free_all(NULL);
+ srd_inst_free_all(NULL);
free_probes(dec->probes);
free_probes(dec->opt_probes);
return SRD_OK;
}
+/**
+ * Load all protocol decoders libsigrokdecode knows about.
+ *
+ * @return SRD_OK upon success, a (negative) error code otherwise.
+ */
SRD_API int srd_load_all_decoders(void)
{
GDir *dir;
}
/**
- * TODO
+ * Unload all loaded protocol decoders.
+ *
+ * @return SRD_OK upon success, a (negative) error code otherwise.
*/
SRD_API int srd_unload_all_decoders(void)
{