changeset 14272:7635195195c0

[gaim-migrate @ 16957] -Updated the win32dep debug function to correctly match the core function (the core was apparently changed a while ago and this was never updated). -Updated wgaim_read_reg_string() to deal with non-ascii strings correctly, created corresponding wgaim_write_reg_string(). Use these in various places. -Update some win32dep arguments and return values to be correctly marked as having constant values. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Mon, 21 Aug 2006 20:58:20 +0000
parents 9e5c28c3b163
children 2f82c2494f3f
files gtk/plugins/win32/winprefs/winprefs.c gtk/win32/wspell.c libgaim/plugins/log_reader.c libgaim/protocols/Makefile.mingw libgaim/win32/win32dep.c libgaim/win32/win32dep.h
diffstat 6 files changed, 209 insertions(+), 192 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/plugins/win32/winprefs/winprefs.c	Mon Aug 21 17:13:16 2006 +0000
+++ b/gtk/plugins/win32/winprefs/winprefs.c	Mon Aug 21 20:58:20 2006 +0000
@@ -45,6 +45,8 @@
  */
 #define WINPREFS_PLUGIN_ID "gtk-win-prefs"
 
+#define RUNKEY "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"
+
 /*
  *  LOCALS
  */
@@ -209,51 +211,21 @@
 
 }
 
-/* AUTOSTART */
-
-static gboolean open_run_key(PHKEY phKey, REGSAM samDesired) {
-	/* First try current user key (for WinNT & Win2k +), fall back to local machine */
-	if(ERROR_SUCCESS == RegOpenKeyEx(HKEY_CURRENT_USER,
-		"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",
-		0, samDesired, phKey));
-	else if(ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE,
-		"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",
-		0, samDesired, phKey));
-	else {
-		gaim_debug_error(WINPREFS_PLUGIN_ID, "open_run_key: Could not open key for writing value\n");
-		return FALSE;
-	}
-	return TRUE;
-}
-
 /* WIN PREFS GENERAL */
 
 static void
-winprefs_set_autostart(GtkWidget *w)
-{
-	HKEY hKey;
+winprefs_set_autostart(GtkWidget *w) {
+	char *runval = NULL;
 
-	if(!open_run_key(&hKey, KEY_SET_VALUE))
-		return;
-	if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) {
-		char buffer[1024];
-		DWORD size;
+	if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)))
+		runval = g_strdup_printf("%s" G_DIR_SEPARATOR_S "gaim.exe", wgaim_install_dir());
 
-		if((size = GetModuleFileName(gtkwgaim_hinstance(),
-				(LPBYTE) buffer , sizeof(buffer))) == 0) {
-			gaim_debug_error(WINPREFS_PLUGIN_ID, "GetModuleFileName Error. Could not set Gaim autostart.\n");
-			RegCloseKey(hKey);
-			return;
-		}
+	if(!wgaim_write_reg_string(HKEY_CURRENT_USER, RUNKEY, "Gaim", runval)
+		/* For Win98 */
+		&& !wgaim_write_reg_string(HKEY_LOCAL_MACHINE, RUNKEY, "Gaim", runval))
+			gaim_debug_error(WINPREFS_PLUGIN_ID, "Could not set registry key value\n");
 
-		/* Now set value of new key */
-		if(ERROR_SUCCESS != RegSetValueEx(hKey, "Gaim", 0, REG_SZ, buffer, size))
-			gaim_debug_error(WINPREFS_PLUGIN_ID, "Could not set registry key value\n");
-	} else {
-		if(ERROR_SUCCESS != RegDeleteValue(hKey, "Gaim"))
-			gaim_debug_error(WINPREFS_PLUGIN_ID, "Could not delete registry key value\n");
-	}
-	RegCloseKey(hKey);
+	g_free(runval);
 }
 
 static void
@@ -442,8 +414,8 @@
 	GtkWidget *ret;
 	GtkWidget *vbox;
 	GtkWidget *button;
-	char* gtk_version = NULL;
-	HKEY hKey;
+	char *gtk_version = NULL;
+	char *run_key_val;
 
 	ret = gtk_vbox_new(FALSE, 18);
 	gtk_container_set_border_width(GTK_CONTAINER(ret), 12);
