X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=decoder.c;h=79ba8ef9db65344118b94a98b5b56299acfbd251;hp=f31202b1937ef5690dae41d8f7e18f713c171c9b;hb=af9527d1776668699a4c1244a419902af47f8493;hpb=6a15597a7b3f901b566b7bfc8c484a14e0fb6a11 diff --git a/decoder.c b/decoder.c index f31202b..79ba8ef 100644 --- a/decoder.c +++ b/decoder.c @@ -40,19 +40,29 @@ /** @cond PRIVATE */ /* The list of protocol decoders. */ -SRD_PRIV GSList *pd_list = NULL; +static GSList *pd_list = NULL; /* srd.c */ 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. *