#endif
/* The list of protocol decoders. */
-GSList *list_pds;
+GSList *list_pds = NULL;
/**
* Initialize libsigrokdecode.
return SIGROKDECODE_OK;
}
+/**
+ * Returns the list of supported/loaded protocol decoders.
+ *
+ * This is a GSList containing the names of the decoders as strings.
+ *
+ * @return List of decoders, NULL if none are supported or loaded.
+ */
+GSList *sigrokdecode_list_decoders(void)
+{
+ return list_pds;
+}
+
/**
* Helper function to handle Python strings.
*
#define SIGROKDECODE_ERR_PYTHON -4 /* Python C API error */
#define SIGROKDECODE_ERR_DECODERS_DIR -5 /* Protocol decoder path invalid */
-/* The list of loaded protocol decoders. */
-GSList *list_pds;
-
/* TODO: Documentation. */
struct sigrokdecode_decoder {
char *id;
};
int sigrokdecode_init(void);
+GSList *sigrokdecode_list_decoders(void);
int sigrokdecode_load_decoder(const char *name, struct sigrokdecode_decoder **dec);
int sigrokdecode_run_decoder(struct sigrokdecode_decoder *dec,
uint8_t *inbuf, uint64_t inbuflen,