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