Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /*
0002  * Copyright 2015 Collabora Ltd.
0003  *
0004  * SPDX-License-Identifier: LGPL-2.1-or-later
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Lesser General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2.1 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Lesser General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Lesser General
0017  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
0018  *
0019  * Authors: Philip Withnall <philip.withnall@collabora.co.uk>
0020  */
0021 
0022 #ifndef __G_DATAGRAM_BASED_H__
0023 #define __G_DATAGRAM_BASED_H__
0024 
0025 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0026 #error "Only <gio/gio.h> can be included directly."
0027 #endif
0028 
0029 #include <gio/giotypes.h>
0030 
0031 G_BEGIN_DECLS
0032 
0033 #define G_TYPE_DATAGRAM_BASED             (g_datagram_based_get_type ())
0034 #define G_DATAGRAM_BASED(inst)            (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
0035                                            G_TYPE_DATAGRAM_BASED, GDatagramBased))
0036 #define G_IS_DATAGRAM_BASED(inst)         (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
0037                                            G_TYPE_DATAGRAM_BASED))
0038 #define G_DATAGRAM_BASED_GET_IFACE(inst)  (G_TYPE_INSTANCE_GET_INTERFACE ((inst), \
0039                                            G_TYPE_DATAGRAM_BASED, \
0040                                            GDatagramBasedInterface))
0041 #define G_TYPE_IS_DATAGRAM_BASED(type)    (g_type_is_a ((type), \
0042                                            G_TYPE_DATAGRAM_BASED))
0043 
0044 typedef struct _GDatagramBasedInterface GDatagramBasedInterface;
0045 
0046 /**
0047  * GDatagramBasedInterface:
0048  * @g_iface: The parent interface.
0049  * @receive_messages: Virtual method for g_datagram_based_receive_messages().
0050  * @send_messages: Virtual method for g_datagram_based_send_messages().
0051  * @create_source: Virtual method for g_datagram_based_create_source().
0052  * @condition_check: Virtual method for g_datagram_based_condition_check().
0053  * @condition_wait: Virtual method for
0054  *   g_datagram_based_condition_wait().
0055  *
0056  * Provides an interface for socket-like objects which have datagram semantics,
0057  * following the Berkeley sockets API. The interface methods are thin wrappers
0058  * around the corresponding virtual methods, and no pre-processing of inputs is
0059  * implemented — so implementations of this API must handle all functionality
0060  * documented in the interface methods.
0061  *
0062  * Since: 2.48
0063  */
0064 struct _GDatagramBasedInterface
0065 {
0066   GTypeInterface g_iface;
0067 
0068   /* Virtual table */
0069   gint          (*receive_messages)     (GDatagramBased       *datagram_based,
0070                                          GInputMessage        *messages,
0071                                          guint                 num_messages,
0072                                          gint                  flags,
0073                                          gint64                timeout,
0074                                          GCancellable         *cancellable,
0075                                          GError              **error);
0076   gint          (*send_messages)        (GDatagramBased       *datagram_based,
0077                                          GOutputMessage       *messages,
0078                                          guint                 num_messages,
0079                                          gint                  flags,
0080                                          gint64                timeout,
0081                                          GCancellable         *cancellable,
0082                                          GError              **error);
0083 
0084   GSource      *(*create_source)        (GDatagramBased       *datagram_based,
0085                                          GIOCondition          condition,
0086                                          GCancellable         *cancellable);
0087   GIOCondition  (*condition_check)      (GDatagramBased       *datagram_based,
0088                                          GIOCondition          condition);
0089   gboolean      (*condition_wait)       (GDatagramBased       *datagram_based,
0090                                          GIOCondition          condition,
0091                                          gint64                timeout,
0092                                          GCancellable         *cancellable,
0093                                          GError              **error);
0094 };
0095 
0096 GIO_AVAILABLE_IN_2_48
0097 GType
0098 g_datagram_based_get_type             (void);
0099 
0100 GIO_AVAILABLE_IN_2_48
0101 gint
0102 g_datagram_based_receive_messages     (GDatagramBased       *datagram_based,
0103                                        GInputMessage        *messages,
0104                                        guint                 num_messages,
0105                                        gint                  flags,
0106                                        gint64                timeout,
0107                                        GCancellable         *cancellable,
0108                                        GError              **error);
0109 
0110 GIO_AVAILABLE_IN_2_48
0111 gint
0112 g_datagram_based_send_messages        (GDatagramBased       *datagram_based,
0113                                        GOutputMessage       *messages,
0114                                        guint                 num_messages,
0115                                        gint                  flags,
0116                                        gint64                timeout,
0117                                        GCancellable         *cancellable,
0118                                        GError              **error);
0119 
0120 GIO_AVAILABLE_IN_2_48
0121 GSource *
0122 g_datagram_based_create_source        (GDatagramBased       *datagram_based,
0123                                        GIOCondition          condition,
0124                                        GCancellable         *cancellable);
0125 GIO_AVAILABLE_IN_2_48
0126 GIOCondition
0127 g_datagram_based_condition_check      (GDatagramBased       *datagram_based,
0128                                        GIOCondition          condition);
0129 GIO_AVAILABLE_IN_2_48
0130 gboolean
0131 g_datagram_based_condition_wait       (GDatagramBased       *datagram_based,
0132                                        GIOCondition          condition,
0133                                        gint64                timeout,
0134                                        GCancellable         *cancellable,
0135                                        GError              **error);
0136 
0137 G_END_DECLS
0138 
0139 #endif /* __G_DATAGRAM_BASED_H__ */