home · contact · privacy
Add "look" mode to query things on any cell via new THINGS_HERE command.
[plomrogue] / src / client / io.h
1 /* src/client/io.h
2  *
3  * This file is part of PlomRogue. PlomRogue is licensed under the GPL version 3
4  * or any later version. For details on its copyright, license, and warranties,
5  * see the file NOTICE in the root directory of the PlomRogue source package.
6  *
7  * Communication of the client with the server (by reading and writing files)
8  * and the user (by writing to the screen and reading keypresses).
9  */
10
11 #ifndef IO_H
12 #define IO_H
13
14
15
16 /* Write "msg" plus newline to server input file at world.path_server_in.
17  *
18  * "msg"  must fit into size defined by PIPE_BUF so that no race conditiosn
19  * arise by many clients writing to the file in parallel.
20  */
21 extern void send(char * msg);
22
23 /* Keep checking for user input, a changed worldstate file, and queue input from
24  * the server's out file. Update client's world representation on worldstate
25  * file changes. Manipulate the client and send commands to server based on the
26  * user input as interpreted by the control.h library.
27  *
28  * On each change / activity, re-draw the windows with draw_all_wins(). When the
29  * loop ends regularly (due to the user sending a quit command), return an
30  * appropriate quit message to write to stdout when the client winds down. Call
31  * reset_windows() on receiving a SIGWINCH. Abort on assumed server death if the
32  * server's out file does not get updated, even on PING requests. Re-focus map
33  * view on player if world.autofocus is set. Messages from the out file are put
34  * together on the queue first, from which only complete (\n-delimited) messages
35  * are read. Queues of messages are worked through completely / emptied before
36  * any re-drawing or further server polling happens.
37  */
38 extern char * io_loop();
39
40
41
42 #endif