libwine: Export a function to retrieve the data directory (based on a
patch by Dmitry Timoshkov).
diff --git a/include/wine/library.h b/include/wine/library.h
index e92262c..385256d 100644
--- a/include/wine/library.h
+++ b/include/wine/library.h
@@ -30,6 +30,7 @@
/* configuration */
extern const char *wine_get_config_dir(void);
+extern const char *wine_get_data_dir(void);
extern const char *wine_get_server_dir(void);
extern const char *wine_get_user_name(void);
extern void wine_init_argv0_path( const char *argv0 );
diff --git a/libs/wine/Makefile.in b/libs/wine/Makefile.in
index 9304175..9d5d6ee 100644
--- a/libs/wine/Makefile.in
+++ b/libs/wine/Makefile.in
@@ -23,7 +23,9 @@
-DDLLDIR='"$(dlldir)"' \
-DLIB_TO_BINDIR=\"`$(RELPATH) $(libdir) $(bindir)`\" \
-DLIB_TO_DLLDIR=\"`$(RELPATH) $(libdir) $(dlldir)`\" \
- -DBIN_TO_DLLDIR=\"`$(RELPATH) $(bindir) $(dlldir)`\"
+ -DBIN_TO_DLLDIR=\"`$(RELPATH) $(bindir) $(dlldir)`\" \
+ -DLIB_TO_DATADIR=\"`$(RELPATH) $(libdir) $(datadir)/wine`\" \
+ -DBIN_TO_DATADIR=\"`$(RELPATH) $(bindir) $(datadir)/wine`\"
config.o: config.c $(RELPATH)
$(CC) -c $(ALLCFLAGS) -o $@ $(SRCDIR)/config.c $(CONFIGDIRS)
diff --git a/libs/wine/config.c b/libs/wine/config.c
index ca1080a..9bafe0f 100644
--- a/libs/wine/config.c
+++ b/libs/wine/config.c
@@ -41,6 +41,7 @@
static char *bindir;
static char *dlldir;
+static char *datadir;
static char *config_dir;
static char *server_dir;
static char *user_name;
@@ -248,6 +249,7 @@
{
bindir = build_path( libdir, LIB_TO_BINDIR );
dlldir = build_path( libdir, LIB_TO_DLLDIR );
+ datadir = build_path( libdir, LIB_TO_DATADIR );
return;
}
@@ -283,6 +285,7 @@
}
dlldir = build_path( bindir, BIN_TO_DLLDIR );
+ datadir = build_path( bindir, BIN_TO_DATADIR );
}
/* return the configuration directory ($WINEPREFIX or $HOME/.wine) */
@@ -292,6 +295,12 @@
return config_dir;
}
+/* retrieve the wine data dir */
+const char *wine_get_data_dir(void)
+{
+ return datadir;
+}
+
/* return the full name of the server directory (the one containing the socket) */
const char *wine_get_server_dir(void)
{
diff --git a/libs/wine/wine.def b/libs/wine/wine.def
index ffd8667..0388374 100644
--- a/libs/wine/wine.def
+++ b/libs/wine/wine.def
@@ -27,6 +27,7 @@
wine_exec_wine_binary
wine_get_config_dir
wine_get_cs
+ wine_get_data_dir
wine_get_ds
wine_get_es
wine_get_fs
diff --git a/libs/wine/wine.map b/libs/wine/wine.map
index b230047..3a9c72a 100644
--- a/libs/wine/wine.map
+++ b/libs/wine/wine.map
@@ -27,6 +27,7 @@
wine_exec_wine_binary;
wine_get_config_dir;
wine_get_cs;
+ wine_get_data_dir;
wine_get_ds;
wine_get_es;
wine_get_fs;