From 991e42bc4ba79802c572e8722458a81826d8b0dc Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sat, 16 Feb 2002 17:53:58 +0000 Subject: [PATCH] add 'toolsdir' to the pc files add our first plugin test, which involves simply running gst-compprep, which in the co... Original commit message from CVS: * add 'toolsdir' to the pc files * add our first plugin test, which involves simply running gst-compprep, which in the course of creating the completion registry instantiates every plugin. gst-register is run first. --- gstreamer-uninstalled.pc.in | 10 ++++++---- gstreamer.pc.in | 1 + tools/gst-complete.c | 13 +++++++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/gstreamer-uninstalled.pc.in b/gstreamer-uninstalled.pc.in index 0f62bd728a..30f674b7fd 100644 --- a/gstreamer-uninstalled.pc.in +++ b/gstreamer-uninstalled.pc.in @@ -1,7 +1,9 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ +# the standard variables don't make sense for an uninstalled copy +prefix= +exec_prefix= +libdir= +includedir= +toolsdir=${pcfiledir}/tools Name: GStreamer Uninstalled Description: Streaming-media framework, Not Installed diff --git a/gstreamer.pc.in b/gstreamer.pc.in index b31d9c59da..5f013622b0 100644 --- a/gstreamer.pc.in +++ b/gstreamer.pc.in @@ -2,6 +2,7 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ +toolsdir=${exec_prefix}/bin Name: GStreamer Description: Streaming-media framework diff --git a/tools/gst-complete.c b/tools/gst-complete.c index fbae2713de..a21a3bc02c 100644 --- a/tools/gst-complete.c +++ b/tools/gst-complete.c @@ -1,5 +1,6 @@ #include #include +#include #include @@ -58,7 +59,7 @@ int main(int argc,char *argv[]) { gchar *prev_word = argv[3]; gchar *partial_word = argv[2]; - int partial_len = strlen(partial_word); + int partial_len; GList *elements; GSList *pads; int num_pads; @@ -66,9 +67,17 @@ int main(int argc,char *argv[]) { gchar *word; GSList *words = NULL; + struct stat stat_buf; + + partial_len = strlen(partial_word); + /***** Loading the completion information from the registry *****/ - doc = xmlParseFile (GST_CONFIG_DIR "/compreg.xml"); + if (stat (GST_CONFIG_DIR"/compreg.xml", &stat_buf) == 0) { + doc = xmlParseFile (GST_CONFIG_DIR"/compreg.xml"); + } else { + exit (1); + } rootnode = doc->xmlRootNode; elementnode = rootnode->xmlChildrenNode;