home · contact · privacy
Re-wrote large parts of the server client architecture. No more fifo.
[plomrogue] / src / client / io.h
1 /* src/client/io.h
2  *
3  * Communication of the client with the server (by reading and writing files)
4  * and the user (by writing to the screen and reading keypresses).
5  */
6
7 #ifndef IO_H
8 #define IO_H
9
10
11
12 /* Write "msg" plus newline to server input file at world.path_server_in.
13  *
14  * "msg"  must fit into size defined by PIPE_BUF so that no race conditiosn
15  * arise by many clients writing to the file in parallel.
16  */
17 extern void send(char * msg);
18
19 /* Keep checking for user input, a changed worldstate file and the server's
20  * wakefulness. Update client's world representation on worldstate file changes.
21  * Manipulate the client and send commands to server based on the user input as
22  * interpreted by the control.h library.
23  *
24  * On each change / activity, re-draw the windows with draw_all_wins(). When the
25  * loop ends regularly (due to the user sending a quit command), return an
26  * appropriate quit message to write to stdout when the client winds down. Call
27  * reset_windows() on receiving a SIGWINCH. Abort on assumed server death if the
28  * server's out file does not get updated, even on PING requests.
29  */
30 extern char * io_loop();
31
32
33
34 #endif