]> git.ozlabs.org Git - ccan-lca-2011.git/blob - ccan/cdump/test/test_header_advanced.h
lca2011: don't use void * for the handle.
[ccan-lca-2011.git] / ccan / cdump / test / test_header_advanced.h
1 /* This tests new features in cdump which weren't in genparser.pl */
2 CDUMP_SAVED enum state {
3         SENDING_GREETING,
4         RECEIVING_USER_QUESTION,
5         SENDING_OTHER_QUESTION_PREFIX,
6         SENDING_OTHER_QUESTION,
7         RECEIVING_OTHER_ANSWER,
8         SENDING_ANSWER_PREFIX,
9         SENDING_ANSWER,
10         FINISHED
11 };
12
13 CDUMP_SAVED struct client {
14         /* In linked list clients */
15         struct list_node node;
16         /* What are we doing today, brain? */
17         enum state state;
18         /* How many bytes of the current string we sent so far. */
19         size_t bytes_sent;
20         /* Our event info, and the file descriptor. */
21         struct tevent_fd *fde CDUMP_IGNORE;
22         int fd;
23         /* The question we read from client. */
24         const char *question;
25         /* Whose question this client is answering. */
26         struct client *subclient;
27         /* Who is answering our question. */
28         struct client *oracle;
29         /* The answer we send. */
30         char *answer;
31 };