]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoder.c
README: Document python3-coverage requirement for tests.
[libsigrokdecode.git] / decoder.c
index 4b3263846587de3e74dbc17dc9c3184b0a368c18..ff6e7ac2746917476593c883c5b62b3473f23739 100644 (file)
--- a/decoder.c
+++ b/decoder.c
 static GSList *pd_list = NULL;
 
 /* srd.c */
-extern GSList *searchpaths;
+extern SRD_PRIV GSList *searchpaths;
 
 /* session.c */
-extern GSList *sessions;
+extern SRD_PRIV GSList *sessions;
+extern SRD_PRIV int max_session_id;
 
 /* module_sigrokdecode.c */
 extern SRD_PRIV PyObject *mod_sigrokdecode;
 
 /** @endcond */
 
+static gboolean srd_check_init(void)
+{
+       if (max_session_id < 0) {
+               srd_err("Library is not initialized.");
+               return FALSE;
+       } else
+               return TRUE;
+}
+
 /**
  * Returns the list of supported/loaded protocol decoders.
  *
@@ -60,7 +70,7 @@ extern SRD_PRIV PyObject *mod_sigrokdecode;
  *
  * @return List of decoders, NULL if none are supported or loaded.
  *
- * @since 0.1.0 (but the API changed in 0.2.0)
+ * @since 0.2.0
  */
 SRD_API const GSList *srd_decoder_list(void)
 {