summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2002-12-13 21:31:38 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2002-12-13 21:31:38 +0000
commitd5bc7fc752fa5dad088c017890d1d600ca5c026d (patch)
tree4ecd885f0b194d17e9014452cfd47502bcdaec39
parenta648ff82354a93235dbf1a2d9d0264a8c3538692 (diff)
downloadxine-lib-d5bc7fc752fa5dad088c017890d1d600ca5c026d.tar.gz
xine-lib-d5bc7fc752fa5dad088c017890d1d600ca5c026d.tar.bz2
create ~/.xine if it doesn't exist for plugin catalog
CVS patchset: 3514 CVS date: 2002/12/13 21:31:38
-rw-r--r--src/xine-engine/load_plugins.c15
-rw-r--r--src/xine-engine/plugin_catalog.h3
2 files changed, 14 insertions, 4 deletions
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c
index 6eefa974a..8a079e4c5 100644
--- a/src/xine-engine/load_plugins.c
+++ b/src/xine-engine/load_plugins.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: load_plugins.c,v 1.120 2002/12/13 19:01:42 miguelfreitas Exp $
+ * $Id: load_plugins.c,v 1.121 2002/12/13 21:31:38 guenter Exp $
*
*
* Load input/demux/audio_out/video_out/codec plugins
@@ -669,14 +669,23 @@ static void load_plugin_list(FILE *fp, xine_list_t *plugins) {
*/
static void save_catalog (xine_t *this) {
- FILE *fp;
- char *cachefile;
+ FILE *fp;
+ char *cachefile, *dirfile;
const char *relname = CACHE_CATALOG_FILE;
+ const char *dirname = CACHE_CATALOG_DIR;
cachefile = (char *) xine_xmalloc(strlen(xine_get_homedir()) +
strlen(relname) + 3);
sprintf(cachefile, "%s/%s", xine_get_homedir(), relname);
+ /* make sure homedir (~/.xine) exists */
+ dirfile = (char *) xine_xmalloc(strlen(xine_get_homedir()) +
+ strlen(dirname) + 3);
+ sprintf(dirfile, "%s/%s", xine_get_homedir(), dirname);
+ mkdir (dirfile, 0755);
+ printf ("\n\nsave_catalog: %s created\n", dirfile);
+ free (dirfile);
+
if( (fp = fopen(cachefile,"w")) != NULL ) {
fprintf(fp, "# this file is automatically created by xine, do not edit.\n\n");
diff --git a/src/xine-engine/plugin_catalog.h b/src/xine-engine/plugin_catalog.h
index 1aedd6c70..f30c72140 100644
--- a/src/xine-engine/plugin_catalog.h
+++ b/src/xine-engine/plugin_catalog.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: plugin_catalog.h,v 1.8 2002/12/08 20:53:02 miguelfreitas Exp $
+ * $Id: plugin_catalog.h,v 1.9 2002/12/13 21:31:38 guenter Exp $
*
* xine-internal header: Definitions for plugin lists
*
@@ -37,6 +37,7 @@
#define CACHE_CATALOG_VERSION 0
#define CACHE_CATALOG_FILE ".xine/catalog.cache"
+#define CACHE_CATALOG_DIR ".xine"
typedef struct {
char *filename;