X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=decoder.c;h=a44a86a094ddfc6fa8b615aa3724e3b404e1bd13;hb=aa6506b86e43d332f839ac1d6e0361ef36e9de75;hp=f31202b1937ef5690dae41d8f7e18f713c171c9b;hpb=6a15597a7b3f901b566b7bfc8c484a14e0fb6a11;p=libsigrokdecode.git diff --git a/decoder.c b/decoder.c index f31202b..a44a86a 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. * @@ -60,7 +70,7 @@ extern SRD_PRIV PyObject *mod_sigrokdecode; * * @return List of decoders, NULL if none are supported or loaded. * - * @since 0.1.0 (but the API changed in 0.2.0) + * @since 0.2.0 */ SRD_API const GSList *srd_decoder_list(void) {