Debian Codegraph @

proxy/libproxy/libproxy-module.c

raw
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3 * GIO - GLib Input, Output and Streaming Library
4 *
5 * Copyright 2010 Collabora, Ltd.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General
18 * Public License along with this library; if not, see
19 * <http://www.gnu.org/licenses/>.
20 *
21 * Author: Nicolas Dufresne <[email protected]>
22 */
23
24 #include "config.h"
25
26 #include <glib/gi18n-lib.h>
27
28 #include "glibproxyresolver.h"
29 #include "visibility.h"
30
31
32 GLIB_NETWORKING_EXPORT void
33 g_io_libproxy_load (GIOModule *module)
34 {
35 gchar *locale_dir;
36 #ifdef G_OS_WIN32
37 gchar *base_dir;
38 #endif
39
40 g_libproxy_resolver_register (module);
41
42 #ifdef G_OS_WIN32
43 base_dir = g_win32_get_package_installation_directory_of_module (NULL);
44 locale_dir = g_build_filename (base_dir, "share", "locale", NULL);
45 g_free (base_dir);
46 #else
47 locale_dir = g_strdup (LOCALE_DIR);
48 #endif
49
50 bindtextdomain (GETTEXT_PACKAGE, locale_dir);
51 bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
52 g_free (locale_dir);
53 }
54
55 GLIB_NETWORKING_EXPORT void
56 g_io_libproxy_unload (GIOModule *module)
57 {
58 }
59
60 GLIB_NETWORKING_EXPORT gchar **
61 g_io_libproxy_query (void)
62 {
63 gchar *eps[] = {
64 G_PROXY_RESOLVER_EXTENSION_POINT_NAME,
65 NULL
66 };
67 return g_strdupv (eps);
68 }