X-Git-Url: https://git.cworth.org/git?p=ttt;a=blobdiff_plain;f=src%2Fttt-client.h;fp=src%2Fttt-client.h;h=b067674fdbc7b2fb7e1696d28462747b38e1fbe5;hp=0000000000000000000000000000000000000000;hb=5d56d3cd8b4685e905ed604277ac9cb32c876127;hpb=ded32923a25488449be27687013845d7fa0e9e5e diff --git a/src/ttt-client.h b/src/ttt-client.h new file mode 100644 index 0000000..b067674 --- /dev/null +++ b/src/ttt-client.h @@ -0,0 +1,50 @@ +/* ttt-client.c - client handling code for tic-tac-toe game server + * + * Copyright © 2005 Carl Worth + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * Author: Carl Worth + */ + +#include "ttt.h" + +#include "ttt-server.h" + +#ifndef _TTT_CLIENT_H_ +#define _TTT_CLIENT_H_ + +typedef struct _ttt_client ttt_client_t; + +/* Create a new ttt_client_t for the given server and given a + * connected socket. + * + * Returns: A new ttt_client_t. Call ttt_client_destroy when finished + * with it. + * + * Errors: If any error occurs, (such as out-of-memory), this function + * will not return. + */ +ttt_client_t * +ttt_client_create (ttt_server_t *server, int socket); + +void +ttt_client_destroy (ttt_client_t *client); + +/* Loop forever handling client requests. Never returns. */ +void +ttt_client_handle_requests (ttt_client_t *client); + +#endif /* _TTT_CLIENT_H_ */