]> git.cworth.org Git - ttt/blob - ChangeLog
dc9d723180edd2541cb990da2d4fe2ee5f51b28f
[ttt] / ChangeLog
1 2005-11-24  Carl Worth  <cworth@cworth.org>
2
3         * PROTOCOL: Document QUIT.
4
5         * src/ttt-client.c: (_ttt_client_execute_helo),
6         (_ttt_client_execute_quit), (_ttt_client_init), (_ttt_client_fini),
7         (_execute_request), (_handle_requests_thread): Implement QUIT. Add
8         client->registered flag and unregister only if registered. Change
9         from args_min and args_max to args_required.
10
11         * src/ttt-error.h:
12         * src/ttt-error.c: (ttt_error_string):
13         * src/ttt-server.c: (ttt_server_register_client): Put underscores
14         in TTT_ERRROR names for better readability.
15
16 2005-11-24  Carl Worth  <cworth@cworth.org>
17
18         * PROTOCOL:
19         * src/ttt-server.c: (ttt_server_init),
20         (ttt_server_register_client): Remove unique-name generation from
21         the server. The client is going to have to have code to do this
22         anyway.
23
24         * src/ttt-client.c: Change minimum arguments for HELO from 0 to 1.
25
26         * TODO: Note that HELO and ERROR INVALIDNAME are implemented in
27         the server.
28
29 2005-11-23  Richard Worth  <richard@theworths.org>
30
31         * PROTOCOL: Removed unused servername
32
33         * src/ttt-client.h: * src/ttt-client.c:
34         (_ttt_client_execute_helo), (_ttt_client_init),
35         (_ttt_client_fini), (_execute_request), (ttt_client_get_name),
36         (ttt_client_set_name): Added command descriptions structure. Match
37         command case-insensitively, dispatch to execute
38         function. Implement HELO command. Register on HELO instead of on
39         connect.
40
41         * src/ttt-server.h: * src/ttt-server.c: (ttt_server_init),
42         (ttt_server_register_client), (ttt_server_unregister_client),
43         (ttt_server_get_host), (ttt_server_get_port), (main): Added host
44         and port to server. Make client registration name-based rather
45         than id-based.
46
47         * src/x.c: (xstrdup): Return NULL on NULL
48
49         * src/ttt-lex.h: Regenerated
50
51 2005-11-22  Carl Worth  <cworth@cworth.org>
52
53         * TODO: Add TODO file listing all the stuff from the protocol that
54         needs to be implemented.
55         
56         * src/Makefile.am:
57         * configure.in:
58         * ylwrap:
59         * src/ttt-lex.h:
60         * src/ttt-lex.l:
61         * src/ttt-token.h: Add support for a flex-based tokenizer which
62         tokenizes newlines and space-separated strings.
63
64         * src/ttt-client.c: (_ttt_client_init), (_ttt_client_fini),
65         (_append_to_request), (_free_request), (_read_request),
66         (_execute_request): Use new tokenizer to tokenize input into an
67         array of request strings.
68
69 2005-11-15  Carl Worth  <cworth@cworth.org>
70
71         * src/Makefile.am:
72         * src/ttt-error.h:
73         * src/ttt-error.c: (ttt_error_string): Add error values and error
74         strings from protocol.
75
76         * src/ttt.h: Add typedefs for ttt_client_t and ttt_server_t so
77         that there's no problem with ttt-client.h and ttt-server.h needing
78         to mutually include each other.
79
80         * src/ttt-server.h:
81         * src/ttt-server.c: (ttt_server_register_client),
82         (ttt_server_unregister_client), (_ttt_server_accept), (main): Push
83         the client request handling thread back down into ttt-client.c
84         where it really does belong. The server code no longer ever
85         reaches down inside the ttt_client_t structure. Export
86         ttt_server_register_client and ttt_server_unregister_client. Add
87         documentation for ttt_server_broadcast. Document locking semantics
88         for all functions which acquire the server lock.
89
90         * src/ttt-client.h:
91         * src/ttt-client.c: (_ttt_client_create), (_ttt_client_destroy),
92         (_read_into_request_until), (_read_request), (_execute_request),
93         (_handle_requests_thread), (ttt_client_new), (ttt_client_get_id):
94         Pull the ttt_client structure definition back down inside the
95         ttt-client.c file. Don't export ttt_client_create and
96         ttt_client_destroy anymore, but instead just use static
97         _ttt_client_init and _ttt_client_fini. Implement the broadcast by
98         just passing a client pointer around and using client->request
99         rather than passing char *request all over. Document new
100         ttt_client_new and remove ttt_client_read_line. Add locking to
101         ttt_client_send and document it. Add ttt_client_get_id.
102
103 2005-11-14  Carl Worth  <cworth@cworth.org>
104
105         Server now acts as a very simple chat server.
106
107         * src/ttt-client.h:
108         * src/ttt-client.c: (ttt_client_create), (ttt_client_destroy),
109         (_append_to_request), (ttt_client_read_into_request_until),
110         (ttt_client_read_line), (ttt_client_send): Add support to do a
111         buffering read within the client and to reuse the buffer (which
112         grows by doubling) from one request to the next. Add function to
113         send a message to a client.
114
115         * src/ttt-server.c: (ttt_server_init), (ttt_server_create_client):
116         Add support for a client idea. Resize the server's client list by
117         doubling.
118         * src/ttt-server.c: (ttt_server_destroy_client): Add support to
119         destroy a client.
120         * src/ttt-server.c: (_handle_client_requests_thread),
121         (_accept_client): Move handling of client requests up to
122         ttt-server.c from ttt-client.c. Use threads rather than a fork per
123         client.
124         * src/ttt-server.h:
125         * src/ttt-server.h: (ttt_server_broadcast): Add function to send a
126         message to all connected clients.
127
128         * src/ttt-socket.h:
129         * src/ttt-socket.c: (ttt_socket_read),
130         (ttt_socket_write): Add functions to do blocking read or write of
131         the specified number of bytes.
132
133         * src/ttt-socket.c: (ttt_socket_accept): Remove fork, so that the
134         accept function call can take care of anything like that itself.
135         
136         * src/x.h:
137         * src/x.c: (xread), (xwrite): New wrappers for read and write.
138
139         * src/ttt.h: Add TTT_STATUS_EOF, TRUE, and FALSE.
140
141         * src/ttt.c: Need to include ttt-args.h explicitly now.
142
143 2005-11-11  Carl Worth  <cworth@cworth.org>
144
145         * src/ttt-server.h:
146         * src/ttt-server.c: (ttt_server_init), (ttt_server_add_client),
147         (_accept_client), (main): Add a new ttt_server_t object with a
148         mutex-protected list of clients. Move client handling code down
149         into new ttt-client.c.
150
151         * src/ttt-client.h:
152         * src/ttt-client.c: (ttt_client_create), (ttt_client_destroy),
153         (ttt_client_handle_requests): New ttt_client_t object that simply
154         holds a pointer back to the server as well as the client socket
155         file descriptor.
156
157         * src/ttt-socket.h:
158         * src/ttt-socket.c: (ttt_socket_accept): Add closure argument. Add
159         a call to fork before calling the accept callback.
160
161         * src/ttt-args.c: Hide unused ttt_args_usage from the compiler to
162         keep it from complaining.
163
164         * src/ttt.c: (main): Rename the client main program from
165         ttt-client to ttt.c, (since the server code now has its own
166         ttt-client.c).
167
168         * src/ttt.h:
169         * src/Makefile.am: Include and link with pthread now that we have
170         pthread-based mutex locking.
171
172 2005-11-11  Carl Worth  <cworth@pippin.local>
173
174         * src/ttt-server.c: (main): Don't assign to stderr which is
175         apparently an invalid lvalue on Mac OS X.
176
177         * src/x.h:
178         * src/x.c: (xfreopen): Change return type to void.
179
180         * src/ttt-board.c: (ttt_board_to_string): Add missing return
181         statement.
182
183 2005-11-11  Carl Worth  <cworth@cworth.org>
184
185         * configure.in: Key off of src/ttt.h instead of src/ttt.c which no
186         longer exists.
187
188 2005-11-11  Carl Worth  <cworth@cworth.org>
189
190         * src/ttt.h:
191         * src/x.c:
192         * src/x.h: Move include of stdarg.h from x.c to ttt.h.
193
194 2005-11-11  Carl Worth  <cworth@cworth.org>
195
196         * src/ttt-board.h: Include ttt.h to get standard includes.
197         
198         * src/ttt-socket.c: Replace include of netinet/ip.h with
199         netinet/in.h which seems to be necessary for BSD libc, (eg. Mac OS
200         X).
201
202 2005-11-09  Carl Worth  <cworth@cworth.org>
203
204         * src/Makefile.am:
205         * src/ttt.h:
206         * src/ttt-server.c: (ttt_dispatch), (main):
207         * src/ttt-socket.h:
208         * src/ttt-socket.c: (_sockaddr_init), (_wait_for_connection),
209         (ttt_socket_create_server), (ttt_socket_accept): Push a lot of
210         code out of ttt-server.c down into a new ttt_socket abstraction
211         layer. The code is much easier to read now. The server also no
212         longer exits when the first client exits, but continues to listen
213         for more connections.
214
215 2005-11-09  Carl Worth  <cworth@cworth.org>
216
217         * src/ttt-args.h:
218         * src/ttt-args.c: (ttt_args_help), (ttt_args_parse): Add support
219         for -h,--host, -p,--port, and --log-file command-line arguments.
220         
221         * src/ttt-server.c: (main): Use host, port, and log-file
222         command-line arguments.
223
224         * src/ttt-client.c: (main): Track change in signature of
225         ttt_args_parse.
226         
227         * src/x.h:
228         * src/x.c: (xfdopen), (xfreopen): More wrappers.
229
230 2005-11-08  Carl Worth  <cworth@cworth.org>
231
232         * src/ttt.h:
233         * src/ttt-server.c: (_sockaddr_init), (_wait_for_connection),
234         (main): Add socket, bind, listen, accept calls to provide a
235         simple, functional, one-shot server demonstration.
236
237         * src/x.h:
238         * src/x.c: (xsocket), (xbind), (xlisten), (xfcntl), (xselect): Add
239         more wrapped system calls.
240
241 2005-11-07  Carl Worth  <cworth@cworth.org>
242
243         * src/ttt.h: Grab some useful definitions from wdo.h:
244         ASSERT_NOT_REACHEED and TTT_PRINTF_FORMAT. Add several needed
245         include directives.
246
247         * src/Makefile.am: Rip out not-yet existing ttt-command and
248         ttt-error.
249         
250         * src/ttt-args.c: (ttt_args_parse): Track name change from
251         args_help to ttt_args_help.
252
253         * src/ttt.c: Remove in favor of ttt-server.c and ttt-client.c.
254         
255         * src/x.h: Add prototype for xfwrite.
256
257 2005-11-05  Richard D. Worth  <richard@theworths.org>
258
259         * src/ttt-board.c: (ttt_board_init): Added for loop counter init.
260         * src/ttt-board.h: Added prototypes.
261
262 2005-11-05  Richard D. Worth  <richard@theworths.org>
263
264         * src/args.c: Renamed ttt-args.c
265         * src/args.h: Renamed ttt-args.h
266         * src/ttt-args.c: (ttt_args_help), (ttt_args_usage),
267         (ttt_args_parse): Added ttt_ prefix.
268         * src/ttt-args.h: Added ttt_, TTT_ prefix.
269
270 2005-11-05  Kevin Worth  <kevin@cworth.org>
271
272         * src/ttt-board.c: (ttt_board_init): Implemented board_init.
273         * src/ttt-board.h: (ttt_board_t): Added cells array.
274
275 2005-11-05  Carl Worth  <cworth@cworth.org>
276
277         * src/Makefile.am: Add ttt-board.[ch] and x.[ch]
278         
279         * src/ttt-board.h:
280         * src/ttt-board.c: (ttt_board_init), (ttt_board_init_from_string),
281         (ttt_board_to_string), (ttt_board_write): Add some stub functions
282         for Richard and Kevin to have some practice
283         implementing. Functions to represent a board and to go to/from a
284         string.
285         
286         * src/x.h:
287         * src/x.c: (xasprintf), (xvasprintf), (xpipe), (xfork), (xmalloc),
288         (xcalloc), (xrealloc), (xfdopen), (xstrdup), (xfwrite): Several
289         utility functions that make system calls, check the result, and
290         exit on any error. This will simplify the error checking needed in
291         programs using these functions.
292         
293 2005-11-05  Carl Worth  <cworth@cworth.org>
294
295         * src/Makefile.am: Break things up for separate ttt-client and
296         ttt-server and programs.
297