Move srd_check_init() to decoder.c and make it static.
authorUwe Hermann <uwe@hermann-uwe.de>
Sat, 3 May 2014 21:56:50 +0000 (23:56 +0200)
committerUwe Hermann <uwe@hermann-uwe.de>
Sat, 3 May 2014 21:56:50 +0000 (23:56 +0200)
The function srd_check_init() is only used in decoder.c.

decoder.c
libsigrokdecode-internal.h
srd.c

index 4b3263846587de3e74dbc17dc9c3184b0a368c18..79ba8ef9db65344118b94a98b5b56299acfbd251 100644 (file)
--- 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.
  *
index 1fe19ca1ae22158d8aa224dcc9bd02010f190bb3..f386cd70c0eeba34e267bca78a2a19a69cd0951c 100644 (file)
@@ -37,7 +37,6 @@ struct srd_session {
 
 /* srd.c */
 SRD_PRIV int srd_decoder_searchpath_add(const char *path);
-SRD_PRIV gboolean srd_check_init(void);
 
 /* session.c */
 SRD_PRIV int session_is_valid(struct srd_session *sess);
diff --git a/srd.c b/srd.c
index 9d04a8e1d110307a221420d40a533f16ae7f83d7..61280ef41d7f4f838472aa2f9ff98ec672305520 100644 (file)
--- a/srd.c
+++ b/srd.c
@@ -261,14 +261,4 @@ 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;
-}
-
 /** @} */