Debian Codegraph @

proxy/environment/environmentproxy-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 © 2022 Red Hat Inc.
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
22 #include "config.h"
23
24 #include <glib/gi18n-lib.h>
25
26 #include "genvironmentproxyresolver.h"
27 #include "visibility.h"
28
29
30 GLIB_NETWORKING_EXPORT void
31 g_io_environmentproxy_load (GIOModule *module)
32 {
33 gchar *locale_dir;
34 #ifdef G_OS_WIN32
35 gchar *base_dir;
36 #endif
37
38 g_environment_proxy_resolver_register (module);
39
40 #ifdef G_OS_WIN32
41 base_dir = g_win32_get_package_installation_directory_of_module (NULL);
42 locale_dir = g_build_filename (base_dir, "share", "locale", NULL);
43 g_free (base_dir);
44 #else
45 locale_dir = g_strdup (LOCALE_DIR);
46 #endif
47
48 bindtextdomain (GETTEXT_PACKAGE, locale_dir);
49 bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
50 g_free (locale_dir);
51 }
52
53 GLIB_NETWORKING_EXPORT void
54 g_io_environmentproxy_unload (GIOModule *module)
55 {
56 }
57
58 GLIB_NETWORKING_EXPORT gchar **
59 g_io_environmentproxy_query (void)
60 {
61 gchar *eps[] = {
62 G_PROXY_RESOLVER_EXTENSION_POINT_NAME,
63 NULL
64 };
65 return g_strdupv (eps);
66 }