]> git.cworth.org Git - ttt/blob - ChangeLog
Ignore ttt-lex.h
[ttt] / ChangeLog
1 2005-12-08  Carl Worth  <cworth@cworth.org>
2
3         * src/Makefile.am: Fix rule to auto-generate ttt-lex.h.
4
5         * src/ttt-lex.h: Remove generated file from revision control.
6
7         * src/ttt-lex.l: Add copyright/license blurb.
8
9         * src/ttt-lex.l:
10         * src/ttt-client.c: (yy_init_globals), (use_yy_init_globals):
11         Shut off some annoying compiler warnings due to flex bugs (only
12         one still remains).
13
14 2005-12-07  Richard D. Worth  <richard@theworths.org>
15
16         * PROTOCOL: Remove unused error NOT_IN_GAME. Add error
17         NOT_VALID_MOVE.
18
19         * TODO: Add error NOT_VALID_MOVE.
20         
21         * src/ttt-error.h:
22         * src/ttt-error.c: (ttt_error_string): Add section comments. Add
23         error NOT_VALID_MOVE.
24
25 2005-12-06  Bryan Worth <bryan@theworths.org>
26         * src/ttt-error.c: fixed missing errors (NO_INVITE, NO_GAME)
27
28 2005-12-06  Richard D. Worth  <richard@theworths.org>
29
30         * PROTOCOL: Add error NO_INVITE
31         
32         * TODO: Uncheck INVITE, ACCEPT
33         
34         * src/ttt-error.c: (ttt_error_string): Add errors NO_INVITE,
35         NO_GAME
36
37         * src/ttt-client.c: (_ttt_client_execute_message),
38         (_ttt_client_execute_help), (_ttt_client_execute_version),
39         (_ttt_client_execute_invite), (_ttt_client_execute_accept),
40         (_ttt_client_execute_retract), (_ttt_client_execute_decline):
41         Whitespace changes. Partially implement RETRACT, DECLINE.
42
43 2005-12-05  Richard D. Worth  <richard@theworths.org>
44
45         * PROTOCOL: Fill some missing possible error occurrences.
46
47         * TODO: Check off INVITE, ACCEPT, ERROR COMMAND, ERROR NO_USER
48         
49         * src/ttt-server.h:
50         * src/ttt-server.c: (ttt_server_verify_username):
51         * src/ttt-client.c: (_ttt_client_execute_help),
52         (_ttt_client_execute_invite), (_ttt_client_execute_accept):
53         Implement INVITE, ACCEPT
54
55 2005-12-05  Richard D. Worth  <richard@theworths.org>
56
57         * src/ttt-curses-client.c: (mvprintstr), (mvwprintstr), (wprint),
58         (main), (finish): Whitespace changes.
59
60 2005-12-04  Bryan Worth <bryan@theworths.org>
61         * src/ttt-socket.c: (ttt_socket_create_client) fixed socket to be
62         non-blocking. (ttt_socket_read) added return value for number
63         of bytes read
64         * Makefile.am: added necessary code for new curses-client program.
65         * src/ttt-curses-client: new ncurses based client
66
67 2005-12-03  Richard D. Worth  <richard@theworths.org>
68
69         * PROTOCOL: Add RETRACT, DECLINE. Add game identifier for all game
70         commands.
71         
72         * TODO: Add RETRACT, DECLINE, notices.
73
74 2005-12-03  Richard D. Worth  <richard@theworths.org>
75
76         * PROTOCOL: Add underscores to error codes. Add STATISTICS
77         command. Remove statistics from WHO.
78
79         * TODO: Add STATISTICS. Check off STATISTICS.
80         
81         * src/ttt.h: Define TTT_SERVER_PROTOCOL_VERSION for VERSION.
82
83         * src/ttt-error.c: (ttt_error_string): Add underscores to error
84         codes.
85
86         * src/ttt-client.h:
87         * src/ttt-client.c: (_ttt_client_execute_helo),
88         (_ttt_client_execute_statistics), (_ttt_client_execute_message),
89         (_ttt_client_execute_version), (_ttt_client_execute_quit),
90         (_ttt_client_init), (_ttt_client_fini), (ttt_client_get_username),
91         (ttt_client_set_username): Rename client->name to
92         client->username. Implement STATISTICS. Complete implementation of
93         VERSION.
94
95         * src/ttt-server.h:
96         * src/ttt-server.c: (ttt_server_register_client),
97         (ttt_server_unregister_client), (ttt_server_who),
98         (ttt_server_statistics): Track rename of client->name to
99         client->username. Add server helper for STATISTICS.
100
101 2005-12-02  Richard D. Worth  <richard@theworths.org>
102
103         * TODO: Check off Global commands, HELP, VERSION.
104         
105         * src/ttt-client.c: (_ttt_client_execute_message),
106         (_ttt_client_execute_help), (_execute_request): Whitespace
107         changes. Implement HELP with usage and short description.
108
109         * src/ttt-server.c: Update the server welcome message.
110
111 2005-12-01  Richard D. Worth  <richard@theworths.org>
112
113         * TODO: Check off NOTICE MESSAGE, ERROR NONAMESET.
114
115         * PROTOCOL: Add NONAMESET error in possible errors where
116         applicable. Add description for MESSAGE.
117         
118         * src/ttt-token.h: Add token typedef. Rename token type enum.
119
120         * src/ttt-lex.l: Add support for quoted string as single token.
121         * src/ttt-lex.h: Autogenerated.
122
123         * src/ttt-client.c: (_ttt_client_execute_helo),
124         (_ttt_client_execute_who), (_ttt_client_execute_message),
125         (_ttt_client_execute_help), (_ttt_client_execute_version),
126         (_ttt_client_execute_quit), (_ttt_client_init), (_read_request),
127         (_execute_request): Whitespace changes. Implement VERSION,
128         HELP. Change args_required back to args_min and args_max (see
129         PROTOCOL\HELP). Modify MESSAGE to accept one token arg and quote
130         output. Return NONAMESET error where applicable.
131
132 2005-11-29  Carl Worth  <cworth@cworth.org>
133
134         * src/ttt-socket.h:
135         * src/ttt-socket.c: (ttt_socket_create_client): New function for
136         creating a client socket.
137
138         * src/x.h:
139         * src/x.c: (xconnect): Add xconnect. Return a couple of useful
140         error status values so that callers can recover on connection
141         refused or host unreachable.
142
143         * src/ttt.h: Add TTT_STATUS_CONNECTION_REFUSED and
144         TTT_STATUS_NETWORK_UNREACHABLE.
145
146 2005-11-28  Kevin Worth  <kevin@theworths.org>
147
148         * PROTOCOL: Changed board cell numbering to start with zero
149         instead of one.
150         
151         * src/Makefile.am: 
152         * src/test-board.c: (main): Added new file for testing.
153         
154         * src/ttt-board.c: (ttt_board_init), (ttt_board_to_string):
155         * src/ttt-board.h: Implemented board_to_string.
156
157 2005-11-28  kevin worth  <kevin@theworths.org>
158
159         * src/ttt-board.c:
160         * src/ttt-board.h: Moved struct def from ttt-board.h into
161         ttt-board.c to make it private
162         
163         * src/ttt-lex.h:
164         Autogenerated
165
166 2005-11-28  Carl Worth  <cworth@cworth.org>
167
168         * TODO: Add instructions on using the first letter of our names to
169         indicate we are working on something.
170
171 2005-11-25  Bryan Worth <bryan@theworths.org>
172         * ttt-client.c, ttt-server.c, ttt-error.c changed line breaks to 
173         <crlf> (\r\n) for network compatibility
174
175 2005-11-25  Bryan Worth <bryan@theworths.org>
176         * TODO: checked off NOTICE USER and NOTICE QUIT
177         *src/ttt-client.c: (_ttt_client_execute_helo): implement NOTICE USER
178         *(_ttt_client_execute_quit): implement NOTICE QUIT
179
180 2005-11-25  Bryan Worth <bryan@theworths.org>
181         * TODO: checked off MESSAGE
182
183         *src/ttt-client.c: (_ttt_client_execute_message): Implement MESSAGE
184         *(_execute_request): changed arg_required to behave as a minimum
185         instead of an absolute number to allow optional arguments such as 
186         multi-word messages
187
188 2005-11-25  Richard D. Worth  <richard@theworths.org>
189
190         * TODO: checked off WHO, QUIT, ERROR SYNTAX
191
192         * src/ttt-client.c: (_ttt_client_execute_helo), (_ttt_client_init),
193         (ttt_client_get_num_wins):
194         * src/ttt-client.h:
195         * src/ttt-server.c: (ttt_server_who): Whitespace changes. Add
196         missing player win count for WHO.
197
198 2005-11-24  Richard D. Worth  <richard@theworths.org>
199
200         * AUTHORS: Add Richard D. Worth
201         * TODO: Add newline before EOF
202
203         * src/ttt-client.c: (_ttt_client_execute_who):
204         * src/ttt-server.h:
205         * src/ttt-server.c: (ttt_server_who): Implement WHO.
206
207 2005-11-24  Carl Worth  <cworth@cworth.org>
208
209         * PROTOCOL: Document QUIT.
210
211         * src/ttt-client.c: (_ttt_client_execute_helo),
212         (_ttt_client_execute_quit), (_ttt_client_init), (_ttt_client_fini),
213         (_execute_request), (_handle_requests_thread): Implement QUIT. Add
214         client->registered flag and unregister only if registered. Change
215         from args_min and args_max to args_required.
216
217         * src/ttt-error.h:
218         * src/ttt-error.c: (ttt_error_string):
219         * src/ttt-server.c: (ttt_server_register_client): Put underscores
220         in TTT_ERRROR names for better readability.
221
222 2005-11-24  Carl Worth  <cworth@cworth.org>
223
224         * PROTOCOL:
225         * src/ttt-server.c: (ttt_server_init),
226         (ttt_server_register_client): Remove unique-name generation from
227         the server. The client is going to have to have code to do this
228         anyway.
229
230         * src/ttt-client.c: Change minimum arguments for HELO from 0 to 1.
231
232         * TODO: Note that HELO and ERROR INVALIDNAME are implemented in
233         the server.
234
235 2005-11-23  Richard D. Worth  <richard@theworths.org>
236
237         * PROTOCOL: Remove unused servername
238
239         * src/ttt-client.h: * src/ttt-client.c:
240         (_ttt_client_execute_helo), (_ttt_client_init),
241         (_ttt_client_fini), (_execute_request), (ttt_client_get_name),
242         (ttt_client_set_name): Added command descriptions structure. Match
243         command case-insensitively, dispatch to execute
244         function. Implement HELO command. Register on HELO instead of on
245         connect.
246
247         * src/ttt-server.h: * src/ttt-server.c: (ttt_server_init),
248         (ttt_server_register_client), (ttt_server_unregister_client),
249         (ttt_server_get_host), (ttt_server_get_port), (main): Added host
250         and port to server. Make client registration name-based rather
251         than id-based.
252
253         * src/x.c: (xstrdup): Return NULL on NULL
254
255         * src/ttt-lex.h: Regenerated
256
257 2005-11-22  Carl Worth  <cworth@cworth.org>
258
259         * TODO: Add TODO file listing all the stuff from the protocol that
260         needs to be implemented.
261         
262         * src/Makefile.am:
263         * configure.in:
264         * ylwrap:
265         * src/ttt-lex.h:
266         * src/ttt-lex.l:
267         * src/ttt-token.h: Add support for a flex-based tokenizer which
268         tokenizes newlines and space-separated strings.
269
270         * src/ttt-client.c: (_ttt_client_init), (_ttt_client_fini),
271         (_append_to_request), (_free_request), (_read_request),
272         (_execute_request): Use new tokenizer to tokenize input into an
273         array of request strings.
274
275 2005-11-15  Carl Worth  <cworth@cworth.org>
276
277         * src/Makefile.am:
278         * src/ttt-error.h:
279         * src/ttt-error.c: (ttt_error_string): Add error values and error
280         strings from protocol.
281
282         * src/ttt.h: Add typedefs for ttt_client_t and ttt_server_t so
283         that there's no problem with ttt-client.h and ttt-server.h needing
284         to mutually include each other.
285
286         * src/ttt-server.h:
287         * src/ttt-server.c: (ttt_server_register_client),
288         (ttt_server_unregister_client), (_ttt_server_accept), (main): Push
289         the client request handling thread back down into ttt-client.c
290         where it really does belong. The server code no longer ever
291         reaches down inside the ttt_client_t structure. Export
292         ttt_server_register_client and ttt_server_unregister_client. Add
293         documentation for ttt_server_broadcast. Document locking semantics
294         for all functions which acquire the server lock.
295
296         * src/ttt-client.h:
297         * src/ttt-client.c: (_ttt_client_create), (_ttt_client_destroy),
298         (_read_into_request_until), (_read_request), (_execute_request),
299         (_handle_requests_thread), (ttt_client_new), (ttt_client_get_id):
300         Pull the ttt_client structure definition back down inside the
301         ttt-client.c file. Don't export ttt_client_create and
302         ttt_client_destroy anymore, but instead just use static
303         _ttt_client_init and _ttt_client_fini. Implement the broadcast by
304         just passing a client pointer around and using client->request
305         rather than passing char *request all over. Document new
306         ttt_client_new and remove ttt_client_read_line. Add locking to
307         ttt_client_send and document it. Add ttt_client_get_id.
308
309 2005-11-14  Carl Worth  <cworth@cworth.org>
310
311         Server now acts as a very simple chat server.
312
313         * src/ttt-client.h:
314         * src/ttt-client.c: (ttt_client_create), (ttt_client_destroy),
315         (_append_to_request), (ttt_client_read_into_request_until),
316         (ttt_client_read_line), (ttt_client_send): Add support to do a
317         buffering read within the client and to reuse the buffer (which
318         grows by doubling) from one request to the next. Add function to
319         send a message to a client.
320
321         * src/ttt-server.c: (ttt_server_init), (ttt_server_create_client):
322         Add support for a client idea. Resize the server's client list by
323         doubling.
324         * src/ttt-server.c: (ttt_server_destroy_client): Add support to
325         destroy a client.
326         * src/ttt-server.c: (_handle_client_requests_thread),
327         (_accept_client): Move handling of client requests up to
328         ttt-server.c from ttt-client.c. Use threads rather than a fork per
329         client.
330         * src/ttt-server.h:
331         * src/ttt-server.h: (ttt_server_broadcast): Add function to send a
332         message to all connected clients.
333
334         * src/ttt-socket.h:
335         * src/ttt-socket.c: (ttt_socket_read),
336         (ttt_socket_write): Add functions to do blocking read or write of
337         the specified number of bytes.
338
339         * src/ttt-socket.c: (ttt_socket_accept): Remove fork, so that the
340         accept function call can take care of anything like that itself.
341         
342         * src/x.h:
343         * src/x.c: (xread), (xwrite): New wrappers for read and write.
344
345         * src/ttt.h: Add TTT_STATUS_EOF, TRUE, and FALSE.
346
347         * src/ttt.c: Need to include ttt-args.h explicitly now.
348
349 2005-11-11  Carl Worth  <cworth@cworth.org>
350
351         * src/ttt-server.h:
352         * src/ttt-server.c: (ttt_server_init), (ttt_server_add_client),
353         (_accept_client), (main): Add a new ttt_server_t object with a
354         mutex-protected list of clients. Move client handling code down
355         into new ttt-client.c.
356
357         * src/ttt-client.h:
358         * src/ttt-client.c: (ttt_client_create), (ttt_client_destroy),
359         (ttt_client_handle_requests): New ttt_client_t object that simply
360         holds a pointer back to the server as well as the client socket
361         file descriptor.
362
363         * src/ttt-socket.h:
364         * src/ttt-socket.c: (ttt_socket_accept): Add closure argument. Add
365         a call to fork before calling the accept callback.
366
367         * src/ttt-args.c: Hide unused ttt_args_usage from the compiler to
368         keep it from complaining.
369
370         * src/ttt.c: (main): Rename the client main program from
371         ttt-client to ttt.c, (since the server code now has its own
372         ttt-client.c).
373
374         * src/ttt.h:
375         * src/Makefile.am: Include and link with pthread now that we have
376         pthread-based mutex locking.
377
378 2005-11-11  Carl Worth  <cworth@pippin.local>
379
380         * src/ttt-server.c: (main): Don't assign to stderr which is
381         apparently an invalid lvalue on Mac OS X.
382
383         * src/x.h:
384         * src/x.c: (xfreopen): Change return type to void.
385
386         * src/ttt-board.c: (ttt_board_to_string): Add missing return
387         statement.
388
389 2005-11-11  Carl Worth  <cworth@cworth.org>
390
391         * configure.in: Key off of src/ttt.h instead of src/ttt.c which no
392         longer exists.
393
394 2005-11-11  Carl Worth  <cworth@cworth.org>
395
396         * src/ttt.h:
397         * src/x.c:
398         * src/x.h: Move include of stdarg.h from x.c to ttt.h.
399
400 2005-11-11  Carl Worth  <cworth@cworth.org>
401
402         * src/ttt-board.h: Include ttt.h to get standard includes.
403         
404         * src/ttt-socket.c: Replace include of netinet/ip.h with
405         netinet/in.h which seems to be necessary for BSD libc, (eg. Mac OS
406         X).
407
408 2005-11-09  Carl Worth  <cworth@cworth.org>
409
410         * src/Makefile.am:
411         * src/ttt.h:
412         * src/ttt-server.c: (ttt_dispatch), (main):
413         * src/ttt-socket.h:
414         * src/ttt-socket.c: (_sockaddr_init), (_wait_for_connection),
415         (ttt_socket_create_server), (ttt_socket_accept): Push a lot of
416         code out of ttt-server.c down into a new ttt_socket abstraction
417         layer. The code is much easier to read now. The server also no
418         longer exits when the first client exits, but continues to listen
419         for more connections.
420
421 2005-11-09  Carl Worth  <cworth@cworth.org>
422
423         * src/ttt-args.h:
424         * src/ttt-args.c: (ttt_args_help), (ttt_args_parse): Add support
425         for -h,--host, -p,--port, and --log-file command-line arguments.
426         
427         * src/ttt-server.c: (main): Use host, port, and log-file
428         command-line arguments.
429
430         * src/ttt-client.c: (main): Track change in signature of
431         ttt_args_parse.
432         
433         * src/x.h:
434         * src/x.c: (xfdopen), (xfreopen): More wrappers.
435
436 2005-11-08  Carl Worth  <cworth@cworth.org>
437
438         * src/ttt.h:
439         * src/ttt-server.c: (_sockaddr_init), (_wait_for_connection),
440         (main): Add socket, bind, listen, accept calls to provide a
441         simple, functional, one-shot server demonstration.
442
443         * src/x.h:
444         * src/x.c: (xsocket), (xbind), (xlisten), (xfcntl), (xselect): Add
445         more wrapped system calls.
446
447 2005-11-07  Carl Worth  <cworth@cworth.org>
448
449         * src/ttt.h: Grab some useful definitions from wdo.h:
450         ASSERT_NOT_REACHEED and TTT_PRINTF_FORMAT. Add several needed
451         include directives.
452
453         * src/Makefile.am: Rip out not-yet existing ttt-command and
454         ttt-error.
455         
456         * src/ttt-args.c: (ttt_args_parse): Track name change from
457         args_help to ttt_args_help.
458
459         * src/ttt.c: Remove in favor of ttt-server.c and ttt-client.c.
460         
461         * src/x.h: Add prototype for xfwrite.
462
463 2005-11-05  Richard D. Worth  <richard@theworths.org>
464
465         * src/ttt-board.c: (ttt_board_init): Added for loop counter init.
466         * src/ttt-board.h: Added prototypes.
467
468 2005-11-05  Richard D. Worth  <richard@theworths.org>
469
470         * src/args.c: Renamed ttt-args.c
471         * src/args.h: Renamed ttt-args.h
472         * src/ttt-args.c: (ttt_args_help), (ttt_args_usage),
473         (ttt_args_parse): Added ttt_ prefix.
474         * src/ttt-args.h: Added ttt_, TTT_ prefix.
475
476 2005-11-05  Kevin Worth  <kevin@cworth.org>
477
478         * src/ttt-board.c: (ttt_board_init): Implemented board_init.
479         * src/ttt-board.h: (ttt_board_t): Added cells array.
480
481 2005-11-05  Carl Worth  <cworth@cworth.org>
482
483         * src/Makefile.am: Add ttt-board.[ch] and x.[ch]
484         
485         * src/ttt-board.h:
486         * src/ttt-board.c: (ttt_board_init), (ttt_board_init_from_string),
487         (ttt_board_to_string), (ttt_board_write): Add some stub functions
488         for Richard and Kevin to have some practice
489         implementing. Functions to represent a board and to go to/from a
490         string.
491         
492         * src/x.h:
493         * src/x.c: (xasprintf), (xvasprintf), (xpipe), (xfork), (xmalloc),
494         (xcalloc), (xrealloc), (xfdopen), (xstrdup), (xfwrite): Several
495         utility functions that make system calls, check the result, and
496         exit on any error. This will simplify the error checking needed in
497         programs using these functions.
498         
499 2005-11-05  Carl Worth  <cworth@cworth.org>
500
501         * src/Makefile.am: Break things up for separate ttt-client and
502         ttt-server and programs.
503