X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Foserver%2Foserver_types.h;h=4d70199b351e3bab0f8419e10826d23ce1de0e71;hb=b6eb393a66f1018e73f7c16cc7c61e97ab632fcb;hp=78ef48cb9788fac5a0e6f031ff85f3847861059e;hpb=9b50bdc2a1781d39fa812dbfacaa3b168d861a2a;p=ccan-lca-2011.git diff --git a/ccan/oserver/oserver_types.h b/ccan/oserver/oserver_types.h index 78ef48c..4d70199 100644 --- a/ccan/oserver/oserver_types.h +++ b/ccan/oserver/oserver_types.h @@ -1,8 +1,9 @@ #ifndef CCAN_OSERVER_TYPES_H #define CCAN_OSERVER_TYPES_H #include +#include -enum state { +CDUMP_SAVED enum state { SENDING_GREETING, RECEIVING_USER_QUESTION, SENDING_OTHER_QUESTION_PREFIX, @@ -13,12 +14,14 @@ enum state { FINISHED }; -struct client { +CDUMP_SAVED struct client { /* What are we doing today, brain? */ enum state state; /* Our event info, and the file descriptor. */ - struct tevent_fd *fde; + struct tevent_fd *fde CDUMP_IGNORE; int fd; + /* Position in oserver's clients array. */ + unsigned int id; /* The question we read from client. */ char *question; /* The answer to the client. */ @@ -26,17 +29,20 @@ struct client { /* How many bytes of the reply we sent so far. */ size_t bytes_sent; /* Our server. */ - struct oserver *oserver; - /* Whose question this client is answering. */ - struct client *subclient; - /* Who is answering our question. */ - struct client *oracle; + struct oserver *oserver CDUMP_IGNORE; + /* Whose question this client is answering (-1 for none) */ + int subclient; + /* Who is answering our question (-1 for none) */ + int oracle; }; -struct oserver { - /* 5 clients should be enough for anybody! */ - struct client *clients[5]; +CDUMP_SAVED struct oserver { + unsigned int max_clients; + struct client **clients CDUMP_LEN(max_clients); int fd; - struct tevent_fd *fde; + struct tevent_fd *fde CDUMP_IGNORE; + const char *dumpfile; + int argv_len; + char **argv CDUMP_LEN(argv_len); }; #endif /* CCAN_OSERVER_TYPES_H */