@@ -466,11 +438,11 @@
 	vbox = gaim_gtk_make_frame(ret, _("Startup"));
 	button = gtk_check_button_new_with_mnemonic(_("_Start Gaim on Windows startup"));
 	gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
-	if(open_run_key(&hKey, KEY_QUERY_VALUE)) {
-		if(ERROR_SUCCESS == RegQueryValueEx(hKey, "Gaim", 0, NULL, NULL, NULL)) {
-			gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
-		}
-		RegCloseKey(hKey);
+
+	if ((run_key_val = wgaim_read_reg_string(HKEY_CURRENT_USER, RUNKEY, "Gaim"))
+			|| (run_key_val = wgaim_read_reg_string(HKEY_LOCAL_MACHINE, RUNKEY, "Gaim"))) {
+		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
+		g_free(run_key_val);
 	}
 	g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(winprefs_set_autostart), NULL);
 	gtk_widget_show(button);
--- a/gtk/win32/wspell.c	Mon Aug 21 17:13:16 2006 +0000
+++ b/gtk/win32/wspell.c	Mon Aug 21 20:58:20 2006 +0000
@@ -33,7 +33,7 @@
 
 /* GTKSPELL DUMMY FUNCS */
 GtkSpell* wgtkspell_new_attach(GtkTextView *view,
-			       const gchar *lang, 
+			       const gchar *lang,
 			       GError **error) {return NULL;}
 GtkSpell* wgtkspell_get_from_text_view(GtkTextView *view) {return NULL;}
 void      wgtkspell_detach(GtkSpell *spell) {}
@@ -44,7 +44,7 @@
 
 /* GTKSPELL PROTOS */
 GtkSpell*         (*wgaim_gtkspell_new_attach)              (GtkTextView *,
-							     const gchar *, 
+							     const gchar *,
 							     GError **) = wgtkspell_new_attach;
 
 GtkSpell*         (*wgaim_gtkspell_get_from_text_view)      (GtkTextView*) = wgtkspell_get_from_text_view;
