]> sigrok.org Git - libsigrokdecode.git/blobdiff - decode.c
Don't expose libsigrokdecode's interal GSList.
[libsigrokdecode.git] / decode.c
index 536be2c347315c4ac941d0490d5c307b17ab8733..7125d32f44f9b63c6709d4ebe0fd5508814f14ce 100644 (file)
--- a/decode.c
+++ b/decode.c
@@ -31,7 +31,7 @@
 #endif
 
 /* The list of protocol decoders. */
-GSList *list_pds;
+GSList *list_pds = NULL;
 
 /**
  * Initialize libsigrokdecode.
@@ -70,6 +70,18 @@ int sigrokdecode_init(void)
        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.
  *