summaryrefslogtreecommitdiff
path: root/decoder.c
diff options
context:
space:
mode:
Diffstat (limited to 'decoder.c')
-rw-r--r--decoder.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/decoder.c b/decoder.c
index 4b32638..79ba8ef 100644
--- a/decoder.c
+++ b/decoder.c
@@ -47,12 +47,22 @@ extern GSList *searchpaths;
/* session.c */
extern GSList *sessions;
+extern 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.
*