2003-01-26 Havoc Pennington <hp@pobox.com>
[platform/upstream/dbus.git] / ChangeLog
1 2003-01-26  Havoc Pennington  <hp@pobox.com>
2
3         * dbus/dbus-message-builder.c: implement, completely untested.
4
5         * test/data/*: add data to be used in testing. 
6         ".message" files are our simple loadable text format.
7         ".message-raw" will be binary dumps of messages.
8
9         * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
10
11 2003-01-26  Havoc Pennington  <hp@pobox.com>
12
13         * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
14
15         * dbus/dbus-errors.c (dbus_result_to_string): add
16         file errors
17
18         * dbus/dbus-message-builder.c: new file, will contain code to load
19         up messages from files. Not implemented yet.
20
21 2003-01-26  Havoc Pennington  <hp@pobox.com>
22
23         * dbus/dbus-message.c (dbus_message_set_sender): support deleting
24         the sender by setting to NULL
25
26 2003-01-26  Havoc Pennington  <hp@pobox.com>
27
28         The unit tests pass, but otherwise untested.  If it breaks, the
29         tests should have been better. ;-)
30         
31         * bus/driver.c (bus_driver_handle_hello): return if we disconnect
32         the connection.
33
34         * dbus/dbus-message.c: redo everything so we maintain 
35         message->header as the only copy of the various fields.
36         This avoids the possibility of out-of-memory in some cases,
37         for example dbus_message_lock() can't run out of memory anymore,
38         and avoids extra copying. Figured I may as well go ahead and do 
39         this since it was busted for dbus_message_lock to not return 
40         failure on OOM, and dbus_message_write_header was totally
41         unchecked for OOM. Also fixed some random other bugs.
42
43         * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
44         that strings are nul-terminated. Also, end_pos can be equal 
45         to string length just not greater than, I think.
46         (_dbus_marshal_set_int32): new function
47         (_dbus_marshal_set_uint32): new function
48         (_dbus_marshal_set_string): new function
49
50         * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
51         a warning, init timeout_list to NULL
52         (dbus_connection_send_message): don't use uninitialized variable
53         "serial"
54
55         * dbus/dbus-string.c (_dbus_string_replace_len): new function
56
57 2003-01-26  Anders Carlsson  <andersca@codefactory.se>
58
59         * bus/driver.c: (bus_driver_handle_hello),
60         (bus_driver_send_welcome_message):
61         Plug leaks
62         
63 2003-01-26  Anders Carlsson  <andersca@codefactory.se>
64
65         * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
66         * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
67         (dbus_connection_unref):
68         * dbus/dbus-marshal.c: (_dbus_marshal_test):
69         * dbus/dbus-message.c: (dbus_message_unref),
70         Plug memory leaks.
71         
72         (dbus_message_get_fields): 
73         Remove debugging printout.
74
75         (_dbus_message_loader_return_buffer):
76         Don't store the header string.
77         
78         (_dbus_message_test):
79         Plug leaks.
80
81 2003-01-26  Richard Hult  <rhult@codefactory.se>
82
83         * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
84         the file descriptor list, since it can change under us.
85
86 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
87
88         * glib/dbus-gmain.c: (dbus_connection_prepare),
89         (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
90         (remove_watch), (dbus_connection_hookup_with_g_main):
91         Rewrite the glib handling to use its own GSource instead of a 
92         GIOChannel so we can catch messages put in the queue while waiting
93         for a reply.
94         
95 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
96
97         * bus/Makefile.am:
98         * bus/connection.c: (connection_disconnect_handler),
99         (connection_watch_callback), (bus_connection_setup):
100         * bus/dispatch.c: (send_one_message),
101         (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
102         (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
103         * bus/dispatch.h:
104         * bus/driver.c: (bus_driver_send_service_deleted),
105         (bus_driver_send_service_created), (bus_driver_handle_hello),
106         (bus_driver_send_welcome_message),
107         (bus_driver_handle_list_services), (bus_driver_remove_connection),
108         (bus_driver_handle_message):
109         * bus/driver.h:
110         Refactor code, put the message dispatching in its own file. Use 
111         _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
112         is disconnected.
113         
114 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
115
116         * dbus/dbus-internals.h:
117         Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
118         
119         * dbus/dbus-message.c: (dbus_message_get_sender):
120         * dbus/dbus-message.h:
121         Implement dbus_message_get_sender.
122         
123         * dbus/dbus-protocol.h:
124         Add message and service defines.
125         
126 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
127
128         * dbus/dbus-connection.c: (dbus_connection_send_message):
129         * dbus/dbus-message-internal.h:
130         * dbus/dbus-message.c: (_dbus_message_get_client_serial),
131         (dbus_message_write_header):
132         Remove _dbus_messag_unlock and don't set the client serial on a 
133         message if one already exists.
134         
135 2003-01-24  Havoc Pennington  <hp@pobox.com>
136
137         * dbus/dbus-list.c (alloc_link): put a thread lock on the global
138         list_pool
139
140         * bus/driver.c (bus_driver_handle_list_services): fix a leak 
141         on OOM
142
143 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
144
145         * dbus/dbus-list.c: (alloc_link), (free_link):
146         Use a memory pool for the links.
147         
148 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
149
150         * bus/connection.c: (bus_connection_foreach):
151         * bus/connection.h:
152         Add new bus_connection_foreach function.
153         
154         * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
155         Add function that broadcasts a message to all clients.
156         
157         (bus_driver_send_service_created), (bus_driver_handle_hello),
158         (bus_driver_send_welcome_message),
159         (bus_driver_handle_list_services), (bus_driver_message_handler):
160         Implement functions that take care of listing services, and notifying
161         clients when new services are created.
162         
163         * bus/services.c: (bus_services_list):
164         * bus/services.h:
165         Add new function that returns an array of strings with the currently
166         registered services.
167         
168         * glib/dbus-glib.h:
169         * glib/dbus-gmain.c:
170         Update copyright year.
171         
172 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
173
174         * dbus/dbus-connection.c: (dbus_connection_send_message):
175         Unlock the message in case it was sent earlier.
176         
177         (dbus_connection_send_message_with_reply_and_block):
178         Remove the reply message from the list.
179         
180         * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
181         Set array_len and new_pos correctly.
182         
183         (_dbus_marshal_test):
184         Remove debug output.
185         
186         * dbus/dbus-message-internal.h:
187         * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
188         New function that returns the reply serial.
189         
190         (_dbus_message_unlock):
191         New function that unlocks a message and resets its header.
192
193         (dbus_message_append_string_array), 
194         (dbus_message_get_fields_valist),
195         (dbus_message_iter_get_field_type),
196         (dbus_message_iter_get_string_array),   
197         (dbus_message_get_fields),      
198         (dbus_message_append_fields_valist):
199         Handle string arrays.
200         
201         (dbus_message_set_sender):
202         Make this function public since the bus daemon needs it.
203         
204         (decode_header_data):
205         Set the reply serial to -1 initially.
206
207         * dbus/dbus-message.h:
208         Add dbus_message_set_sender.    
209
210 2003-01-24  Havoc Pennington  <hp@pobox.com>
211
212         * doc/dbus-specification.sgml: add some stuff
213
214 2003-01-22  Havoc Pennington  <hp@pobox.com>
215
216         * doc/dbus-specification.sgml: Start to document the protocol.
217
218 2003-01-22  Havoc Pennington  <hp@pobox.com>
219
220         * dbus/dbus-connection.c
221         (dbus_connection_send_message_with_reply_and_block): add some @todo
222
223         * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
224
225 2003-01-21  Havoc Pennington  <hp@pobox.com>
226
227         (patch untested because can't compile)
228         
229         * bus/driver.c (create_unique_client_name): make this function
230         never recycle client names. Also, caller should initialize 
231         the DBusString.
232
233         * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
234
235 2003-01-21  Anders Carlsson  <andersca@codefactory.se>
236
237         * dbus/dbus-marshal.c: (_dbus_marshal_double),
238         (_dbus_marshal_int32), (_dbus_marshal_uint32),
239         (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
240         (_dbus_marshal_double_array), (_dbus_marshal_string_array),
241         (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
242         (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
243         (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
244         * dbus/dbus-marshal.h:
245         * dbus/dbus-protocol.h:
246         Add support for marshalling and demarshalling integer, double
247         and string arrays.
248         
249 2003-01-21  Anders Carlsson  <andersca@codefactory.se>
250
251         * bus/Makefile.am:
252         Add driver.[ch]
253         
254         * bus/connection.c: (connection_disconnect_handler):
255         Remove the connection from the bus driver's list.
256         
257         (connection_watch_callback): Dispatch messages.
258
259         (free_connection_data): Free connection name.
260         
261         (bus_connection_setup): Add connection to the bus driver's list.
262         (bus_connection_remove_owned_service): 
263         (bus_connection_set_name), (bus_connection_get_name):
264         Add functions for setting and getting the connection's name.
265         
266         * bus/connection.h:
267         Add function headers.
268         
269         * bus/driver.c: (create_unique_client_name),
270         (bus_driver_handle_hello_message),
271         (bus_driver_send_welcome_message), (bus_driver_message_handler),
272         (bus_driver_add_connection), (bus_driver_remove_connection):
273         * bus/driver.h:
274         * bus/main.c:
275         * bus/services.c: (bus_service_free):
276         * bus/services.h:
277         New file that handles communication and registreation with the bus
278         itself. 
279         
280 2003-01-21  Anders Carlsson  <andersca@codefactory.se>
281
282         * dbus/dbus-connection.c: (dbus_connection_send_message):
283         Add a new client_serial parameter.
284         
285         (dbus_connection_send_message_with_reply):
286         Remove a @todo since we've implemented the blocking function.
287         
288         (dbus_connection_send_message_with_reply_and_block):
289         New function that sends a message and waits for a reply and
290         then returns the reply.
291         
292         * dbus/dbus-connection.h:
293         Add new functions.
294         
295         * dbus/dbus-errors.c: (dbus_result_to_string):
296         * dbus/dbus-errors.h:
297         Add new DBUS_RESULT.
298         
299         * dbus/dbus-message-internal.h:
300         * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
301         (_dbus_message_set_sender), (dbus_message_write_header),
302         (dbus_message_new_reply), (decode_header_data),
303         (_dbus_message_loader_return_buffer), (_dbus_message_test):
304         * dbus/dbus-message.h:
305         Add new functions that set the reply serial and sender.
306         Also marshal and demarshal them correctly and add test.
307         
308         * dbus/dbus-protocol.h:
309         Add new DBUS_MESSAGE_TYPE_SENDER.
310         
311         * glib/dbus-glib.h:
312         * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
313         (add_watch), (remove_watch), (add_timeout), (remove_timeout),
314         (dbus_connection_hookup_with_g_main):
315         * glib/test-dbus-glib.c: (main):
316         Rewrite to use GIOChannel and remove the GSource crack.
317         
318         * test/echo-client.c: (main):
319         * test/watch.c: (check_messages):
320         Update for changed APIs
321         
322 2003-01-19  Anders Carlsson  <andersca@codefactory.se>
323
324         * dbus/Makefile.am: Add dbus-timeout.[cħ]
325         
326         * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
327         Create a DBusTimeoutList.       
328         (dbus_connection_set_timeout_functions): Add new function to
329         set timeout callbacks
330         
331         * dbus/dbus-connection.h: Add public DBusTimeout API.
332         
333         * dbus/dbus-message.c: (dbus_message_get_service):
334         * dbus/dbus-message.h:  New function.
335
336         * dbus/dbus-server.c: Fix small doc typo.
337         
338         * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
339
340 2003-01-19  Anders Carlsson  <andersca@codefactory.se>
341
342         * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
343         of the string, just as long as specified.
344
345 2003-01-19  Havoc Pennington  <hp@pobox.com>
346
347         * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
348         new function
349
350         * dbus/dbus-server.c (dbus_server_set_max_connections)
351         (dbus_server_get_max_connections, dbus_server_get_n_connections):
352         keep track of current number of connections, and add API for
353         setting a max (but haven't implemented enforcing the max yet)
354
355 2003-01-18  Havoc Pennington  <hp@pobox.com>
356
357         * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
358         reading/writing if read_watch != NULL or write_watch != NULL.
359
360         * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
361         the message loader code to actually load message->header and
362         message->body into the newly-created message.
363
364         * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
365         in OOM case
366
367         * dbus/dbus-connection.c (dbus_connection_set_max_message_size) 
368         (dbus_connection_get_max_message_size) 
369         (dbus_connection_set_max_live_messages_size) 
370         (dbus_connection_get_max_live_messages_size): implement some
371         resource limitation functions
372
373         * dbus/dbus-resources.c: new file implementing some of the
374         resource limits stuff
375
376         * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
377         missing docs, add @todo to handle OOM etc.
378
379         * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
380         docs
381         
382 2003-01-18  Havoc Pennington  <hp@pobox.com>
383
384         * dbus/dbus-connection.c (dbus_connection_unref): disconnect the 
385         connection if it hasn't been already.
386
387         * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
388         replace with DisconnectFunction.
389
390 2003-01-18  Havoc Pennington  <hp@pobox.com>
391
392         Building --disable-verbose-mode --disable-asserts --disable-tests
393         cuts the library from 112K to 45K or so
394         
395         * configure.in: check for varargs macro support, 
396         add --enable-verbose-mode, --enable-asserts. 
397
398         * dbus/dbus-internals.h (_dbus_assert): support
399         DBUS_DISABLE_ASSERT
400         (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
401
402 2003-01-18  Havoc Pennington  <hp@pobox.com>
403
404         * dbus/dbus-test.c: include config.h so that tests actually run
405
406         * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
407         so the failure mode when that assumption fails will be plenty
408         obvious.
409
410 2003-01-18  Havoc Pennington  <hp@pobox.com>
411
412         * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
413
414         * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
415         the distribution
416
417         * test/Makefile.am: don't use special variable "TESTS" for echo-*
418         since we don't want to use those in make check
419
420 2003-01-15  Havoc Pennington  <hp@redhat.com>
421
422         Release 0.2
423         
424         * NEWS: update
425
426 2003-01-15  Havoc Pennington  <hp@redhat.com>
427
428         * test/Makefile.am: fix so that test source code ends up in the
429         distribution on make distcheck
430
431 2003-01-15  Havoc Pennington  <hp@redhat.com>
432
433         Release 0.1.
434         
435         * NEWS: update  
436
437 2003-01-15  Havoc Pennington  <hp@redhat.com>
438
439         * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
440         fix build when --disable-tests
441
442         * Makefile.am (EXTRA_DIST): put HACKING in here
443
444         * HACKING: document procedure for making a tarball release.
445
446 2003-01-14  Anders Carlsson  <andersca@codefactory.se>
447
448         * bus/connection.c: (connection_error_handler),
449         (bus_connection_setup):
450         * bus/main.c: (main):
451         Make sure that the DBusConnectionData struct is NULLed
452         out to prevent a segfault.
453         
454         * dbus/dbus-errors.c: (dbus_result_to_string):
455         * dbus/dbus-errors.h:
456         * dbus/dbus-message.c: (dbus_message_get_fields),
457         (dbus_message_get_fields_valist), (_dbus_message_test):
458         * dbus/dbus-message.h:
459         Make dbus_message_get_fields return a result code so we can
460         track invalid fields as well as oom.
461         
462 2003-01-11  Havoc Pennington  <hp@pobox.com>
463
464         * configure.in: change --enable-test/--enable-ansi action-if-given
465         to enable_foo=$enableval instead of enable_foo=yes
466
467 2003-01-08  Havoc Pennington  <hp@pobox.com>
468
469         * dbus/dbus-string.c (_dbus_string_align_length): new function
470
471         * dbus/dbus-test-main.c: move main() for test app here
472         * dbus/dbus-test.c
473         (dbus_internal_symbol_do_not_use_run_tests): we have to export a
474         symbol to run tests, because dbus-test isn't in the main 
475         library
476
477         Code review nitpicks.
478         
479         * dbus/dbus-message.c (dbus_message_write_header): add newlines
480         for people with narrow emacs ;-). Assert client_serial was filled
481         in. Assert message->name != NULL.
482         (dbus_message_append_fields): have "first_field_type" arg separate
483         from va list, needed for C++ binding that also uses varargs IIRC
484         and helps with type safety
485         (dbus_message_new): add @todo about using DBusString to store
486         service/name internally
487         (dbus_message_new): don't leak ->service and ->name on OOM later
488         in the function
489         (dbus_message_unref): free the service name
490         (dbus_message_get_fields): same change to varargs
491         i.e. first_field_type
492         (_dbus_message_loader_return_buffer): assert that the message data
493         is aligned (if not it's a bug in our code). Put in verbose griping
494         about why we set corrupted = TRUE.
495         (decode_header_data): add FIXME that char* is evil.  Was going to
496         add FIXME about evil locale-specific string.h strncmp, but just
497         switched to wacky string-as-uint32 optimization. Move check for
498         "no room for field name" above get_const_data_len() to avoid
499         assertion failure in get_const_data_len if we have trailing 2
500         bytes or the like. Check for service and name fields being
501         provided twice. Don't leak service/name on error. Require field
502         names to be aligned to 4 bytes.
503
504         * dbus/dbus-marshal.c: move byte swap stuff to header
505         (_dbus_pack_int32): uscore-prefix
506         (_dbus_unpack_int32): uscore-prefix
507         (_dbus_unpack_uint32): export
508         (_dbus_demarshal_string): add @todo complaining about use of
509         memcpy()
510         (_dbus_marshal_get_field_end_pos): add @todo about bad error
511         handling allowing corrupt data to go unchecked
512
513 2003-01-08  Havoc Pennington  <hp@redhat.com>
514
515         * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write 
516         to the select() as needed for authentication. (should be using
517         _dbus_poll() not select, but for another day)
518
519         * dbus/dbus.h: include dbus/dbus-protocol.h
520
521 2003-01-08  Anders Carlsson  <andersca@codefactory.se>
522
523         * dbus/Makefile.am (dbusinclude_HEADERS): Install
524         dbus-connection.h
525
526 2003-01-08  Anders Carlsson  <andersca@codefactory.se>
527
528         * dbus/dbus-internals.c: (_dbus_type_to_string):
529         New function that returns a string describing a type.
530         
531         * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
532         * dbus/dbus-marshal.h:
533         * dbus/dbus-message.c: (dbus_message_get_fields_valist),
534         (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
535         (dbus_message_iter_get_byte_array):
536         * dbus/dbus-message.h:
537         Add new convenience functions for appending and getting message fields.
538         Also add demarshalling routines for byte arrays.
539
540 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
541
542         * dbus/dbus-connection-internal.h:
543         * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
544         (_dbus_connection_get_next_client_serial),
545         (dbus_connection_send_message):
546         * dbus/dbus-internals.h:
547         * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
548         (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
549         (_dbus_marshal_uint32), (_dbus_demarshal_double),
550         (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
551         (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
552         (_dbus_verbose_bytes), (_dbus_marshal_test):
553         * dbus/dbus-marshal.h:
554         * dbus/dbus-message-internal.h:
555         * dbus/dbus-message.c: (_dbus_message_set_client_serial),
556         (dbus_message_write_header), (_dbus_message_lock),
557         (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
558         (dbus_message_get_name), (dbus_message_append_int32),
559         (dbus_message_append_uint32), (dbus_message_append_double),
560         (dbus_message_append_string), (dbus_message_append_byte_array),
561         (dbus_message_get_fields_iter), (dbus_message_iter_ref),
562         (dbus_message_iter_unref), (dbus_message_iter_has_next),
563         (dbus_message_iter_next), (dbus_message_iter_get_field_type),
564         (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
565         (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
566         (decode_header_data), (_dbus_message_loader_return_buffer),
567         (message_iter_test), (_dbus_message_test):
568         * dbus/dbus-message.h:
569         * dbus/dbus-protocol.h:
570         * dbus/dbus-test.c: (main):
571         * dbus/dbus-test.h:
572         * glib/test-dbus-glib.c: (message_handler), (main):
573         * test/echo-client.c: (main):
574         * test/watch.c: (check_messages):
575         Make messages sendable and receivable for real.
576         
577 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
578
579         * dbus/dbus-marshal.c: (_dbus_marshal_double),
580         (_dbus_marshal_string), (_dbus_marshal_byte_array):
581         * dbus/dbus-message.c: (dbus_message_append_int32),
582         (dbus_message_append_uint32), (dbus_message_append_double),
583         (dbus_message_append_string), (dbus_message_append_byte_array):
584         Handle OOM restoration.
585         
586 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
587
588         * dbus/dbus-marshal.c: (_dbus_marshal_string),
589         (_dbus_demarshal_string), (_dbus_marshal_test):
590         * dbus/dbus-marshal.h:
591         * dbus/dbus-message.c: (dbus_message_get_name),
592         Document these functions.
593         
594         (dbus_message_append_int32), (dbus_message_append_uint32),
595         (dbus_message_append_double), (dbus_message_append_string),
596         (dbus_message_append_byte_array):
597         * dbus/dbus-message.h:
598         Add functions for adding message fields of different types.
599         
600         * dbus/dbus-protocol.h:
601         Add the different types.
602
603 2003-01-05  Havoc Pennington  <hp@pobox.com>
604
605         * bus/connection.c: implement routines for handling connections,
606         first thing is keeping a list of owned services on each connection
607         and setting up watches etc.
608
609         * bus/services.c: implement a mapping from service names to lists
610         of connections
611
612         * dbus/dbus-hash.c: add DBUS_HASH_POINTER
613
614         * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
615         to use static mutexes for global data
616
617         * dbus/dbus-connection.c (dbus_connection_set_data): add new
618         collection of functions to set/get application-specific data
619         on the DBusConnection.
620
621 2003-01-04  Havoc Pennington  <hp@pobox.com>
622
623         * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
624         (_dbus_poll): new function
625
626         * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
627         copied from GLib
628
629         * bus/loop.c: initial code for the daemon main loop
630
631 2003-01-04  Havoc Pennington  <hp@pobox.com>
632
633         * test/watch.c (error_handler): make it safe if the error handler 
634         is called multiple times (if we s/error handler/disconnect
635         handler/ we should just guarantee it's called only once)
636
637         * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
638         error handler on disconnect (it's quite possible we should
639         just change the error handler to a "disconnect handler," I'm 
640         not sure we have any other meaningful errors)
641
642         * configure.in: check for getpwnam_r
643
644         * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
645         dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
646         mechanism as in SASL spec, using socket credentials
647
648         * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
649         (_dbus_send_credentials_unix_socket): new function
650
651         * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
652         dbus_accept()
653         (_dbus_write): only check errno if <0 returned
654         (_dbus_write_two): ditto
655
656 2003-01-02  Anders Carlsson  <andersca@codefactory.se>
657
658         * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
659         (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
660         (_dbus_marshal_test):
661         * dbus/dbus-marshal.h:
662         Add _dbus_marshal_byte_array and rename _dbus_marshal_string
663         to _dbus_marshal_utf8_string. Also fix some tests.
664         
665 2002-12-28  Harri Porten  <porten@kde.org>
666
667         * configure.in: added check for C++ compiler and a very cheesy
668         check for the Qt integration
669
670         * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
671
672         * qt/Makefile.am: added 
673
674         * qt/.cvsignore: added  
675
676         * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
677         latter, added #ifdef QT_THREAD_SUPPORT guard.
678
679         * dbus/Makefile.am: added missing headers for make dist
680
681 2002-12-28  Kristian Rietveld  <kris@gtk.org>
682
683         * dbus/Makefile.am: fixup export-symbols-regex.
684
685 2002-12-27  Anders Carlsson  <andersca@codefactory.se>
686
687         * acinclude.m4: Add this file and put the 
688         PKG_CHECK_MODULE macro in it.
689
690 2002-12-27  Anders Carlsson  <andersca@codefactory.se>
691
692         * dbus/dbus-marshal.c: (_dbus_marshal_string),
693         (_dbus_demarshal_double), (_dbus_demarshal_int32),
694         (_dbus_demarshal_uint32), (_dbus_demarshal_string),
695         (_dbus_marshal_test):
696         Make the demarshalling routines align the pos argument.
697         Add string marshalling tests and fix the obvious bugs 
698         discovered.
699         
700 2002-12-26  Havoc Pennington  <hp@pobox.com>
701
702         * dbus/dbus-auth.c: fixes fixes fixes
703
704         * dbus/dbus-transport-unix.c: wire up support for
705         encoding/decoding data on the wire
706
707         * dbus/dbus-auth.c (_dbus_auth_encode_data) 
708         (_dbus_auth_decode_data): append to target string 
709         instead of nuking it.
710
711 2002-12-26  Havoc Pennington  <hp@pobox.com>
712
713         * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
714         WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
715         doh
716
717         * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
718         avoid swap_bytes() overhead (ignoring possible assembly stuff for 
719         now). Main point is because I wanted unpack_uint32 to implement
720         _dbus_verbose_bytes
721         (_dbus_verbose_bytes): new function
722
723         * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
724
725         * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
726         mechanism to handle a corrupt message stream
727         (_dbus_message_loader_new): fix preallocation to only prealloc, 
728         not prelengthen
729         
730         * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
731         (_dbus_string_test): enhance tests for copy/move and fix the
732         functions
733
734         * dbus/dbus-transport-unix.c: Hold references in more places to 
735         avoid reentrancy problems
736
737         * dbus/dbus-transport.c: ditto
738
739         * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
740         leak reference count in no-message case
741
742         * test/watch.c (do_mainloop): handle adding/removing watches
743         during iteration over the watches. Also, ref the connection/server
744         stored on a watch, so we don't try to mangle a destroyed one.
745
746         * dbus/dbus-transport-unix.c (do_authentication): perform
747         authentication
748
749         * dbus/dbus-auth.c (get_state): add a state
750         AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
751         (_dbus_auth_get_unused_bytes): append the unused bytes
752         to the passed in string, rather than prepend
753
754         * dbus/dbus-transport.c (_dbus_transport_init_base): create 
755         the auth conversation DBusAuth
756
757         * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
758         (_dbus_transport_new_for_domain_socket): when creating a
759         transport, pass in whether it's a client-side or server-side
760         transport so we know which DBusAuth to create
761
762 2002-12-03  Havoc Pennington  <hp@pobox.com>
763
764         * dbus/dbus-transport-unix.c (unix_finalize): finalize base
765         _after_ finalizing the derived members
766         (unix_connection_set): unref watch if we fail to add it
767
768         * dbus/dbus-connection.c (dbus_connection_unref): delete the
769         transport first, so that the connection owned by the 
770         transport will be valid as the transport finalizes.
771
772         * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
773         if necessary, and remove watches from the connection.
774         
775         * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
776         
777 2002-12-26  Anders Carlsson  <andersca@codefactory.se>
778
779         * dbus/dbus-marshal.c: (_dbus_marshal_string),
780         (_dbus_demarshal_double), (_dbus_demarshal_int32),
781         (_dbus_demarshal_uint32), (_dbus_demarshal_string),
782         (_dbus_marshal_test):
783         * dbus/dbus-marshal.h:
784         Add string marshal functions and have the demarshal functions
785         return the new position.
786         
787 2002-12-25  Havoc Pennington  <hp@pobox.com>
788
789         * doc/dbus-sasl-profile.txt: docs on the authentication protocol, 
790         it is a simple protocol that just maps directly to SASL.
791
792         * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
793         initial implementation, not actually used yet.
794         
795         * dbus/dbus-string.c (_dbus_string_find): new function
796         (_dbus_string_equal): new function
797         (_dbus_string_base64_encode): new function
798         (_dbus_string_base64_decode): new function
799
800 2002-12-25  Anders Carlsson  <andersca@codefactory.se>
801
802         * dbus/Makefile.am:
803         * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
804         (_dbus_marshal_int32), (_dbus_marshal_uint32),
805         (_dbus_demarshal_double), (_dbus_demarshal_int32),
806         (_dbus_demarshal_uint32), (_dbus_marshal_test):
807         * dbus/dbus-marshal.h:
808         * dbus/dbus-protocol.h:
809         * dbus/dbus-test.c: (main):
810         * dbus/dbus-test.h:
811         Add un-optimized marshalling/demarshalling routines.
812         
813 2002-12-25  Harri Porten  <porten@kde.org>
814
815         * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
816
817 2002-12-24  Zack Rusin  <zack@kde.org>
818
819         * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
820         * qt/dbus-qt.h: skeleton with two sample implemenatation of the
821         main loop stuff
822
823 2002-12-24  Havoc Pennington  <hp@pobox.com>
824
825         * glib/dbus-gthread.c: fix include
826
827         * glib/dbus-glib.h: rename DBusMessageHandler for now. 
828         I think glib API needs to change, though, as you don't 
829         want to use DBusMessageFunction, you want to use the 
830         DBusMessageHandler object. Probably 
831         dbus_connection_open_with_g_main_loop()
832         and dbus_connection_setup_g_main_loop() or something like that
833         (but think of better names...) that just create a connection 
834         that has watch/timeout functions etc. already set up.
835
836         * dbus/dbus-connection.c
837         (dbus_connection_send_message_with_reply): new function just to 
838         show how the message handler helps us deal with replies.
839
840         * dbus/dbus-list.c (_dbus_list_remove_last): new function
841
842         * dbus/dbus-string.c (_dbus_string_test): free a string that
843         wasn't
844
845         * dbus/dbus-hash.c: use memory pools for the hash entries
846         (rebuild_table): be more paranoid about overflow, and 
847         shrink table when we can
848         (_dbus_hash_test): reduce number of sprintfs and write
849         valid C89. Add tests for case where we grow and then 
850         shrink the hash table.
851
852         * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
853
854         * dbus/dbus-connection.c (dbus_connection_register_handler) 
855         (dbus_connection_unregister_handler): new functions
856
857         * dbus/dbus-message.c (dbus_message_get_name): new
858
859         * dbus/dbus-list.c: fix docs typo
860
861         * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
862         an object representing a handler for messages.
863
864 2002-12-16  Anders Carlsson  <andersca@codefactory.se>
865
866         * glib/dbus-glib.h:
867         * glib/dbus-gthread.c: (dbus_gthread_init):
868         Don't use the gdbus prefix for public functions.
869         
870 2002-12-16  Anders Carlsson  <andersca@codefactory.se>
871
872         * Makefile.am:
873         * configure.in:
874         Add GLib checks and fixup .pc files
875         
876         * glib/Makefile.am:
877         * glib/dbus-glib.h:
878         * glib/dbus-gmain.c: (gdbus_connection_prepare),
879         (gdbus_connection_check), (gdbus_connection_dispatch),
880         (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
881         (dbus_connection_gsource_new):
882         * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
883         (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
884         * glib/test-dbus-glib.c: (message_handler), (main):
885         Add GLib support.
886         
887 2002-12-15  Harri Porten  <porten@kde.org>
888
889         * autogen.sh: check for libtoolize before attempting to use it 
890         
891         * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
892         struct.
893         
894         * .cvsignore: ignore more stamp files
895
896         * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
897
898         * test/Makefile.am: added -I$(top_srcdir) to be able to compile
899         without make install.
900
901 2002-12-15  Havoc Pennington  <hp@pobox.com>
902
903         * dbus/dbus-threads.c: add thread stubs that a higher library
904         layer can fill in. e.g. the GLib wrapper might fill them in with
905         GThread stuff. We still need to use this thread API to
906         thread-safe-ize the library.
907
908 2002-12-12  Havoc Pennington  <hp@pobox.com>
909
910         * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
911         below new interfaces and include fewer system headers.
912
913         * dbus/dbus-sysdeps.c (_dbus_read): new function
914         (_dbus_write): new function
915         (_dbus_write_two): new function
916         (_dbus_connect_unix_socket): new function
917         (_dbus_listen_unix_socket): new function
918
919         * dbus/dbus-message-internal.h: change interfaces to use
920         DBusString
921
922 2002-12-11  Havoc Pennington  <hp@pobox.com>
923
924         * dbus/dbus-types.h: add dbus_unichar
925
926         * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
927
928         * dbus/dbus-connection.c (dbus_connection_send_message): return
929         TRUE on success
930
931         * dbus/dbus-transport.c: include dbus-watch.h   
932
933         * dbus/dbus-connection.c: include dbus-message-internal.h
934
935         * HACKING: add file with coding guidelines stuff.
936
937         * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
938         handling here, for security purposes (as in vsftpd). Not actually
939         using this class yet.
940
941         * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
942         system/libc usage here, as in vsftpd, for ease of auditing (and
943         should also simplify portability). Haven't actually moved all the
944         system/libc usage into here yet.
945         
946 2002-11-25  Havoc Pennington  <hp@pobox.com>
947
948         * dbus/dbus-internals.c (_dbus_verbose): fix to not 
949         always print the first verbose message.
950
951 2002-11-24  Havoc Pennington  <hp@pobox.com>
952
953         * test/echo-client.c, test/echo-server.c: cheesy test 
954         clients.
955         
956         * configure.in (AC_CHECK_FUNCS): check for writev
957
958         * dbus/dbus-message.c (_dbus_message_get_network_data): new
959         function
960
961         * dbus/dbus-list.c (_dbus_list_foreach): new function
962
963         * dbus/dbus-internals.c (_dbus_verbose): new function
964
965         * dbus/dbus-server.c, dbus/dbus-server.h: public object
966         representing a server that listens for connections.
967
968         * dbus/.cvsignore: create
969
970         * dbus/dbus-errors.h, dbus/dbus-errors.c:
971         public API for reporting errors
972
973         * dbus/dbus-connection.h, dbus/dbus-connection.c:
974         public object representing a connection that 
975         sends/receives messages. (Same object used for 
976         both client and server.)
977
978         * dbus/dbus-transport.h, dbus/dbus-transport.c:
979         Basic abstraction for different kinds of stream
980         that we might read/write messages from.
981
982 2002-11-23  Havoc Pennington  <hp@pobox.com>
983
984         * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN 
985         _DBUS_INT_MAX
986
987         * dbus/dbus-test.c (main): add list test, and include 
988         dbus-test.h as intended
989
990         * dbus/dbus-hash.c (_dbus_hash_table_remove_string) 
991         (_dbus_hash_table_remove_int): return value indicates 
992         whether the entry existed to remove
993
994         * dbus/dbus-list.c: add linked list utility class, 
995         with docs and tests
996
997         * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket 
998         array sometimes.
999
1000 2002-11-23  Havoc Pennington  <hp@pobox.com>
1001
1002         * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
1003         DBUS_END_DECLS to nothing, that should fix this once and for all
1004
1005         * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
1006
1007         * dbus/dbus-message.c, dbus/dbus-hash.c: 
1008         add some missing @brief
1009
1010 2002-11-23  Havoc Pennington  <hp@pobox.com>
1011
1012         * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS 
1013         to avoid confusing Doxygen
1014
1015         * dbus/dbus-hash.c: @} not }@
1016
1017         * dbus/dbus-message.c (struct DBusMessage): split out 
1018         internals docs
1019
1020 2002-11-23  Havoc Pennington  <hp@pobox.com>
1021
1022         * configure.in: pile on more warning flags if using gcc
1023
1024         * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have 
1025         to document static functions
1026
1027         * configure.in: add summary to end of configure so it 
1028         looks nice and attractive
1029
1030         * dbus/dbus-hash.c: finish implementation and write unit 
1031         tests and docs
1032
1033         * configure.in: add --enable-tests to enable unit tests
1034
1035         * dbus/dbus-test.c: test program to run unit tests 
1036         for all files in dbus/*, initially runs a test for 
1037         dbus-hash.c
1038         
1039         * dbus/dbus-internals.h: file to hold some internal utility stuff
1040
1041 2002-11-22  Havoc Pennington  <hp@redhat.com>
1042
1043         * dbus/dbus-hash.c: copy in Tcl hash table, not yet 
1044         "ported" away from Tcl
1045
1046         * dbus/dbus-types.h: header for types such as dbus_bool_t
1047
1048 2002-11-22  Havoc Pennington  <hp@redhat.com>
1049
1050         * dbus/dbus.h: fixups for doc warnings
1051
1052         * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up 
1053         macros
1054         (QUIET): make it quiet so we can see warnings
1055
1056         * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
1057
1058 2002-11-22  Havoc Pennington  <hp@redhat.com>
1059
1060         * Makefile.am: include "Doxyfile" target in all-local
1061
1062         * configure.in: generate the Doxyfile
1063
1064         * Doxyfile.in: move Doxyfile here, so we can use 
1065         configure to generate a Doxyfile with the right 
1066         version number etc.
1067
1068 2002-11-22  Havoc Pennington  <hp@redhat.com>
1069
1070         * dbus/dbus-message.c: move inline docs into .c file
1071
1072         * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
1073         so all docs are under doc/
1074         (MAN_EXTENSION): generate man pages. Use extension 
1075         ".3dbus" which matches ".3qt" on my system, 
1076         I guess this is OK, I don't know really.
1077         (FILE_PATTERNS): look for .c files not .h, makes sense
1078         for plain C I think
1079
1080 2002-11-22  Havoc Pennington  <hp@pobox.com>
1081
1082         * Makefile.am (SUBDIRS): rename subdir "server" to "bus" 
1083         because any app can be a server, and any app can be a client, 
1084         the bus is a special kind of server.
1085
1086 Thu Nov 21 23:35:31 2002  Zack Rusin  <zack@kde.org>
1087
1088         * Doxyfile : adding. Still needs Makefile rules to be generated
1089         automatically (just run "doxygen" in the toplevel dir for now to
1090         generate docs)
1091         
1092         * dbus/dbus-message.h : Adding sample docs (javadoc since
1093         resembles gtk-doc a little more)
1094
1095         * dbus/dbus.h : Adding sample docs
1096
1097 2002-11-21  Havoc Pennington  <hp@redhat.com>
1098
1099         * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION 
1100         so we can allow ourselves to include files directly, 
1101         instead of having to use dbus.h
1102
1103         * dbus/dbus.h: fill in
1104
1105         * dbus/dbus-message.h: sketch out a sample header file.
1106         Include griping if you include it directly instead of 
1107         via dbus.h
1108
1109         * dbus/dbus-macros.h: new file with macros for extern "C", 
1110         TRUE/FALSE, NULL, etc.
1111
1112         * doc/file-boilerplate.c: put include guards in here
1113
1114 2002-11-21  Havoc Pennington  <hp@redhat.com>
1115
1116         * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
1117
1118         * COPYING: include the GPL as well, and license code 
1119         under both AFL and GPL.
1120
1121 2002-11-21  Havoc Pennington  <hp@redhat.com>
1122
1123         * acconfig.h: get rid of this
1124
1125         * autogen.sh (run_configure): add --no-configure option
1126
1127         * configure.in: remove AC_ARG_PROGRAM to make
1128         autoconf complain less. add AC_PREREQ. 
1129         add AC_DEFINE third arg.
1130         
1131 2002-11-21  Anders Carlsson  <andersca@codefactory.se>
1132
1133         * doc/Makefile.am:
1134         Fix references so we can distcheck.
1135
1136 2002-11-21  Havoc Pennington  <hp@redhat.com>
1137
1138         * Initial module creation
1139