chiark / gitweb /
only autoflush if the message ends with \n
[trains.git] / hostside / multiplex.h
1 /*
2  * multiplexer daemon
3  * declarations
4  */
5
6 #ifndef MULTIPLEX_H
7 #define MULTIPLEX_H
8
9 #include "daemons.h"
10
11 /*---------- from output.c ----------*/
12
13 typedef unsigned long Selector;
14 #include "selectors.h"
15
16 void sovprintf(Selector sel, const char *fmt, va_list al)
17      __attribute__((format(printf,2,0)));
18 void soprintf(Selector sel, const char *fmt, ...)
19      __attribute__((format(printf,2,3)));
20 void sowrite(Selector sel, const char *data, int l);
21
22 void serial_transmit(const PicInsn *pi);
23
24 void output_hex(Selector sel, const char *work,
25                 const Byte *command, int length);
26
27
28
29
30  unredacted
31
32 struct ClientList { Client *head, *tail; };
33 extern struct ClientList clients;
34
35 struct Client {
36   CommandInput ci;
37   Client *back, *next;
38   Selector sel;
39 };
40
41
42
43
44 #endif /*MULTIPLEX_H*/