]> git.cworth.org Git - ttt/log
ttt
17 years ago2005-11-11 Carl Worth <cworth@cworth.org>
Carl Worth [Sat, 12 Nov 2005 01:21:21 +0000 (01:21 +0000)]
2005-11-11  Carl Worth  <cworth@cworth.org>

        * src/ttt-server.h:
        * src/ttt-server.c: (ttt_server_init), (ttt_server_add_client),
        (_accept_client), (main): Add a new ttt_server_t object with a
        mutex-protected list of clients. Move client handling code down
        into new ttt-client.c.

        * src/ttt-client.h:
        * src/ttt-client.c: (ttt_client_create), (ttt_client_destroy),
        (ttt_client_handle_requests): New ttt_client_t object that simply
        holds a pointer back to the server as well as the client socket
        file descriptor.

        * src/ttt-socket.h:
        * src/ttt-socket.c: (ttt_socket_accept): Add closure argument. Add
        a call to fork before calling the accept callback.

        * src/ttt-args.c: Hide unused ttt_args_usage from the compiler to
        keep it from complaining.

        * src/ttt.c: (main): Rename the client main program from
        ttt-client to ttt.c, (since the server code now has its own
        ttt-client.c).

        * src/ttt.h:
        * src/Makefile.am: Include and link with pthread now that we have
        pthread-based mutex locking.

17 years ago2005-11-11 Carl Worth <cworth@pippin.local>
Carl Worth [Fri, 11 Nov 2005 21:13:59 +0000 (21:13 +0000)]
2005-11-11  Carl Worth  <cworth@pippin.local>

        * src/ttt-server.c: (main): Don't assign to stderr which is
        apparently an invalid lvalue on Mac OS X.

        * src/x.h:
        * src/x.c: (xfreopen): Change return type to void.

        * src/ttt-board.c: (ttt_board_to_string): Add missing return
        statement.

17 years ago2005-11-11 Carl Worth <cworth@cworth.org>
Carl Worth [Fri, 11 Nov 2005 21:04:03 +0000 (21:04 +0000)]
2005-11-11  Carl Worth  <cworth@cworth.org>

        * configure.in: Key off of src/ttt.h instead of src/ttt.c which no
        longer exists.

17 years ago2005-11-11 Carl Worth <cworth@cworth.org>
Carl Worth [Fri, 11 Nov 2005 20:47:35 +0000 (20:47 +0000)]
2005-11-11  Carl Worth  <cworth@cworth.org>

        * src/ttt.h:
        * src/x.c:
        * src/x.h: Move include of stdarg.h from x.c to ttt.h.

17 years ago2005-11-11 Carl Worth <cworth@cworth.org>
Carl Worth [Fri, 11 Nov 2005 20:45:39 +0000 (20:45 +0000)]
2005-11-11  Carl Worth  <cworth@cworth.org>

        * src/ttt-board.h: Include ttt.h to get standard includes.

        * src/ttt-socket.c: Replace include of netinet/ip.h with
        netinet/in.h which seems to be necessary for BSD libc, (eg. Mac OS
        X).

17 years ago2005-11-09 Carl Worth <cworth@cworth.org>
Carl Worth [Wed, 9 Nov 2005 14:37:16 +0000 (14:37 +0000)]
2005-11-09  Carl Worth  <cworth@cworth.org>

        * src/Makefile.am:
        * src/ttt.h:
        * src/ttt-server.c: (ttt_dispatch), (main):
        * src/ttt-socket.h:
        * src/ttt-socket.c: (_sockaddr_init), (_wait_for_connection),
        (ttt_socket_create_server), (ttt_socket_accept): Push a lot of
        code out of ttt-server.c down into a new ttt_socket abstraction
        layer. The code is much easier to read now. The server also no
        longer exits when the first client exits, but continues to listen
        for more connections.

17 years ago2005-11-09 Carl Worth <cworth@cworth.org>
Carl Worth [Wed, 9 Nov 2005 13:57:33 +0000 (13:57 +0000)]
2005-11-09  Carl Worth  <cworth@cworth.org>

        * src/ttt-args.h:
        * src/ttt-args.c: (ttt_args_help), (ttt_args_parse): Add support
        for -h,--host, -p,--port, and --log-file command-line arguments.

        * src/ttt-server.c: (main): Use host, port, and log-file
        command-line arguments.

        * src/ttt-client.c: (main): Track change in signature of
        ttt_args_parse.

        * src/x.h:
        * src/x.c: (xfdopen), (xfreopen): More wrappers.

