summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoeren Apel <soeren@apelpie.net>2018-03-17 21:40:36 +0100
committerSoeren Apel <soeren@apelpie.net>2018-03-17 21:40:36 +0100
commit1a41642e2cd8ecfa703c45264c522866b4c99f01 (patch)
tree2250cda3efd503a4d92e76beba2914913b2bec19
parent811167552c54668f6407ac640f8eb47a32980dd8 (diff)
downloadlibsigrokdecode-1a41642e2cd8ecfa703c45264c522866b4c99f01.tar.gz
libsigrokdecode-1a41642e2cd8ecfa703c45264c522866b4c99f01.zip
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.
-rw-r--r--README2
-rw-r--r--configure.ac4
-rw-r--r--libsigrokdecode.h1
-rw-r--r--srd.c5
4 files changed, 9 insertions, 3 deletions
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.
*