home · contact · privacy
MAJOR re-write. Split plomrogue into a server and a client. Re-wrote large parts
[plomrogue] / src / client / io.h
diff --git a/src/client/io.h b/src/client/io.h
new file mode 100644 (file)
index 0000000..10851d3
--- /dev/null
@@ -0,0 +1,29 @@
+/* src/client/io.h
+ *
+ * Communication of the client with the server (by reading and writing files)
+ * and the user (by writing to the screen and reading keypresses).
+ */
+
+#ifndef IO_H
+#define IO_H
+
+
+
+/* Try sending "msg" to the server by writing it to the file at
+ * world.path_server_in. Try to open it 2^16 times before giving up. After
+ * opening, try to write to it 2^16 times before giving up.
+ */
+extern void try_send(char * msg);
+
+/* Keep checking for user input and a changed server out file. Update client's
+ * world representation on out file changes. Manipulate the client and send
+ * commands to server based on the user input as interpreted by the control.h
+ * library. On each change / activity, re-draw the windows with draw_all_wins().
+ * When the loop ends regularly (due to the user sending a quit command), return
+ * an appropriate quit message to write to stdout when the client winds down.
+ */
+extern char * io_loop();
+
+
+
+#endif