chiark / gitweb /
hostside: more length for bavarian
[trains.git] / hostside / daemons.h
index c103cdb0f63beb2cc38d743425b36967ca6f052a..1c1fa0f4d526e19c928b1f1a0375843449c67d4a 100644 (file)
@@ -21,6 +21,7 @@ typedef struct OutBufferChain OutBufferChain;
 typedef void OutBufferError(OutBufferChain*, const char *e1, const char *e2
                            /* on error: both e1 and e2 non-0. say `$e1: $e2'
                             * on eof: both e1 and e2 =0. */);
+typedef void OutBufferEmpty(OutBufferChain*);
 
 typedef void CopyCallBack(char *m, size_t l, void *u);
 
@@ -30,8 +31,11 @@ struct OutBufferChain {
   int fd;
   int limit; /* 0 means obc_init will set a default */
   OutBufferError *error;
+  OutBufferEmpty *empty; /* may be 0 */
+  /* set/used by obc_... but may be read by user */
+  int total; /* amount buffered */
   /* set/used by obc_..., oprintf, etc., only */
-  int done_of_head, total;
+  int done_of_head; /* -1 = empty and fileevent not registered with liboop */
   struct { OutBuffer *head, *tail; } obs;
 };