1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-win32.c : Win32-specific bits */
5 * Authors: Tor Lillqvist <tml@novell.com>
7 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
9 * This library is free software you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation.
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, see <http://www.gnu.org/licenses/>.
29 #include <glib/gstdio.h>
33 G_LOCK_DEFINE_STATIC (mutex);
35 /* localedir uses system codepage as it is passed to the non-UTF8ified
38 static const gchar *localedir = NULL;
40 /* The others are in UTF-8 */
41 static const gchar *libexecdir;
42 static const gchar *providerdir;
44 /* XXX Where do these get defined? e-data-server-util.h just has
45 * declarations for e_util_get_prefix() and e_util_get_cp_prefix(). */
46 static const gchar * get_prefix (void) G_GNUC_CONST;
47 static const gchar * get_cp_prefix (void) G_GNUC_CONST;
50 replace_prefix (const gchar *configure_time_prefix,
51 const gchar *runtime_prefix,
52 const gchar *configure_time_path)
54 gchar *c_t_prefix_slash;
57 c_t_prefix_slash = g_strconcat (configure_time_prefix, "/", NULL);
59 if (runtime_prefix != NULL &&
60 g_str_has_prefix (configure_time_path, c_t_prefix_slash)) {
61 retval = g_strconcat (
63 configure_time_path + strlen (configure_time_prefix),
66 retval = g_strdup (configure_time_path);
68 g_free (c_t_prefix_slash);
78 if (localedir != NULL) {
83 localedir = replace_prefix (
84 E_DATA_SERVER_PREFIX, get_cp_prefix (), LOCALEDIR);
85 libexecdir = replace_prefix (
86 E_DATA_SERVER_PREFIX, get_prefix (), CAMEL_LIBEXECDIR);
87 providerdir = replace_prefix (
88 E_DATA_SERVER_PREFIX, get_prefix (), CAMEL_PROVIDERDIR);
93 #include "camel-win32.h" /* For prototypes */
95 #define GETTER(varbl) \
97 _camel_get_##varbl (void) \