mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-31 05:14:11 +02:00
gio: more implementations of GFileDescriptorBased
Implement GFileDescriptorBased in GSocket{Input,Output}Stream and GUnix{Input,Output}Stream. https://bugzilla.gnome.org/show_bug.cgi?id=616852
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include "gunixinputstream.h"
|
||||
#include "gcancellable.h"
|
||||
#include "gasynchelper.h"
|
||||
#include "gfiledescriptorbased.h"
|
||||
#include "glibintl.h"
|
||||
|
||||
|
||||
@@ -61,11 +62,14 @@ enum {
|
||||
};
|
||||
|
||||
static void g_unix_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface);
|
||||
static void g_unix_input_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GUnixInputStream, g_unix_input_stream, G_TYPE_INPUT_STREAM,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_POLLABLE_INPUT_STREAM,
|
||||
g_unix_input_stream_pollable_iface_init)
|
||||
);
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_FILE_DESCRIPTOR_BASED,
|
||||
g_unix_input_stream_file_descriptor_based_iface_init)
|
||||
)
|
||||
|
||||
struct _GUnixInputStreamPrivate {
|
||||
int fd;
|
||||
@@ -189,6 +193,12 @@ g_unix_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface)
|
||||
iface->create_source = g_unix_input_stream_pollable_create_source;
|
||||
}
|
||||
|
||||
static void
|
||||
g_unix_input_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface)
|
||||
{
|
||||
iface->get_fd = (int (*) (GFileDescriptorBased *))g_unix_input_stream_get_fd;
|
||||
}
|
||||
|
||||
static void
|
||||
g_unix_input_stream_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
|
Reference in New Issue
Block a user