+ assert (num_args == 1);
+
+ ttt_client_set_name (client, args[0]);
+
+ error = ttt_server_register_client (client->server, client);
+ if (error)
+ return error;
+
+ client->registered = TRUE;
+
+ xasprintf (&response, "HELO %s %s %s\n", client->name,
+ ttt_server_get_host (client->server),
+ ttt_server_get_port (client->server));
+
+ ttt_client_send (client, response);
+
+ free (response);
+
+ return TTT_ERROR_NONE;
+}
+
+static ttt_error_t
+_ttt_client_execute_who (ttt_client_t *client,
+ char **args,
+ int num_args)
+{
+ const char *response;
+
+ assert (num_args == 0);
+
+ response = ttt_server_who (client->server);
+
+ ttt_client_send (client, response);
+
+ free (response);
+
+ return TTT_ERROR_NONE;
+}
+
+static ttt_error_t
+_ttt_client_execute_quit (ttt_client_t *client,
+ char **args,
+ int num_args)
+{
+ assert (num_args == 0);
+
+ return TTT_ERROR_QUIT_REQUESTED;
+}
+
+static void
+_free_request (ttt_client_t *client);
+
+static void
+_ttt_client_init (ttt_client_t *client,
+ ttt_server_t *server,
+ int socket)
+{
+ FILE *file;
+
+ pthread_mutex_init (&client->mutex, NULL);