summaryrefslogtreecommitdiff
path: root/srd.c
diff options
context:
space:
mode:
authorBert Vermeulen <bert@biot.com>2013-11-18 01:21:16 +0100
committerBert Vermeulen <bert@biot.com>2013-11-18 01:21:16 +0100
commite195c025c303e361d0cc5a207f9c9443fb8deced (patch)
tree86e05c7d93dc5b77c1510519659763929cc5eee5 /srd.c
parent909fbf4181ab401a371265567505ffa1403f73d6 (diff)
downloadlibsigrokdecode-e195c025c303e361d0cc5a207f9c9443fb8deced.tar.gz
libsigrokdecode-e195c025c303e361d0cc5a207f9c9443fb8deced.zip
Check library initialization before handling decoders
Diffstat (limited to 'srd.c')
-rw-r--r--srd.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/srd.c b/srd.c
index 07d7952..1c7f6f9 100644
--- a/srd.c
+++ b/srd.c
@@ -263,4 +263,14 @@ SRD_PRIV int srd_decoder_searchpath_add(const char *path)
return SRD_OK;
}
+/* @private */
+SRD_PRIV gboolean srd_check_init(void)
+{
+ if (max_session_id < 0) {
+ srd_err("Library is not initialized.");
+ return FALSE;
+ } else
+ return TRUE;
+}
+
/** @} */