From f6527cc4f7625eb5283eee5392312ad5df70e0f3 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Sat, 3 May 2014 23:56:50 +0200 Subject: Move srd_check_init() to decoder.c and make it static. The function srd_check_init() is only used in decoder.c. --- decoder.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'decoder.c') 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. * -- cgit v1.2.3-70-g09d2