]> git.cworth.org Git - ttt/blobdiff - src/ttt-server.h
* PROTOCOL: Removed unused servername
[ttt] / src / ttt-server.h
index 77fb4bf79df7c023a2f971b27015131b8e7e09e9..7cf3d9707ecc95aec9bbfa8e02dc8a20ea9d1137 100644 (file)
  */
 
 #include "ttt.h"
+#include "ttt-error.h"
 
 #ifndef _TTT_SERVER_H_
 #define _TTT_SERVER_H_
 
 /* Register a new client with the server.
- *
- * Returns: the unique id of the client.
+ * 
+ * Returns: TTT_ERROR_NONE on success, else TTT_ERROR_INVALIDNAME if client's
+ * name is not unique.
  *
  * Locking: The server mutex will be acquired and held throughout the
  * execution of this function.
@@ -34,7 +36,7 @@
  * Errors: If an error (such as out-of-memory) occurs, this function
  * will not return.
  */
-int
+ttt_error_t
 ttt_server_register_client (ttt_server_t *server, ttt_client_t *client);
 
 /* Un-register a client from the server.
@@ -57,4 +59,16 @@ ttt_server_unregister_client (ttt_server_t *server, ttt_client_t *client);
 void
 ttt_server_broadcast (ttt_server_t *server, const char *message);
 
+/* Gets the server hostname.
+ *
+ */
+const char*
+ttt_server_get_host (ttt_server_t *server);
+
+/* Gets the server port
+ *
+ */
+const char*
+ttt_server_get_port (ttt_server_t *server);
+
 #endif /* _TTT_SERVER_H_ */