Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:59

0001 /* GIO - GLib Input, Output and Streaming Library
0002  * Copyright © 2008 Christian Kellner, Samuel Cormier-Iijima
0003  * Copyright © 2009 Codethink Limited
0004  *
0005  * SPDX-License-Identifier: LGPL-2.1-or-later
0006  *
0007  * This library is free software; you can redistribute it and/or
0008  * modify it under the terms of the GNU Lesser General Public
0009  * License as published by the Free Software Foundation; either
0010  * version 2.1 of the License, or (at your option) any later version.
0011  *
0012  * This library is distributed in the hope that it will be useful,
0013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015  * Lesser General Public License for more details.
0016  *
0017  * You should have received a copy of the GNU Lesser General
0018  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
0019  *
0020  * Authors: Christian Kellner <gicmo@gnome.org>
0021  *          Samuel Cormier-Iijima <sciyoshi@gmail.com>
0022  *          Ryan Lortie <desrt@desrt.ca>
0023  *          Alexander Larsson <alexl@redhat.com>
0024  */
0025 
0026 #ifndef __G_SOCKET_CONNECTION_H__
0027 #define __G_SOCKET_CONNECTION_H__
0028 
0029 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0030 #error "Only <gio/gio.h> can be included directly."
0031 #endif
0032 
0033 #include <glib-object.h>
0034 #include <gio/gsocket.h>
0035 #include <gio/giostream.h>
0036 
0037 G_BEGIN_DECLS
0038 
0039 #define G_TYPE_SOCKET_CONNECTION                            (g_socket_connection_get_type ())
0040 #define G_SOCKET_CONNECTION(inst)                           (G_TYPE_CHECK_INSTANCE_CAST ((inst),                     \
0041                                                              G_TYPE_SOCKET_CONNECTION, GSocketConnection))
0042 #define G_SOCKET_CONNECTION_CLASS(class)                    (G_TYPE_CHECK_CLASS_CAST ((class),                       \
0043                                                              G_TYPE_SOCKET_CONNECTION, GSocketConnectionClass))
0044 #define G_IS_SOCKET_CONNECTION(inst)                        (G_TYPE_CHECK_INSTANCE_TYPE ((inst),                     \
0045                                                              G_TYPE_SOCKET_CONNECTION))
0046 #define G_IS_SOCKET_CONNECTION_CLASS(class)                 (G_TYPE_CHECK_CLASS_TYPE ((class),                       \
0047                                                              G_TYPE_SOCKET_CONNECTION))
0048 #define G_SOCKET_CONNECTION_GET_CLASS(inst)                 (G_TYPE_INSTANCE_GET_CLASS ((inst),                      \
0049                                                              G_TYPE_SOCKET_CONNECTION, GSocketConnectionClass))
0050 
0051 typedef struct _GSocketConnectionPrivate                    GSocketConnectionPrivate;
0052 typedef struct _GSocketConnectionClass                      GSocketConnectionClass;
0053 
0054 struct _GSocketConnectionClass
0055 {
0056   GIOStreamClass parent_class;
0057 
0058   /* Padding for future expansion */
0059   void (*_g_reserved1) (void);
0060   void (*_g_reserved2) (void);
0061   void (*_g_reserved3) (void);
0062   void (*_g_reserved4) (void);
0063   void (*_g_reserved5) (void);
0064   void (*_g_reserved6) (void);
0065 };
0066 
0067 struct _GSocketConnection
0068 {
0069   GIOStream parent_instance;
0070   GSocketConnectionPrivate *priv;
0071 };
0072 
0073 GIO_AVAILABLE_IN_ALL
0074 GType              g_socket_connection_get_type                  (void) G_GNUC_CONST;
0075 
0076 GIO_AVAILABLE_IN_2_32
0077 gboolean           g_socket_connection_is_connected              (GSocketConnection  *connection);
0078 GIO_AVAILABLE_IN_2_32
0079 gboolean           g_socket_connection_connect                   (GSocketConnection  *connection,
0080                                   GSocketAddress     *address,
0081                                   GCancellable       *cancellable,
0082                                   GError            **error);
0083 GIO_AVAILABLE_IN_2_32
0084 void               g_socket_connection_connect_async             (GSocketConnection  *connection,
0085                                   GSocketAddress     *address,
0086                                   GCancellable       *cancellable,
0087                                   GAsyncReadyCallback callback,
0088                                   gpointer            user_data);
0089 GIO_AVAILABLE_IN_2_32
0090 gboolean           g_socket_connection_connect_finish            (GSocketConnection  *connection,
0091                                   GAsyncResult       *result,
0092                                   GError            **error);
0093 
0094 GIO_AVAILABLE_IN_ALL
0095 GSocket           *g_socket_connection_get_socket                (GSocketConnection  *connection);
0096 GIO_AVAILABLE_IN_ALL
0097 GSocketAddress    *g_socket_connection_get_local_address         (GSocketConnection  *connection,
0098                                   GError            **error);
0099 GIO_AVAILABLE_IN_ALL
0100 GSocketAddress    *g_socket_connection_get_remote_address        (GSocketConnection  *connection,
0101                                   GError            **error);
0102 
0103 GIO_AVAILABLE_IN_ALL
0104 void               g_socket_connection_factory_register_type     (GType               g_type,
0105                                   GSocketFamily       family,
0106                                   GSocketType         type,
0107                                   gint                protocol);
0108 GIO_AVAILABLE_IN_ALL
0109 GType              g_socket_connection_factory_lookup_type       (GSocketFamily       family,
0110                                   GSocketType         type,
0111                                   gint                protocol_id);
0112 GIO_AVAILABLE_IN_ALL
0113 GSocketConnection *g_socket_connection_factory_create_connection (GSocket            *socket);
0114 
0115 G_END_DECLS
0116 
0117 #endif /* __G_SOCKET_CONNECTION_H__ */