X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;ds=sidebyside;f=src%2Fttt-server.h;h=8f2d34b7c1bd5b2b6c08cef9aa0f8d3867b9b2ec;hb=47ff725ff3b109b94a23ea7c8c07c8b1417e31ef;hp=7cf3d9707ecc95aec9bbfa8e02dc8a20ea9d1137;hpb=84db9bf52aa25c19f7d547ea2dbec69ca4452300;p=ttt diff --git a/src/ttt-server.h b/src/ttt-server.h index 7cf3d97..8f2d34b 100644 --- a/src/ttt-server.h +++ b/src/ttt-server.h @@ -59,6 +59,36 @@ ttt_server_unregister_client (ttt_server_t *server, ttt_client_t *client); void ttt_server_broadcast (ttt_server_t *server, const char *message); + +/* Returns the WHO response. The return string is allocated in this + * function and will need to be free'd by the caller. + * + * Locking: The server mutex will be acquired and held throughout the + * execution of this function. Each client mutex may also be acquired + * and held by functions called during the execution of this function. + * + * Errors: If an error such as an IO error occurs, this function will + * not return. + */ +const char* +ttt_server_who (ttt_server_t *server); + +/* Generates the statistics for the user. If the function does not + * return an error, the response will be allocated in this function + * and will need to be free'd by the caller. + * + * Locking: The server mutex will be acquired and held throughout the + * execution of this function. Each client mutex may also be acquired + * and held by functions called during the execution of this function. + * + * Errors: If an error such as an IO error occurs, this function will + * not return. + */ +ttt_error_t +ttt_server_statistics (ttt_server_t *server, + const char *username, + char **response); + /* Gets the server hostname. * */