From: Soeren Apel Date: Sat, 17 Mar 2018 20:40:36 +0000 (+0100) Subject: Fix part of #1128 by adding a way to retrieve PD search paths X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=1a41642e2cd8ecfa703c45264c522866b4c99f01;p=libsigrokdecode.git Fix part of #1128 by adding a way to retrieve PD search paths As this uses g_slist_copy_deep(), we now require glib 2.34. --- diff --git a/README b/README index 686efef..784be27 100644 --- a/README +++ b/README @@ -34,7 +34,7 @@ Requirements - automake >= 1.11 (only needed when building from git) - libtool (only needed when building from git) - pkg-config >= 0.22 - - libglib >= 2.28.0 + - libglib >= 2.34 - Python >= 3.2 - check >= 0.9.4 (optional, only needed to run unit tests) - doxygen (optional, only needed for the C API docs) diff --git a/configure.ac b/configure.ac index d03f983..5593bc4 100644 --- a/configure.ac +++ b/configure.ac @@ -137,7 +137,7 @@ AC_SUBST([SRD_PKGLIBS]) # Retrieve the compile and link flags for all modules combined. # Also, bail out at this point if any module dependency is not met. -PKG_CHECK_MODULES([LIBSIGROKDECODE], [glib-2.0 >= 2.28.0 $SRD_PKGLIBS]) +PKG_CHECK_MODULES([LIBSIGROKDECODE], [glib-2.0 >= 2.34 $SRD_PKGLIBS]) PKG_CHECK_MODULES([TESTS], [$SRD_PKGLIBS_TESTS glib-2.0 $SRD_PKGLIBS]) srd_glib_version=`$PKG_CONFIG --modversion glib-2.0 2>&AS_MESSAGE_LOG_FD` @@ -168,7 +168,7 @@ Compile configuration: - Linker flags.................... $LDFLAGS Detected libraries (required): - - glib-2.0 >= 2.28.0.............. $srd_glib_version + - glib-2.0 >= 2.34................ $srd_glib_version $srd_pkglibs_summary Detected libraries (optional): $srd_pkglibs_opt_summary diff --git a/libsigrokdecode.h b/libsigrokdecode.h index d37c432..982ae19 100644 --- a/libsigrokdecode.h +++ b/libsigrokdecode.h @@ -320,6 +320,7 @@ struct srd_pd_callback { /* srd.c */ SRD_API int srd_init(const char *path); SRD_API int srd_exit(void); +SRD_API GSList *srd_searchpaths_get(void); /* session.c */ SRD_API int srd_session_new(struct srd_session **sess); diff --git a/srd.c b/srd.c index 2c1bdda..68a6a23 100644 --- a/srd.c +++ b/srd.c @@ -179,6 +179,11 @@ err: return SRD_ERR_PYTHON; } +SRD_API GSList *srd_searchpaths_get(void) +{ + return g_slist_copy_deep(searchpaths, (GCopyFunc)g_strdup, NULL); +} + /** * Initialize libsigrokdecode. *