diff options
author | Bert Vermeulen <bert@biot.com> | 2013-11-18 01:21:16 +0100 |
---|---|---|
committer | Bert Vermeulen <bert@biot.com> | 2013-11-18 01:21:16 +0100 |
commit | e195c025c303e361d0cc5a207f9c9443fb8deced (patch) | |
tree | 86e05c7d93dc5b77c1510519659763929cc5eee5 /srd.c | |
parent | 909fbf4181ab401a371265567505ffa1403f73d6 (diff) | |
download | libsigrokdecode-e195c025c303e361d0cc5a207f9c9443fb8deced.tar.gz libsigrokdecode-e195c025c303e361d0cc5a207f9c9443fb8deced.zip |
Check library initialization before handling decoders
Diffstat (limited to 'srd.c')
-rw-r--r-- | srd.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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; +} + /** @} */ |