Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
gproxy.h
Go to the documentation of this file.
1/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2
3/* GIO - GLib Input, Output and Streaming Library
4 *
5 * Copyright (C) 2010 Collabora Ltd.
6 *
7 * SPDX-License-Identifier: LGPL-2.1-or-later
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General
20 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
21 *
22 * Author: Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>
23 */
24
25#ifndef __G_PROXY_H__
26#define __G_PROXY_H__
27
28#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
29#error "Only <gio/gio.h> can be included directly."
30#endif
31
32#include <gio/giotypes.h>
33
35
36#define G_TYPE_PROXY (g_proxy_get_type ())
37#define G_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_PROXY, GProxy))
38#define G_IS_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_PROXY))
39#define G_PROXY_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_PROXY, GProxyInterface))
40
41/**
42 * G_PROXY_EXTENSION_POINT_NAME:
43 *
44 * Extension point for proxy functionality.
45 * See [Extending GIO][extending-gio].
46 *
47 * Since: 2.26
48 */
49#define G_PROXY_EXTENSION_POINT_NAME "gio-proxy"
50
52
53/**
54 * GProxyInterface:
55 * @g_iface: The parent interface.
56 * @connect: Connect to proxy server and wrap (if required) the #connection
57 * to handle payload.
58 * @connect_async: Same as connect() but asynchronous.
59 * @connect_finish: Returns the result of connect_async()
60 * @supports_hostname: Returns whether the proxy supports hostname lookups.
61 *
62 * Provides an interface for handling proxy connection and payload.
63 *
64 * Since: 2.26
65 */
67{
69
70 /* Virtual Table */
71
72 GIOStream * (* connect) (GProxy *proxy,
73 GIOStream *connection,
74 GProxyAddress *proxy_address,
75 GCancellable *cancellable,
76 GError **error);
77
78 void (* connect_async) (GProxy *proxy,
79 GIOStream *connection,
80 GProxyAddress *proxy_address,
81 GCancellable *cancellable,
82 GAsyncReadyCallback callback,
83 gpointer user_data);
84
85 GIOStream * (* connect_finish) (GProxy *proxy,
86 GAsyncResult *result,
87 GError **error);
88
90};
91
94
97
100 GIOStream *connection,
101 GProxyAddress *proxy_address,
102 GCancellable *cancellable,
103 GError **error);
104
107 GIOStream *connection,
108 GProxyAddress *proxy_address,
109 GCancellable *cancellable,
110 GAsyncReadyCallback callback,
111 gpointer user_data);
112
115 GAsyncResult *result,
116 GError **error);
117
120
122
123#endif /* __G_PROXY_H__ */
#define GIO_AVAILABLE_IN_ALL
struct _GAsyncResult GAsyncResult
Definition giotypes.h:36
struct _GProxy GProxy
Definition giotypes.h:164
void(* GAsyncReadyCallback)(GObject *source_object, GAsyncResult *res, gpointer data)
Definition giotypes.h:190
#define G_END_DECLS
Definition gmacros.h:910
#define G_BEGIN_DECLS
Definition gmacros.h:909
#define G_GNUC_CONST
Definition gmacros.h:637
GIO_AVAILABLE_IN_ALL GType g_proxy_get_type(void) G_GNUC_CONST
GIO_AVAILABLE_IN_ALL gboolean g_proxy_supports_hostname(GProxy *proxy)
GIO_AVAILABLE_IN_ALL GProxy * g_proxy_get_default_for_protocol(const gchar *protocol)
GIO_AVAILABLE_IN_ALL GIOStream * g_proxy_connect_finish(GProxy *proxy, GAsyncResult *result, GError **error)
GIO_AVAILABLE_IN_ALL void g_proxy_connect_async(GProxy *proxy, GIOStream *connection, GProxyAddress *proxy_address, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
GIO_AVAILABLE_IN_ALL GIOStream * g_proxy_connect(GProxy *proxy, GIOStream *connection, GProxyAddress *proxy_address, GCancellable *cancellable, GError **error)
gsize GType
Definition gtype.h:427
gint gboolean
Definition gtypes.h:56
G_BEGIN_DECLS typedef char gchar
Definition gtypes.h:52
void * gpointer
Definition gtypes.h:109
static void error(LoadState *S, const char *why)
gboolean(* supports_hostname)(GProxy *proxy)
Definition gproxy.h:89
void(* connect_async)(GProxy *proxy, GIOStream *connection, GProxyAddress *proxy_address, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
Definition gproxy.h:78
GTypeInterface g_iface
Definition gproxy.h:68