[Telepathy-commits] [telepathy-gabble/master] add gabble_bytestream_iface_block_read as an optionnal abstract method

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Mon Dec 15 07:54:05 PST 2008


---
 src/bytestream-iface.c |   11 +++++++++++
 src/bytestream-iface.h |    4 ++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/bytestream-iface.c b/src/bytestream-iface.c
index 72e0381..b589f4c 100644
--- a/src/bytestream-iface.c
+++ b/src/bytestream-iface.c
@@ -136,6 +136,17 @@ gabble_bytestream_iface_base_init (gpointer klass)
     }
 }
 
+void
+gabble_bytestream_iface_block_read (GabbleBytestreamIface *self,
+                                    gboolean block)
+{
+  void (*virtual_method)(GabbleBytestreamIface *, gboolean) =
+    GABBLE_BYTESTREAM_IFACE_GET_CLASS (self)->block_read;
+  if (virtual_method != NULL)
+    virtual_method (self, block);
+  /* else: do nothing. Some bytestreams like IBB can't implement read_block. */
+}
+
 GType
 gabble_bytestream_iface_get_type (void)
 {
diff --git a/src/bytestream-iface.h b/src/bytestream-iface.h
index 72c86c1..2346bd6 100644
--- a/src/bytestream-iface.h
+++ b/src/bytestream-iface.h
@@ -56,6 +56,7 @@ struct _GabbleBytestreamIfaceClass {
   void (*close) (GabbleBytestreamIface *bytestream, GError *error);
   void (*accept) (GabbleBytestreamIface *bytestream,
       GabbleBytestreamAugmentSiAcceptReply func, gpointer user_data);
+  void (*block_read) (GabbleBytestreamIface *bytestream, gboolean block);
 };
 
 GType gabble_bytestream_iface_get_type (void);
@@ -83,6 +84,9 @@ void gabble_bytestream_iface_close (GabbleBytestreamIface *bytestream,
 void gabble_bytestream_iface_accept (GabbleBytestreamIface *bytestream,
     GabbleBytestreamAugmentSiAcceptReply func, gpointer user_data);
 
+void gabble_bytestream_iface_block_read (GabbleBytestreamIface *bytestream,
+    gboolean block);
+
 G_END_DECLS
 
 #endif /* #ifndef __GABBLE_BYTESTREAM_IFACE_H__ */
-- 
1.5.6.5




More information about the Telepathy-commits mailing list