]> sigrok.org Git - libsigrokdecode.git/blobdiff - srd.c
Factor out bcd2int() into common/srdhelper.
[libsigrokdecode.git] / srd.c
diff --git a/srd.c b/srd.c
index 7b18c9a4dfa2a6ded230005f452a611f0094c4bb..c74d2ded7d5c65d845e2f84858a41f932c1fd158 100644 (file)
--- a/srd.c
+++ b/srd.c
@@ -157,7 +157,7 @@ SRD_API int srd_init(const char *path)
        PyImport_AppendInittab("sigrokdecode", PyInit_sigrokdecode);
 
        /* Initialize the Python interpreter. */
-       Py_Initialize();
+       Py_InitializeEx(0);
 
        /* Locations relative to the XDG system data directories. */
        sys_datadirs = g_get_system_data_dirs();
@@ -169,6 +169,12 @@ SRD_API int srd_init(const char *path)
                }
        }
 #ifdef DECODERS_DIR
+       /* Common modules for use by any decoder. */
+       if ((ret = srd_decoder_searchpath_add(COMMON_DIR)) != SRD_OK) {
+               Py_Finalize();
+               return ret;
+       }
+
        /* Hardcoded decoders install location, if defined. */
        if ((ret = srd_decoder_searchpath_add(DECODERS_DIR)) != SRD_OK) {
                Py_Finalize();