1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright © 2009 Codethink Limited
5 * SPDX-License-Identifier: LGPL-2.1-or-later
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.
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.
17 * You should have received a copy of the GNU Lesser General
18 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
20 * Authors: Ryan Lortie <desrt@desrt.ca>
23 #ifndef __G_UNIX_CONNECTION_H__
24 #define __G_UNIX_CONNECTION_H__
30 #define G_TYPE_UNIX_CONNECTION (g_unix_connection_get_type ())
31 #define G_UNIX_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
32 G_TYPE_UNIX_CONNECTION, GUnixConnection))
33 #define G_UNIX_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
34 G_TYPE_UNIX_CONNECTION, GUnixConnectionClass))
35 #define G_IS_UNIX_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
36 G_TYPE_UNIX_CONNECTION))
37 #define G_IS_UNIX_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
38 G_TYPE_UNIX_CONNECTION))
39 #define G_UNIX_CONNECTION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
40 G_TYPE_UNIX_CONNECTION, GUnixConnectionClass))
42 typedef struct _GUnixConnection GUnixConnection;
43 typedef struct _GUnixConnectionPrivate GUnixConnectionPrivate;
44 typedef struct _GUnixConnectionClass GUnixConnectionClass;
46 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GUnixConnection, g_object_unref)
48 struct _GUnixConnectionClass
50 GSocketConnectionClass parent_class;
53 struct _GUnixConnection
55 GSocketConnection parent_instance;
56 GUnixConnectionPrivate *priv;
60 GType g_unix_connection_get_type (void);
63 gboolean g_unix_connection_send_fd (GUnixConnection *connection,
65 GCancellable *cancellable,
68 gint g_unix_connection_receive_fd (GUnixConnection *connection,
69 GCancellable *cancellable,
73 gboolean g_unix_connection_send_credentials (GUnixConnection *connection,
74 GCancellable *cancellable,
77 void g_unix_connection_send_credentials_async (GUnixConnection *connection,
78 GCancellable *cancellable,
79 GAsyncReadyCallback callback,
82 gboolean g_unix_connection_send_credentials_finish (GUnixConnection *connection,
87 GCredentials *g_unix_connection_receive_credentials (GUnixConnection *connection,
88 GCancellable *cancellable,
91 void g_unix_connection_receive_credentials_async (GUnixConnection *connection,
92 GCancellable *cancellable,
93 GAsyncReadyCallback callback,
96 GCredentials *g_unix_connection_receive_credentials_finish (GUnixConnection *connection,
102 #endif /* __G_UNIX_CONNECTION_H__ */