From 2f026d1694d6e34b6e2d9d4d61ef5632e6f3251d Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 6 Mar 2006 18:50:15 +0100 Subject: [PATCH] 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 deletion(-) diff --git a/include/wine/library.h b/include/wine/library.h index e92262c3f0b..385256db082 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 9304175bd39..9d5d6eef093 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 ca1080abbb8..9bafe0f9f97 100644 --- a/libs/wine/config.c +++ b/libs/wine/config.c @@ -41,6 +41,7 @@ static const char server_dir_prefix[] = "/server-"; /* prefix for server di 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 *argv0 ) { 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 *argv0 ) } 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 ffd866716db..03883745fbd 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 b2300474695..3a9c72af050 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;