Added SILC Thread Queue API
[crypto.git] / apps / irssi / src / core / net-sendbuffer.h
index bb6d8e07f07e6f4e8b370c3deae36d81b06f2e8c..f492821e66ac0c394b0f8e79ff1be700dc6fc7fb 100644 (file)
@@ -3,6 +3,15 @@
 
 #define DEFAULT_BUFFER_SIZE 8192
 
+struct _NET_SENDBUF_REC {
+        GIOChannel *handle;
+
+        int send_tag;
+        int bufsize;
+        int bufpos;
+        char *buffer; /* Buffer is NULL until it's actually needed. */
+};
+
 /* Create new buffer - if `bufsize' is zero or less, DEFAULT_BUFFER_SIZE
    is used */
 NET_SENDBUF_REC *net_sendbuffer_create(GIOChannel *handle, int bufsize);
@@ -14,6 +23,9 @@ void net_sendbuffer_destroy(NET_SENDBUF_REC *rec, int close);
    occured. */
 int net_sendbuffer_send(NET_SENDBUF_REC *rec, const void *data, int size);
 
+/* Flush the buffer, blocks until finished. */
+void net_sendbuffer_flush(NET_SENDBUF_REC *rec);
+
 /* Returns the socket handle */
 GIOChannel *net_sendbuffer_handle(NET_SENDBUF_REC *rec);