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  *
0003  * Copyright © 2008 Christian Kellner, Samuel Cormier-Iijima
0004  * Copyright © 2009 Codethink Limited
0005  * Copyright © 2009 Red Hat, Inc
0006  *
0007  * SPDX-License-Identifier: LGPL-2.1-or-later
0008  *
0009  * This library is free software; you can redistribute it and/or
0010  * modify it under the terms of the GNU Lesser General Public
0011  * License as published by the Free Software Foundation; either
0012  * version 2.1 of the License, or (at your option) any later version.
0013  *
0014  * This library is distributed in the hope that it will be useful,
0015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0017  * Lesser General Public License for more details.
0018  *
0019  * You should have received a copy of the GNU Lesser General
0020  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
0021  *
0022  * Authors: Christian Kellner <gicmo@gnome.org>
0023  *          Samuel Cormier-Iijima <sciyoshi@gmail.com>
0024  *          Ryan Lortie <desrt@desrt.ca>
0025  *          Alexander Larsson <alexl@redhat.com>
0026  */
0027 
0028 #ifndef __G_SOCKET_LISTENER_H__
0029 #define __G_SOCKET_LISTENER_H__
0030 
0031 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0032 #error "Only <gio/gio.h> can be included directly."
0033 #endif
0034 
0035 #include <gio/giotypes.h>
0036 
0037 G_BEGIN_DECLS
0038 
0039 #define G_TYPE_SOCKET_LISTENER                              (g_socket_listener_get_type ())
0040 #define G_SOCKET_LISTENER(inst)                             (G_TYPE_CHECK_INSTANCE_CAST ((inst),                     \
0041                                                              G_TYPE_SOCKET_LISTENER, GSocketListener))
0042 #define G_SOCKET_LISTENER_CLASS(class)                      (G_TYPE_CHECK_CLASS_CAST ((class),                       \
0043                                                              G_TYPE_SOCKET_LISTENER, GSocketListenerClass))
0044 #define G_IS_SOCKET_LISTENER(inst)                          (G_TYPE_CHECK_INSTANCE_TYPE ((inst),                     \
0045                                                              G_TYPE_SOCKET_LISTENER))
0046 #define G_IS_SOCKET_LISTENER_CLASS(class)                   (G_TYPE_CHECK_CLASS_TYPE ((class),                       \
0047                                                              G_TYPE_SOCKET_LISTENER))
0048 #define G_SOCKET_LISTENER_GET_CLASS(inst)                   (G_TYPE_INSTANCE_GET_CLASS ((inst),                      \
0049                                                              G_TYPE_SOCKET_LISTENER, GSocketListenerClass))
0050 
0051 typedef struct _GSocketListenerPrivate                      GSocketListenerPrivate;
0052 typedef struct _GSocketListenerClass                        GSocketListenerClass;
0053 
0054 /**
0055  * GSocketListenerClass:
0056  * @changed: virtual method called when the set of socket listened to changes
0057  *
0058  * Class structure for #GSocketListener.
0059  **/
0060 struct _GSocketListenerClass
0061 {
0062   GObjectClass parent_class;
0063 
0064   void (* changed) (GSocketListener *listener);
0065 
0066   void (* event) (GSocketListener      *listener,
0067                   GSocketListenerEvent  event,
0068                   GSocket              *socket);
0069 
0070   /* Padding for future expansion */
0071   void (*_g_reserved2) (void);
0072   void (*_g_reserved3) (void);
0073   void (*_g_reserved4) (void);
0074   void (*_g_reserved5) (void);
0075   void (*_g_reserved6) (void);
0076 };
0077 
0078 struct _GSocketListener
0079 {
0080   GObject parent_instance;
0081   GSocketListenerPrivate *priv;
0082 };
0083 
0084 GIO_AVAILABLE_IN_ALL
0085 GType                   g_socket_listener_get_type                      (void) G_GNUC_CONST;
0086 
0087 GIO_AVAILABLE_IN_ALL
0088 GSocketListener *       g_socket_listener_new                           (void);
0089 
0090 GIO_AVAILABLE_IN_ALL
0091 void                    g_socket_listener_set_backlog                   (GSocketListener     *listener,
0092                                      int                  listen_backlog);
0093 
0094 GIO_AVAILABLE_IN_ALL
0095 gboolean                g_socket_listener_add_socket                    (GSocketListener     *listener,
0096                                                                          GSocket             *socket,
0097                                      GObject             *source_object,
0098                                      GError             **error);
0099 GIO_AVAILABLE_IN_ALL
0100 gboolean                g_socket_listener_add_address                   (GSocketListener     *listener,
0101                                                                          GSocketAddress      *address,
0102                                      GSocketType          type,
0103                                      GSocketProtocol      protocol,
0104                                      GObject             *source_object,
0105                                                                          GSocketAddress     **effective_address,
0106                                      GError             **error);
0107 GIO_AVAILABLE_IN_ALL
0108 gboolean                g_socket_listener_add_inet_port                 (GSocketListener     *listener,
0109                                                                          guint16              port,
0110                                      GObject             *source_object,
0111                                      GError             **error);
0112 GIO_AVAILABLE_IN_ALL
0113 guint16                 g_socket_listener_add_any_inet_port             (GSocketListener     *listener,
0114                                      GObject             *source_object,
0115                                      GError             **error);
0116 
0117 GIO_AVAILABLE_IN_ALL
0118 GSocket *               g_socket_listener_accept_socket                 (GSocketListener      *listener,
0119                                      GObject             **source_object,
0120                                                                          GCancellable         *cancellable,
0121                                                                          GError              **error);
0122 GIO_AVAILABLE_IN_ALL
0123 void                    g_socket_listener_accept_socket_async           (GSocketListener      *listener,
0124                                                                          GCancellable         *cancellable,
0125                                                                          GAsyncReadyCallback   callback,
0126                                                                          gpointer              user_data);
0127 GIO_AVAILABLE_IN_ALL
0128 GSocket *               g_socket_listener_accept_socket_finish          (GSocketListener      *listener,
0129                                                                          GAsyncResult         *result,
0130                                      GObject             **source_object,
0131                                                                          GError              **error);
0132 
0133 
0134 GIO_AVAILABLE_IN_ALL
0135 GSocketConnection *     g_socket_listener_accept                        (GSocketListener      *listener,
0136                                      GObject             **source_object,
0137                                                                          GCancellable         *cancellable,
0138                                                                          GError              **error);
0139 
0140 GIO_AVAILABLE_IN_ALL
0141 void                    g_socket_listener_accept_async                  (GSocketListener      *listener,
0142                                                                          GCancellable         *cancellable,
0143                                                                          GAsyncReadyCallback   callback,
0144                                                                          gpointer              user_data);
0145 
0146 GIO_AVAILABLE_IN_ALL
0147 GSocketConnection *     g_socket_listener_accept_finish                 (GSocketListener      *listener,
0148                                                                          GAsyncResult         *result,
0149                                      GObject             **source_object,
0150                                                                          GError              **error);
0151 
0152 GIO_AVAILABLE_IN_ALL
0153 void                    g_socket_listener_close                         (GSocketListener      *listener);
0154 
0155 G_END_DECLS
0156 
0157 #endif /* __G_SOCKET_LISTENER_H__ */