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 program is free software; you can redistribute it and/or
10 * modify it under the terms of version 2 of the GNU Lesser General Public
11 * License as published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
31 #include <glib/gstdio.h>
35 G_LOCK_DEFINE_STATIC (mutex);
37 /* localedir uses system codepage as it is passed to the non-UTF8ified
40 static const gchar *localedir = NULL;
42 /* The others are in UTF-8 */
43 static const gchar *libexecdir;
44 static const gchar *providerdir;
46 /* XXX Where do these get defined? e-data-server-util.h just has
47 * declarations for e_util_get_prefix() and e_util_get_cp_prefix(). */
48 static const gchar * get_prefix (void) G_GNUC_CONST;
49 static const gchar * get_cp_prefix (void) G_GNUC_CONST;
52 replace_prefix (const gchar *configure_time_prefix,
53 const gchar *runtime_prefix,
54 const gchar *configure_time_path)
56 gchar *c_t_prefix_slash;
59 c_t_prefix_slash = g_strconcat (configure_time_prefix, "/", NULL);
61 if (runtime_prefix != NULL &&
62 g_str_has_prefix (configure_time_path, c_t_prefix_slash)) {
63 retval = g_strconcat (
65 configure_time_path + strlen (configure_time_prefix),
68 retval = g_strdup (configure_time_path);
70 g_free (c_t_prefix_slash);
80 if (localedir != NULL) {
85 localedir = replace_prefix (
86 E_DATA_SERVER_PREFIX, get_cp_prefix (), LOCALEDIR);
87 libexecdir = replace_prefix (
88 E_DATA_SERVER_PREFIX, get_prefix (), CAMEL_LIBEXECDIR);
89 providerdir = replace_prefix (
90 E_DATA_SERVER_PREFIX, get_prefix (), CAMEL_PROVIDERDIR);
95 #include "camel-win32.h" /* For prototypes */
97 #define GETTER(varbl) \
99 _camel_get_##varbl (void) \