Module: wine Branch: refs/heads/master Commit: 2f026d1694d6e34b6e2d9d4d61ef5632e6f3251d URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=2f026d1694d6e34b6e2d9d4d...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Mar 6 18:50:15 2006 +0100
libwine: Export a function to retrieve the data directory (based on a patch by Dmitry Timoshkov).
---
include/wine/library.h | 1 + libs/wine/Makefile.in | 4 +++- libs/wine/config.c | 9 +++++++++ libs/wine/wine.def | 1 + libs/wine/wine.map | 1 + 5 files changed, 15 insertions(+), 1 deletions(-)
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 @@ CONFIGDIRS = \ -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 const char server_dir_prefix[] =
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 @@ void wine_init_argv0_path( const char *a { 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 @@ void wine_init_argv0_path( const char *a }
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 @@ const char *wine_get_config_dir(void) 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 @@ EXPORTS 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_1.0 wine_exec_wine_binary; wine_get_config_dir; wine_get_cs; + wine_get_data_dir; wine_get_ds; wine_get_es; wine_get_fs;