@@ -66,75 +66,12 @@
 }
 
 static char* lookup_aspell_path() {
-	char *path = NULL;
 	const char *tmp;
-	HKEY reg_key;
-	DWORD type;
-	DWORD nbytes;
-	gboolean found_reg_key;
-	LPCTSTR subkey = NULL;
 
 	if ((tmp = g_getenv("GAIM_ASPELL_DIR")))
 		return g_strdup(tmp);
 
-	if (G_WIN32_HAVE_WIDECHAR_API ()) {
-		if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Aspell", 0,
-					KEY_QUERY_VALUE,
-					&reg_key) == ERROR_SUCCESS) {
-			subkey = (LPCTSTR) L"Path";
-			if (!(found_reg_key = RegQueryValueExW(reg_key,
-							(WCHAR*) subkey, NULL,
-							&type, NULL, &nbytes
-							) == ERROR_SUCCESS)) {
-				subkey = NULL;
-				found_reg_key = (RegQueryValueExW(reg_key,
-							(WCHAR*) subkey, NULL,
-							&type, NULL, &nbytes
-					     ) == ERROR_SUCCESS);
-			}
-			if (found_reg_key) {
-				wchar_t *wc_temp = g_new (wchar_t, (nbytes + 1) / 2 + 1);
-				RegQueryValueExW(reg_key, (WCHAR*) subkey,
-						NULL, &type, (LPBYTE) wc_temp,
-						&nbytes);
-				wc_temp[nbytes / 2] = '\0';
-				path = g_utf16_to_utf8(
-						wc_temp, -1, NULL, NULL, NULL);
-				g_free (wc_temp);
-			}
-		}
-    	} else {
-		if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Aspell", 0,
-					KEY_QUERY_VALUE, &reg_key
-					) == ERROR_SUCCESS) {
-			subkey = "Path";
-			if (!(found_reg_key = RegQueryValueExA(reg_key, subkey,
-							NULL, &type, NULL,
-							&nbytes
-							) == ERROR_SUCCESS)) {
-				subkey = NULL;
-				found_reg_key = (RegQueryValueExA(reg_key,
-							subkey, NULL, &type,
-							NULL, &nbytes
-							) == ERROR_SUCCESS);
-			}
-			if (found_reg_key) {
-				char *cp_temp = g_malloc (nbytes + 1);
-				RegQueryValueExA(reg_key, subkey, NULL, &type,
-						cp_temp, &nbytes);
-				cp_temp[nbytes] = '\0';
-				path = g_locale_to_utf8(
-						cp_temp, -1, NULL, NULL, NULL);
-				g_free (cp_temp);
-			}
-		}
-	}
-
-	if (reg_key != NULL) {
-		RegCloseKey(reg_key);
-	}
-
-	return path;
+	return wgaim_read_reg_string(HKEY_LOCAL_MACHINE, "Software\\Aspell", "Path");
 }
 
 void wgaim_gtkspell_init() {
--- a/libgaim/plugins/log_reader.c	Mon Aug 21 17:13:16 2006 +0000
+++ b/libgaim/plugins/log_reader.c	Mon Aug 21 20:58:20 2006 +0000
@@ -1577,6 +1577,7 @@
 	char *path;
 #ifdef _WIN32
 	char *folder;
+	gboolean found = FALSE;
 #endif
 
 	g_return_if_fail(plugin != NULL);
@@ -1685,45 +1686,31 @@
 	/* XXX: While a major hack, this is the most reliable way I could
 	 * think of to determine the Trillian installation directory.
 	 */
-	HKEY hKey;
-	char buffer[1024] = "";
-	DWORD size = (sizeof(buffer) - 1);
-	DWORD type;
-	gboolean found = FALSE;
 
 	path = NULL;
-	/* TODO: Test this after removing the trailing "\\". */
-	if(ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, "Trillian.SkinZip\\shell\\Add\\command\\",
-				0, KEY_QUERY_VALUE, &hKey)) {
-
-		if(ERROR_SUCCESS == RegQueryValueEx(hKey, "", NULL, &type, (LPBYTE)buffer, &size)) {
-			char *value = buffer;
-			char *temp;
-
-			/* Ensure the data is null terminated. */
-			value[size] = '\0';
+	if ((folder = wgaim_read_reg_string(HKEY_CLASSES_ROOT, "Trillian.SkinZip\\shell\\Add\\command\\", NULL))) {
+		char *value = folder;
+		char *temp;
 
-			/* Break apart buffer. */
-			if (*value == '"') {
-				value++;
-				temp = value;
-				while (*temp && *temp != '"')
-					temp++;
-			} else {
-				temp = value;
-				while (*temp && *temp != ' ')
-					temp++;
-			}
-			*temp = '\0';
+		/* Break apart buffer. */
+		if (*value == '"') {
+			value++;
+			temp = value;
+			while (*temp && *temp != '"')
+				temp++;
+		} else {
+			temp = value;
+			while (*temp && *temp != ' ')
+				temp++;
+		}
+		*temp = '\0';
 
-			/* Set path. */
-			if (gaim_str_has_suffix(value, "trillian.exe"))
-			{
-				value[strlen(value) - (sizeof("trillian.exe") - 1)] = '\0';
-				path = g_build_filename(value, "users", "default", "talk.ini", NULL);
-			}
+		/* Set path. */
+		if (gaim_str_has_suffix(value, "trillian.exe")) {
+			value[strlen(value) - (sizeof("trillian.exe") - 1)] = '\0';
+			path = g_build_filename(value, "users", "default", "talk.ini", NULL);
 		}
-		RegCloseKey(hKey);
+		g_free(folder);
 	}
 
 	if (!path) {
--- a/libgaim/protocols/Makefile.mingw	Mon Aug 21 17:13:16 2006 +0000
+++ b/libgaim/protocols/Makefile.mingw	Mon Aug 21 20:58:20 2006 +0000
@@ -22,8 +22,6 @@
 SIMPLE = $(GAIM_PROTOS)/simple
 SAMETIME = $(GAIM_PROTOS)/sametime
 
-VERSION := $(shell cat GAIM_TOP/VERSION)
-
 ##
 ## Don't forget to change STATIC_PROTO_INIT, in config.h.mingw if you
 ## change the status of a protocol (static/plugin)
--- a/libgaim/win32/win32dep.c	Mon Aug 21 17:13:16 2006 +0000
+++ b/libgaim/win32/win32dep.c	Mon Aug 21 20:58:20 2006 +0000
@@ -63,15 +63,11 @@
  */
 
 static void wgaim_debug_print(GaimDebugLevel level, const char *category,
-		const char *format, va_list args) {
-	char *str = NULL;
-	if (args != NULL)
-		str = g_strdup_vprintf(format, args);
-	printf("%s%s%s",
-		category ? category : "",
-		category ? ": " : "",
-		str ? str : format);
-	g_free(str);
+		const char *arg_s) {
+	if(category)
+		printf("%s: %s", category, arg_s);
+	else
+		printf(arg_s);
 }
 
 static GaimDebugUiOps ops = {
@@ -86,16 +82,18 @@
    and on being read back have their '\' chars used as an escape char.
    Returns an allocated string which needs to be freed.
 */
-char* wgaim_escape_dirsep(char* filename) {
+char *wgaim_escape_dirsep(const char *filename) {
 	int sepcount = 0;
-	char* ret = NULL;
+	const char *tmp = filename;
+	char *ret;
 	int cnt = 0;
 
-	ret = filename;
-	while(*ret) {
-		if(*ret == '\\')
+	g_return_val_if_fail(filename != NULL, NULL);
+
+	while(*tmp) {
+		if(*tmp == '\\')
 			sepcount++;
-		ret++;
+		tmp++;
 	}
 	ret = g_malloc0(strlen(filename) + sepcount + 1);
 	while(*filename) {
@@ -111,7 +109,7 @@
 
 /* Determine whether the specified dll contains the specified procedure.
    If so, load it (if not already loaded). */
-FARPROC wgaim_find_and_loadproc(char* dllname, char* procedure) {
+FARPROC wgaim_find_and_loadproc(const char *dllname, const char *procedure) {
 	HMODULE hmod;
 	BOOL did_load = FALSE;
 	FARPROC proc = 0;
@@ -182,7 +180,7 @@
 	return retval;
 }
 
-char* wgaim_install_dir(void) {
+const char *wgaim_install_dir(void) {
 	static gboolean initialized = FALSE;
 
 	if (!initialized) {
@@ -219,11 +217,11 @@
 	return install_dir;
 }
 
-char* wgaim_lib_dir(void) {
+const char *wgaim_lib_dir(void) {
 	static gboolean initialized = FALSE;
 
 	if (!initialized) {
-		char *inst_dir = wgaim_install_dir();
+		const char *inst_dir = wgaim_install_dir();
 		if (inst_dir != NULL) {
 			lib_dir = g_strdup_printf("%s" G_DIR_SEPARATOR_S "plugins", inst_dir);
 			initialized = TRUE;
@@ -235,11 +233,11 @@
 	return lib_dir;
 }
 
-char* wgaim_locale_dir(void) {
+const char *wgaim_locale_dir(void) {
 	static gboolean initialized = FALSE;
 
 	if (!initialized) {
-		char *inst_dir = wgaim_install_dir();
+		const char *inst_dir = wgaim_install_dir();
 		if (inst_dir != NULL) {
 			locale_dir = g_strdup_printf("%s" G_DIR_SEPARATOR_S "locale", inst_dir);
 			initialized = TRUE;
@@ -251,7 +249,7 @@
 	return locale_dir;
 }
 
-char* wgaim_data_dir(void) {
+const char *wgaim_data_dir(void) {
 
 	if (!app_data_dir) {
 		/* Set app data dir, used by gaim_home_dir */
@@ -272,18 +270,142 @@
 
 /* Miscellaneous */
 
-gboolean wgaim_read_reg_string(HKEY key, char* sub_key, char* val_name, LPBYTE data, LPDWORD data_len) {
-	HKEY hkey;
-	gboolean ret = FALSE;
+gboolean wgaim_write_reg_string(HKEY rootkey, const char *subkey, const char *valname,
+		const char *value) {
+	HKEY reg_key;
+	gboolean success = FALSE;
+
+	if(G_WIN32_HAVE_WIDECHAR_API()) {
+		wchar_t *wc_subkey = g_utf8_to_utf16(subkey, -1, NULL,
+			NULL, NULL);
+
+		if(RegOpenKeyExW(rootkey, wc_subkey, 0,
+				KEY_SET_VALUE, &reg_key) == ERROR_SUCCESS) {
+			wchar_t *wc_valname = NULL;
+
+			if (valname)
+				wc_valname = g_utf8_to_utf16(valname, -1,
+					NULL, NULL, NULL);
+
+			if(value) {
+				wchar_t *wc_value = g_utf8_to_utf16(value, -1,
+					NULL, NULL, NULL);
+				int len = (wcslen(wc_value) * sizeof(wchar_t)) + 1;
+				if(RegSetValueExW(reg_key, wc_valname, 0, REG_SZ,
+						(LPBYTE)wc_value, len
+						) == ERROR_SUCCESS)
+					success = TRUE;
+				g_free(wc_value);
+			} else
+				if(RegDeleteValueW(reg_key, wc_valname) ==  ERROR_SUCCESS)
+					success = TRUE;
+
+			g_free(wc_valname);
+		}
+		g_free(wc_subkey);
+	} else {
+		char *cp_subkey = g_locale_from_utf8(subkey, -1, NULL,
+			NULL, NULL);
+		if(RegOpenKeyExA(rootkey, cp_subkey, 0,
+				KEY_SET_VALUE, &reg_key) == ERROR_SUCCESS) {
+			char *cp_valname = NULL;
+			if(valname)
+				cp_valname = g_locale_from_utf8(valname, -1,
+					NULL, NULL, NULL);
+
+			if (value) {
+				char *cp_value = g_locale_from_utf8(value, -1,
+					NULL, NULL, NULL);
+				int len = strlen(cp_value) + 1;
+				if(RegSetValueExA(reg_key, cp_valname, 0, REG_SZ,
+						cp_value, len
+						) == ERROR_SUCCESS)
+					success = TRUE;
+				g_free(cp_value);
+			} else
+				if(RegDeleteValueA(reg_key, cp_valname) ==  ERROR_SUCCESS)
+					success = TRUE;
+
+			g_free(cp_valname);
+		}
+		g_free(cp_subkey);
+	}
+
+	if(reg_key != NULL)
+		RegCloseKey(reg_key);
+
+	return success;
+}
 
-	if(ERROR_SUCCESS == RegOpenKeyEx(key, sub_key, 0,  KEY_QUERY_VALUE,
-			&hkey)) {
-		if(ERROR_SUCCESS == RegQueryValueEx(hkey, val_name, 0, NULL,
-				data, data_len))
-			ret = TRUE;
-		RegCloseKey(key);
+char *wgaim_read_reg_string(HKEY rootkey, const char *subkey, const char *valname) {
+
+	DWORD type;
+	DWORD nbytes;
+	HKEY reg_key;
+	char *result = NULL;
+
+	if(G_WIN32_HAVE_WIDECHAR_API()) {
+		wchar_t *wc_subkey = g_utf8_to_utf16(subkey, -1, NULL,
+			NULL, NULL);
+
+		if(RegOpenKeyExW(rootkey, wc_subkey, 0,
+				KEY_QUERY_VALUE, &reg_key) == ERROR_SUCCESS) {
+			wchar_t *wc_valname = NULL;
+			if (valname)
+				wc_valname = g_utf8_to_utf16(valname, -1,
+					NULL, NULL, NULL);
+
+			if(RegQueryValueExW(reg_key, wc_valname, 0, &type,
+					NULL, &nbytes) == ERROR_SUCCESS
+					&& type == REG_SZ) {
+				wchar_t *wc_temp =
+					g_new(wchar_t, ((nbytes + 1) / sizeof(wchar_t)) + 1);
+
+				if(RegQueryValueExW(reg_key, wc_valname, 0,
+						&type, (LPBYTE) wc_temp,
+						&nbytes) == ERROR_SUCCESS) {
+					wc_temp[nbytes / sizeof(wchar_t)] = '\0';
+					result = g_utf16_to_utf8(wc_temp, -1,
+						NULL, NULL, NULL);
+				}
+				g_free(wc_temp);
+			}
+			g_free(wc_valname);
+		}
+		g_free(wc_subkey);
+	} else {
+		char *cp_subkey = g_locale_from_utf8(subkey, -1, NULL,
+			NULL, NULL);
+		if(RegOpenKeyExA(rootkey, cp_subkey, 0,
+				KEY_QUERY_VALUE, &reg_key) == ERROR_SUCCESS) {
+			char *cp_valname = NULL;
+			if(valname)
+				cp_valname = g_locale_from_utf8(valname, -1,
+					NULL, NULL, NULL);
+
+			if(RegQueryValueExA(reg_key, cp_valname, 0, &type,
+					NULL, &nbytes) == ERROR_SUCCESS
+					&& type == REG_SZ) {
+				char *cp_temp = g_malloc(nbytes + 1);
+
+				if(RegQueryValueExA(reg_key, cp_valname, 0,
+						&type, cp_temp,
+						&nbytes) == ERROR_SUCCESS) {
+					cp_temp[nbytes] = '\0';
+					result = g_locale_to_utf8(cp_temp, -1,
+						NULL, NULL, NULL);
+				}
+				g_free (cp_temp);
+			}
+			g_free(cp_valname);
+		}
+		g_free(cp_subkey);
 	}
-	return ret;
+
+	if(reg_key != NULL)
+		RegCloseKey(reg_key);
+
+	return result;
 }
 
 void wgaim_init(void) {
@@ -314,11 +436,11 @@
 	/* Set Environmental Variables */
 	/* Tell perl where to find Gaim's perl modules */
 	perlenv = g_getenv("PERL5LIB");
-	newenv = g_strdup_printf("PERL5LIB=%s%s%s" G_DIR_SEPARATOR_S "perlmod;",
+	newenv = g_strdup_printf("%s%s%s" G_DIR_SEPARATOR_S "perlmod;",
 		perlenv ? perlenv : "",
 		perlenv ? ";" : "",
 		wgaim_install_dir());
-	if (putenv(newenv) < 0)
+	if (!g_setenv("PERL5LIB", newenv, TRUE))
 		gaim_debug(GAIM_DEBUG_WARNING, "wgaim", "putenv failed\n");
 	g_free(newenv);
 
--- a/libgaim/win32/win32dep.h	Mon Aug 21 17:13:16 2006 +0000
+++ b/libgaim/win32/win32dep.h	Mon Aug 21 20:58:20 2006 +0000
@@ -36,20 +36,21 @@
  ** win32dep.c
  **/
 /* Windows helper functions */
-FARPROC   wgaim_find_and_loadproc(char*, char*);
-gboolean  wgaim_read_reg_string(HKEY key, char* sub_key, char* val_name, LPBYTE data, LPDWORD data_len);
-char*     wgaim_escape_dirsep(char*);
+FARPROC wgaim_find_and_loadproc(const char *dllname, const char *procedure);
+char *wgaim_read_reg_string(HKEY rootkey, const char *subkey, const char *valname); /* needs to be g_free'd */
+gboolean wgaim_write_reg_string(HKEY rootkey, const char *subkey, const char *valname, const char *value);
+char *wgaim_escape_dirsep(const char *filename); /* needs to be g_free'd */
 
 /* Determine Gaim paths */
-char*     wgaim_get_special_folder(int folder_type); /* needs to be g_free'd */
-char*     wgaim_install_dir(void);
-char*     wgaim_lib_dir(void);
-char*     wgaim_locale_dir(void);
-char*     wgaim_data_dir(void);
+char *wgaim_get_special_folder(int folder_type); /* needs to be g_free'd */
+const char *wgaim_install_dir(void);
+const char *wgaim_lib_dir(void);
+const char *wgaim_locale_dir(void);
+const char *wgaim_data_dir(void);
 
 /* init / cleanup */
-void      wgaim_init(void);
-void      wgaim_cleanup(void);
+void wgaim_init(void);
+void wgaim_cleanup(void);
 
 
 /*