17 years ago2005-11-08 Carl Worth <cworth@cworth.org>
Carl Worth [Tue, 8 Nov 2005 18:03:08 +0000 (18:03 +0000)]
2005-11-08  Carl Worth  <cworth@cworth.org>

        * src/ttt.h:
        * src/ttt-server.c: (_sockaddr_init), (_wait_for_connection),
        (main): Add socket, bind, listen, accept calls to provide a
        simple, functional, one-shot server demonstration.

        * src/x.h:
        * src/x.c: (xsocket), (xbind), (xlisten), (xfcntl), (xselect): Add
        more wrapped system calls.

17 years ago2005-11-07 Carl Worth <cworth@cworth.org>
Carl Worth [Tue, 8 Nov 2005 00:44:57 +0000 (00:44 +0000)]
2005-11-07  Carl Worth  <cworth@cworth.org>

        * src/ttt.h: Grab some useful definitions from wdo.h:
        ASSERT_NOT_REACHEED and TTT_PRINTF_FORMAT. Add several needed
        include directives.

        * src/Makefile.am: Rip out not-yet existing ttt-command and
        ttt-error.

        * src/ttt-args.c: (ttt_args_parse): Track name change from
        args_help to ttt_args_help.

        * src/ttt.c: Remove in favor of ttt-server.c and ttt-client.c.

        * src/x.h: Add prototype for xfwrite.

17 years ago * src/ttt-board.c: (ttt_board_init): Added for loop counter init.
Richard Worth [Sat, 5 Nov 2005 22:41:03 +0000 (22:41 +0000)]
    * src/ttt-board.c: (ttt_board_init): Added for loop counter init.
        * src/ttt-board.h: Added prototypes.

17 years ago * src/args.c: Renamed ttt-args.c
Richard Worth [Sat, 5 Nov 2005 20:25:11 +0000 (20:25 +0000)]
    * src/args.c: Renamed ttt-args.c
        * src/args.h: Renamed ttt-args.h
        * src/ttt-args.c: (ttt_args_help), (ttt_args_usage),
        (ttt_args_parse): Added ttt_ prefix.
        * src/ttt-args.h: Added ttt_, TTT_ prefix.

17 years ago* /games/tictactoe/src/ttt-board.c, ttt-board.h: Implemented board_init
Kevin Worth [Sat, 5 Nov 2005 19:53:18 +0000 (19:53 +0000)]
* /games/tictactoe/src/ttt-board.c, ttt-board.h: Implemented board_init

17 years ago2005-11-05 Carl Worth <cworth@cworth.org>
Carl Worth [Sat, 5 Nov 2005 16:43:21 +0000 (16:43 +0000)]
2005-11-05  Carl Worth  <cworth@cworth.org>

        * src/Makefile.am: Add ttt-board.[ch] and x.[ch]

        * src/ttt-board.h:
        * src/ttt-board.c: (ttt_board_init), (ttt_board_init_from_string),
        (ttt_board_to_string), (ttt_board_write): Add some stub functions
        for Richard and Kevin to have some practice
        implementing. Functions to represent a board and to go to/from a
        string.

        * src/x.h:
        * src/x.c: (xasprintf), (xvasprintf), (xpipe), (xfork), (xmalloc),
        (xcalloc), (xrealloc), (xfdopen), (xstrdup), (xfwrite): Several
        utility functions that make system calls, check the result, and
        exit on any error. This will simplify the error checking needed in
        programs using these functions.

17 years ago2005-11-05 Carl Worth <cworth@cworth.org>
Carl Worth [Sat, 5 Nov 2005 16:17:32 +0000 (16:17 +0000)]
2005-11-05  Carl Worth  <cworth@cworth.org>

        * src/Makefile.am: Break things up for separate ttt-client and
        ttt-server and programs.

17 years agoAdd svn:ignore properties
Carl Worth [Sat, 5 Nov 2005 16:08:18 +0000 (16:08 +0000)]
Add svn:ignore properties

17 years agoAdd template files
Carl Worth [Sat, 5 Nov 2005 16:03:47 +0000 (16:03 +0000)]
Add template files

17 years agoMinor fixes
Carl Worth [Sat, 5 Nov 2005 15:45:28 +0000 (15:45 +0000)]
Minor fixes

17 years agoQuick pass to make it more like tic-tac-toe --- far from complete.
Carl Worth [Sat, 5 Nov 2005 15:41:55 +0000 (15:41 +0000)]
Quick pass to make it more like tic-tac-toe --- far from complete.

17 years agoCommit RRGP protocol document as a starting point.
Carl Worth [Sat, 5 Nov 2005 14:57:56 +0000 (14:57 +0000)]
Commit RRGP protocol document as a starting point.

17 years ago* /games/tictactoe: New folders
Richard Worth [Sat, 5 Nov 2005 14:10:24 +0000 (14:10 +0000)]
* /games/tictactoe: New folders