1 #ifndef CCAN_OSERVER_TYPES_H
2 #define CCAN_OSERVER_TYPES_H
4 #include <ccan/cdump/cdump.h>
6 CDUMP_SAVED enum state {
8 RECEIVING_USER_QUESTION,
9 SENDING_OTHER_QUESTION_PREFIX,
10 SENDING_OTHER_QUESTION,
11 RECEIVING_OTHER_ANSWER,
12 SENDING_ANSWER_PREFIX,
17 CDUMP_SAVED struct client {
18 /* What are we doing today, brain? */
20 /* Our event info, and the file descriptor. */
21 struct tevent_fd *fde CDUMP_IGNORE;
23 /* Position in oserver's clients array. */
25 /* The question we read from client. */
27 /* The answer to the client. */
29 /* How many bytes of the reply we sent so far. */
32 struct oserver *oserver CDUMP_IGNORE;
33 /* Whose question this client is answering (-1 for none) */
35 /* Who is answering our question (-1 for none) */
39 CDUMP_SAVED struct oserver {
40 /* 5 clients should be enough for anybody! */
41 struct client *clients[5];
43 struct tevent_fd *fde CDUMP_IGNORE;
46 #endif /* CCAN_OSERVER_TYPES_H */