1 2003-01-27 Havoc Pennington <hp@pobox.com>
3 * dbus/dbus-mempool.c (time_for_size): replace printf with
6 * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
7 empty lines; fix the SAVE_LENGTH stuff to be
8 START_LENGTH/END_LENGTH so it actually works; couple other
11 * test/Makefile.am (dist-hook): add dist-hook for .message files
13 * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
14 can be constant or locked.
15 (_dbus_string_free): allow freeing a const string as
18 * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
20 * dbus/dbus-test-main.c (main): take an argument which is the
21 directory containing test data
23 * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
24 argument to this and load all the messages in test/data/
25 checking that they can be loaded or not loaded as appropriate.
27 2003-01-27 Anders Carlsson <andersca@codefactory.se>
29 * bus/dispatch.c: (bus_dispatch_message_handler):
30 Dispatch messages sent to services.
32 * bus/driver.c: (bus_driver_send_service_deleted),
33 (bus_driver_send_service_created), (bus_driver_send_service_lost),
34 (bus_driver_send_service_acquired):
35 Add helper functions for sending service related messages.
37 (bus_driver_send_welcome_message):
38 Send HELLO_REPLY instead of WELCOME.
40 (bus_driver_handle_list_services):
41 Send LIST_SERVICES_REPLY instead of SERVICES.
43 (bus_driver_handle_own_service),
44 (bus_driver_handle_service_exists):
47 (bus_driver_handle_message):
48 Invoke new message handlers.
50 (bus_driver_remove_connection):
51 Don't remove any services here since that's done automatically
52 by bus_service_remove_owner now.
55 New function signatures.
57 * bus/services.c: (bus_service_add_owner):
58 Send ServiceAcquired message if we're the only primary owner.
60 (bus_service_remove_owner):
61 Send ServiceAcquired/ServiceLost messages.
63 (bus_service_set_prohibit_replacement),
64 (bus_service_get_prohibit_replacement):
65 Functions for setting prohibit replacement.
67 (bus_service_has_owner):
68 New function that checks if a connection is in the owner queue of
72 Add new function signatures.
74 * dbus/dbus-list.c: (_dbus_list_test):
75 Add tests for _dbus_list_remove_last and traversing the list backwards.
78 Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
79 go any further, so return NULL then.
81 * dbus/dbus-protocol.h:
82 Add new messages, service flags and service replies.
84 2003-01-26 Havoc Pennington <hp@pobox.com>
86 * dbus/dbus-message-builder.c: implement, completely untested.
88 * test/data/*: add data to be used in testing.
89 ".message" files are our simple loadable text format.
90 ".message-raw" will be binary dumps of messages.
92 * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
94 2003-01-26 Havoc Pennington <hp@pobox.com>
96 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
98 * dbus/dbus-errors.c (dbus_result_to_string): add
101 * dbus/dbus-message-builder.c: new file, will contain code to load
102 up messages from files. Not implemented yet.
104 2003-01-26 Havoc Pennington <hp@pobox.com>
106 * dbus/dbus-message.c (dbus_message_set_sender): support deleting
107 the sender by setting to NULL
109 2003-01-26 Havoc Pennington <hp@pobox.com>
111 The unit tests pass, but otherwise untested. If it breaks, the
112 tests should have been better. ;-)
114 * bus/driver.c (bus_driver_handle_hello): return if we disconnect
117 * dbus/dbus-message.c: redo everything so we maintain
118 message->header as the only copy of the various fields.
119 This avoids the possibility of out-of-memory in some cases,
120 for example dbus_message_lock() can't run out of memory anymore,
121 and avoids extra copying. Figured I may as well go ahead and do
122 this since it was busted for dbus_message_lock to not return
123 failure on OOM, and dbus_message_write_header was totally
124 unchecked for OOM. Also fixed some random other bugs.
126 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
127 that strings are nul-terminated. Also, end_pos can be equal
128 to string length just not greater than, I think.
129 (_dbus_marshal_set_int32): new function
130 (_dbus_marshal_set_uint32): new function
131 (_dbus_marshal_set_string): new function
133 * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
134 a warning, init timeout_list to NULL
135 (dbus_connection_send_message): don't use uninitialized variable
138 * dbus/dbus-string.c (_dbus_string_replace_len): new function
140 2003-01-26 Anders Carlsson <andersca@codefactory.se>
142 * bus/driver.c: (bus_driver_handle_hello),
143 (bus_driver_send_welcome_message):
146 2003-01-26 Anders Carlsson <andersca@codefactory.se>
148 * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
149 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
150 (dbus_connection_unref):
151 * dbus/dbus-marshal.c: (_dbus_marshal_test):
152 * dbus/dbus-message.c: (dbus_message_unref),
155 (dbus_message_get_fields):
156 Remove debugging printout.
158 (_dbus_message_loader_return_buffer):
159 Don't store the header string.
161 (_dbus_message_test):
164 2003-01-26 Richard Hult <rhult@codefactory.se>
166 * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
167 the file descriptor list, since it can change under us.
169 2003-01-25 Anders Carlsson <andersca@codefactory.se>
171 * glib/dbus-gmain.c: (dbus_connection_prepare),
172 (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
173 (remove_watch), (dbus_connection_hookup_with_g_main):
174 Rewrite the glib handling to use its own GSource instead of a
175 GIOChannel so we can catch messages put in the queue while waiting
178 2003-01-25 Anders Carlsson <andersca@codefactory.se>
181 * bus/connection.c: (connection_disconnect_handler),
182 (connection_watch_callback), (bus_connection_setup):
183 * bus/dispatch.c: (send_one_message),
184 (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
185 (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
187 * bus/driver.c: (bus_driver_send_service_deleted),
188 (bus_driver_send_service_created), (bus_driver_handle_hello),
189 (bus_driver_send_welcome_message),
190 (bus_driver_handle_list_services), (bus_driver_remove_connection),
191 (bus_driver_handle_message):
193 Refactor code, put the message dispatching in its own file. Use
194 _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
197 2003-01-25 Anders Carlsson <andersca@codefactory.se>
199 * dbus/dbus-internals.h:
200 Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
202 * dbus/dbus-message.c: (dbus_message_get_sender):
203 * dbus/dbus-message.h:
204 Implement dbus_message_get_sender.
206 * dbus/dbus-protocol.h:
207 Add message and service defines.
209 2003-01-25 Anders Carlsson <andersca@codefactory.se>
211 * dbus/dbus-connection.c: (dbus_connection_send_message):
212 * dbus/dbus-message-internal.h:
213 * dbus/dbus-message.c: (_dbus_message_get_client_serial),
214 (dbus_message_write_header):
215 Remove _dbus_messag_unlock and don't set the client serial on a
216 message if one already exists.
218 2003-01-24 Havoc Pennington <hp@pobox.com>
220 * dbus/dbus-list.c (alloc_link): put a thread lock on the global
223 * bus/driver.c (bus_driver_handle_list_services): fix a leak
226 2003-01-25 Anders Carlsson <andersca@codefactory.se>
228 * dbus/dbus-list.c: (alloc_link), (free_link):
229 Use a memory pool for the links.
231 2003-01-25 Anders Carlsson <andersca@codefactory.se>
233 * bus/connection.c: (bus_connection_foreach):
235 Add new bus_connection_foreach function.
237 * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
238 Add function that broadcasts a message to all clients.
240 (bus_driver_send_service_created), (bus_driver_handle_hello),
241 (bus_driver_send_welcome_message),
242 (bus_driver_handle_list_services), (bus_driver_message_handler):
243 Implement functions that take care of listing services, and notifying
244 clients when new services are created.
246 * bus/services.c: (bus_services_list):
248 Add new function that returns an array of strings with the currently
253 Update copyright year.
255 2003-01-25 Anders Carlsson <andersca@codefactory.se>
257 * dbus/dbus-connection.c: (dbus_connection_send_message):
258 Unlock the message in case it was sent earlier.
260 (dbus_connection_send_message_with_reply_and_block):
261 Remove the reply message from the list.
263 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
264 Set array_len and new_pos correctly.
266 (_dbus_marshal_test):
269 * dbus/dbus-message-internal.h:
270 * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
271 New function that returns the reply serial.
273 (_dbus_message_unlock):
274 New function that unlocks a message and resets its header.
276 (dbus_message_append_string_array),
277 (dbus_message_get_fields_valist),
278 (dbus_message_iter_get_field_type),
279 (dbus_message_iter_get_string_array),
280 (dbus_message_get_fields),
281 (dbus_message_append_fields_valist):
282 Handle string arrays.
284 (dbus_message_set_sender):
285 Make this function public since the bus daemon needs it.
287 (decode_header_data):
288 Set the reply serial to -1 initially.
290 * dbus/dbus-message.h:
291 Add dbus_message_set_sender.
293 2003-01-24 Havoc Pennington <hp@pobox.com>
295 * doc/dbus-specification.sgml: add some stuff
297 2003-01-22 Havoc Pennington <hp@pobox.com>
299 * doc/dbus-specification.sgml: Start to document the protocol.
301 2003-01-22 Havoc Pennington <hp@pobox.com>
303 * dbus/dbus-connection.c
304 (dbus_connection_send_message_with_reply_and_block): add some @todo
306 * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
308 2003-01-21 Havoc Pennington <hp@pobox.com>
310 (patch untested because can't compile)
312 * bus/driver.c (create_unique_client_name): make this function
313 never recycle client names. Also, caller should initialize
316 * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
318 2003-01-21 Anders Carlsson <andersca@codefactory.se>
320 * dbus/dbus-marshal.c: (_dbus_marshal_double),
321 (_dbus_marshal_int32), (_dbus_marshal_uint32),
322 (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
323 (_dbus_marshal_double_array), (_dbus_marshal_string_array),
324 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
325 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
326 (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
327 * dbus/dbus-marshal.h:
328 * dbus/dbus-protocol.h:
329 Add support for marshalling and demarshalling integer, double
332 2003-01-21 Anders Carlsson <andersca@codefactory.se>
337 * bus/connection.c: (connection_disconnect_handler):
338 Remove the connection from the bus driver's list.
340 (connection_watch_callback): Dispatch messages.
342 (free_connection_data): Free connection name.
344 (bus_connection_setup): Add connection to the bus driver's list.
345 (bus_connection_remove_owned_service):
346 (bus_connection_set_name), (bus_connection_get_name):
347 Add functions for setting and getting the connection's name.
350 Add function headers.
352 * bus/driver.c: (create_unique_client_name),
353 (bus_driver_handle_hello_message),
354 (bus_driver_send_welcome_message), (bus_driver_message_handler),
355 (bus_driver_add_connection), (bus_driver_remove_connection):
358 * bus/services.c: (bus_service_free):
360 New file that handles communication and registreation with the bus
363 2003-01-21 Anders Carlsson <andersca@codefactory.se>
365 * dbus/dbus-connection.c: (dbus_connection_send_message):
366 Add a new client_serial parameter.
368 (dbus_connection_send_message_with_reply):
369 Remove a @todo since we've implemented the blocking function.
371 (dbus_connection_send_message_with_reply_and_block):
372 New function that sends a message and waits for a reply and
373 then returns the reply.
375 * dbus/dbus-connection.h:
378 * dbus/dbus-errors.c: (dbus_result_to_string):
379 * dbus/dbus-errors.h:
382 * dbus/dbus-message-internal.h:
383 * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
384 (_dbus_message_set_sender), (dbus_message_write_header),
385 (dbus_message_new_reply), (decode_header_data),
386 (_dbus_message_loader_return_buffer), (_dbus_message_test):
387 * dbus/dbus-message.h:
388 Add new functions that set the reply serial and sender.
389 Also marshal and demarshal them correctly and add test.
391 * dbus/dbus-protocol.h:
392 Add new DBUS_MESSAGE_TYPE_SENDER.
395 * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
396 (add_watch), (remove_watch), (add_timeout), (remove_timeout),
397 (dbus_connection_hookup_with_g_main):
398 * glib/test-dbus-glib.c: (main):
399 Rewrite to use GIOChannel and remove the GSource crack.
401 * test/echo-client.c: (main):
402 * test/watch.c: (check_messages):
403 Update for changed APIs
405 2003-01-19 Anders Carlsson <andersca@codefactory.se>
407 * dbus/Makefile.am: Add dbus-timeout.[cħ]
409 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
410 Create a DBusTimeoutList.
411 (dbus_connection_set_timeout_functions): Add new function to
412 set timeout callbacks
414 * dbus/dbus-connection.h: Add public DBusTimeout API.
416 * dbus/dbus-message.c: (dbus_message_get_service):
417 * dbus/dbus-message.h: New function.
419 * dbus/dbus-server.c: Fix small doc typo.
421 * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
423 2003-01-19 Anders Carlsson <andersca@codefactory.se>
425 * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
426 of the string, just as long as specified.
428 2003-01-19 Havoc Pennington <hp@pobox.com>
430 * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
433 * dbus/dbus-server.c (dbus_server_set_max_connections)
434 (dbus_server_get_max_connections, dbus_server_get_n_connections):
435 keep track of current number of connections, and add API for
436 setting a max (but haven't implemented enforcing the max yet)
438 2003-01-18 Havoc Pennington <hp@pobox.com>
440 * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
441 reading/writing if read_watch != NULL or write_watch != NULL.
443 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
444 the message loader code to actually load message->header and
445 message->body into the newly-created message.
447 * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
450 * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
451 (dbus_connection_get_max_message_size)
452 (dbus_connection_set_max_live_messages_size)
453 (dbus_connection_get_max_live_messages_size): implement some
454 resource limitation functions
456 * dbus/dbus-resources.c: new file implementing some of the
457 resource limits stuff
459 * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
460 missing docs, add @todo to handle OOM etc.
462 * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
465 2003-01-18 Havoc Pennington <hp@pobox.com>
467 * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
468 connection if it hasn't been already.
470 * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
471 replace with DisconnectFunction.
473 2003-01-18 Havoc Pennington <hp@pobox.com>
475 Building --disable-verbose-mode --disable-asserts --disable-tests
476 cuts the library from 112K to 45K or so
478 * configure.in: check for varargs macro support,
479 add --enable-verbose-mode, --enable-asserts.
481 * dbus/dbus-internals.h (_dbus_assert): support
483 (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
485 2003-01-18 Havoc Pennington <hp@pobox.com>
487 * dbus/dbus-test.c: include config.h so that tests actually run
489 * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
490 so the failure mode when that assumption fails will be plenty
493 2003-01-18 Havoc Pennington <hp@pobox.com>
495 * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
497 * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
500 * test/Makefile.am: don't use special variable "TESTS" for echo-*
501 since we don't want to use those in make check
503 2003-01-15 Havoc Pennington <hp@redhat.com>
509 2003-01-15 Havoc Pennington <hp@redhat.com>
511 * test/Makefile.am: fix so that test source code ends up in the
512 distribution on make distcheck
514 2003-01-15 Havoc Pennington <hp@redhat.com>
520 2003-01-15 Havoc Pennington <hp@redhat.com>
522 * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
523 fix build when --disable-tests
525 * Makefile.am (EXTRA_DIST): put HACKING in here
527 * HACKING: document procedure for making a tarball release.
529 2003-01-14 Anders Carlsson <andersca@codefactory.se>
531 * bus/connection.c: (connection_error_handler),
532 (bus_connection_setup):
533 * bus/main.c: (main):
534 Make sure that the DBusConnectionData struct is NULLed
535 out to prevent a segfault.
537 * dbus/dbus-errors.c: (dbus_result_to_string):
538 * dbus/dbus-errors.h:
539 * dbus/dbus-message.c: (dbus_message_get_fields),
540 (dbus_message_get_fields_valist), (_dbus_message_test):
541 * dbus/dbus-message.h:
542 Make dbus_message_get_fields return a result code so we can
543 track invalid fields as well as oom.
545 2003-01-11 Havoc Pennington <hp@pobox.com>
547 * configure.in: change --enable-test/--enable-ansi action-if-given
548 to enable_foo=$enableval instead of enable_foo=yes
550 2003-01-08 Havoc Pennington <hp@pobox.com>
552 * dbus/dbus-string.c (_dbus_string_align_length): new function
554 * dbus/dbus-test-main.c: move main() for test app here
556 (dbus_internal_symbol_do_not_use_run_tests): we have to export a
557 symbol to run tests, because dbus-test isn't in the main
560 Code review nitpicks.
562 * dbus/dbus-message.c (dbus_message_write_header): add newlines
563 for people with narrow emacs ;-). Assert client_serial was filled
564 in. Assert message->name != NULL.
565 (dbus_message_append_fields): have "first_field_type" arg separate
566 from va list, needed for C++ binding that also uses varargs IIRC
567 and helps with type safety
568 (dbus_message_new): add @todo about using DBusString to store
569 service/name internally
570 (dbus_message_new): don't leak ->service and ->name on OOM later
572 (dbus_message_unref): free the service name
573 (dbus_message_get_fields): same change to varargs
574 i.e. first_field_type
575 (_dbus_message_loader_return_buffer): assert that the message data
576 is aligned (if not it's a bug in our code). Put in verbose griping
577 about why we set corrupted = TRUE.
578 (decode_header_data): add FIXME that char* is evil. Was going to
579 add FIXME about evil locale-specific string.h strncmp, but just
580 switched to wacky string-as-uint32 optimization. Move check for
581 "no room for field name" above get_const_data_len() to avoid
582 assertion failure in get_const_data_len if we have trailing 2
583 bytes or the like. Check for service and name fields being
584 provided twice. Don't leak service/name on error. Require field
585 names to be aligned to 4 bytes.
587 * dbus/dbus-marshal.c: move byte swap stuff to header
588 (_dbus_pack_int32): uscore-prefix
589 (_dbus_unpack_int32): uscore-prefix
590 (_dbus_unpack_uint32): export
591 (_dbus_demarshal_string): add @todo complaining about use of
593 (_dbus_marshal_get_field_end_pos): add @todo about bad error
594 handling allowing corrupt data to go unchecked
596 2003-01-08 Havoc Pennington <hp@redhat.com>
598 * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
599 to the select() as needed for authentication. (should be using
600 _dbus_poll() not select, but for another day)
602 * dbus/dbus.h: include dbus/dbus-protocol.h
604 2003-01-08 Anders Carlsson <andersca@codefactory.se>
606 * dbus/Makefile.am (dbusinclude_HEADERS): Install
609 2003-01-08 Anders Carlsson <andersca@codefactory.se>
611 * dbus/dbus-internals.c: (_dbus_type_to_string):
612 New function that returns a string describing a type.
614 * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
615 * dbus/dbus-marshal.h:
616 * dbus/dbus-message.c: (dbus_message_get_fields_valist),
617 (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
618 (dbus_message_iter_get_byte_array):
619 * dbus/dbus-message.h:
620 Add new convenience functions for appending and getting message fields.
621 Also add demarshalling routines for byte arrays.
623 2003-01-07 Anders Carlsson <andersca@codefactory.se>
625 * dbus/dbus-connection-internal.h:
626 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
627 (_dbus_connection_get_next_client_serial),
628 (dbus_connection_send_message):
629 * dbus/dbus-internals.h:
630 * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
631 (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
632 (_dbus_marshal_uint32), (_dbus_demarshal_double),
633 (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
634 (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
635 (_dbus_verbose_bytes), (_dbus_marshal_test):
636 * dbus/dbus-marshal.h:
637 * dbus/dbus-message-internal.h:
638 * dbus/dbus-message.c: (_dbus_message_set_client_serial),
639 (dbus_message_write_header), (_dbus_message_lock),
640 (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
641 (dbus_message_get_name), (dbus_message_append_int32),
642 (dbus_message_append_uint32), (dbus_message_append_double),
643 (dbus_message_append_string), (dbus_message_append_byte_array),
644 (dbus_message_get_fields_iter), (dbus_message_iter_ref),
645 (dbus_message_iter_unref), (dbus_message_iter_has_next),
646 (dbus_message_iter_next), (dbus_message_iter_get_field_type),
647 (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
648 (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
649 (decode_header_data), (_dbus_message_loader_return_buffer),
650 (message_iter_test), (_dbus_message_test):
651 * dbus/dbus-message.h:
652 * dbus/dbus-protocol.h:
653 * dbus/dbus-test.c: (main):
655 * glib/test-dbus-glib.c: (message_handler), (main):
656 * test/echo-client.c: (main):
657 * test/watch.c: (check_messages):
658 Make messages sendable and receivable for real.
660 2003-01-07 Anders Carlsson <andersca@codefactory.se>
662 * dbus/dbus-marshal.c: (_dbus_marshal_double),
663 (_dbus_marshal_string), (_dbus_marshal_byte_array):
664 * dbus/dbus-message.c: (dbus_message_append_int32),
665 (dbus_message_append_uint32), (dbus_message_append_double),
666 (dbus_message_append_string), (dbus_message_append_byte_array):
667 Handle OOM restoration.
669 2003-01-07 Anders Carlsson <andersca@codefactory.se>
671 * dbus/dbus-marshal.c: (_dbus_marshal_string),
672 (_dbus_demarshal_string), (_dbus_marshal_test):
673 * dbus/dbus-marshal.h:
674 * dbus/dbus-message.c: (dbus_message_get_name),
675 Document these functions.
677 (dbus_message_append_int32), (dbus_message_append_uint32),
678 (dbus_message_append_double), (dbus_message_append_string),
679 (dbus_message_append_byte_array):
680 * dbus/dbus-message.h:
681 Add functions for adding message fields of different types.
683 * dbus/dbus-protocol.h:
684 Add the different types.
686 2003-01-05 Havoc Pennington <hp@pobox.com>
688 * bus/connection.c: implement routines for handling connections,
689 first thing is keeping a list of owned services on each connection
690 and setting up watches etc.
692 * bus/services.c: implement a mapping from service names to lists
695 * dbus/dbus-hash.c: add DBUS_HASH_POINTER
697 * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
698 to use static mutexes for global data
700 * dbus/dbus-connection.c (dbus_connection_set_data): add new
701 collection of functions to set/get application-specific data
702 on the DBusConnection.
704 2003-01-04 Havoc Pennington <hp@pobox.com>
706 * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
707 (_dbus_poll): new function
709 * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
712 * bus/loop.c: initial code for the daemon main loop
714 2003-01-04 Havoc Pennington <hp@pobox.com>
716 * test/watch.c (error_handler): make it safe if the error handler
717 is called multiple times (if we s/error handler/disconnect
718 handler/ we should just guarantee it's called only once)
720 * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
721 error handler on disconnect (it's quite possible we should
722 just change the error handler to a "disconnect handler," I'm
723 not sure we have any other meaningful errors)
725 * configure.in: check for getpwnam_r
727 * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
728 dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
729 mechanism as in SASL spec, using socket credentials
731 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
732 (_dbus_send_credentials_unix_socket): new function
734 * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
736 (_dbus_write): only check errno if <0 returned
737 (_dbus_write_two): ditto
739 2003-01-02 Anders Carlsson <andersca@codefactory.se>
741 * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
742 (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
743 (_dbus_marshal_test):
744 * dbus/dbus-marshal.h:
745 Add _dbus_marshal_byte_array and rename _dbus_marshal_string
746 to _dbus_marshal_utf8_string. Also fix some tests.
748 2002-12-28 Harri Porten <porten@kde.org>
750 * configure.in: added check for C++ compiler and a very cheesy
751 check for the Qt integration
753 * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
755 * qt/Makefile.am: added
757 * qt/.cvsignore: added
759 * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
760 latter, added #ifdef QT_THREAD_SUPPORT guard.
762 * dbus/Makefile.am: added missing headers for make dist
764 2002-12-28 Kristian Rietveld <kris@gtk.org>
766 * dbus/Makefile.am: fixup export-symbols-regex.
768 2002-12-27 Anders Carlsson <andersca@codefactory.se>
770 * acinclude.m4: Add this file and put the
771 PKG_CHECK_MODULE macro in it.
773 2002-12-27 Anders Carlsson <andersca@codefactory.se>
775 * dbus/dbus-marshal.c: (_dbus_marshal_string),
776 (_dbus_demarshal_double), (_dbus_demarshal_int32),
777 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
778 (_dbus_marshal_test):
779 Make the demarshalling routines align the pos argument.
780 Add string marshalling tests and fix the obvious bugs
783 2002-12-26 Havoc Pennington <hp@pobox.com>
785 * dbus/dbus-auth.c: fixes fixes fixes
787 * dbus/dbus-transport-unix.c: wire up support for
788 encoding/decoding data on the wire
790 * dbus/dbus-auth.c (_dbus_auth_encode_data)
791 (_dbus_auth_decode_data): append to target string
792 instead of nuking it.
794 2002-12-26 Havoc Pennington <hp@pobox.com>
796 * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
797 WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
800 * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
801 avoid swap_bytes() overhead (ignoring possible assembly stuff for
802 now). Main point is because I wanted unpack_uint32 to implement
804 (_dbus_verbose_bytes): new function
806 * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
808 * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
809 mechanism to handle a corrupt message stream
810 (_dbus_message_loader_new): fix preallocation to only prealloc,
813 * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
814 (_dbus_string_test): enhance tests for copy/move and fix the
817 * dbus/dbus-transport-unix.c: Hold references in more places to
818 avoid reentrancy problems
820 * dbus/dbus-transport.c: ditto
822 * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
823 leak reference count in no-message case
825 * test/watch.c (do_mainloop): handle adding/removing watches
826 during iteration over the watches. Also, ref the connection/server
827 stored on a watch, so we don't try to mangle a destroyed one.
829 * dbus/dbus-transport-unix.c (do_authentication): perform
832 * dbus/dbus-auth.c (get_state): add a state
833 AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
834 (_dbus_auth_get_unused_bytes): append the unused bytes
835 to the passed in string, rather than prepend
837 * dbus/dbus-transport.c (_dbus_transport_init_base): create
838 the auth conversation DBusAuth
840 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
841 (_dbus_transport_new_for_domain_socket): when creating a
842 transport, pass in whether it's a client-side or server-side
843 transport so we know which DBusAuth to create
845 2002-12-03 Havoc Pennington <hp@pobox.com>
847 * dbus/dbus-transport-unix.c (unix_finalize): finalize base
848 _after_ finalizing the derived members
849 (unix_connection_set): unref watch if we fail to add it
851 * dbus/dbus-connection.c (dbus_connection_unref): delete the
852 transport first, so that the connection owned by the
853 transport will be valid as the transport finalizes.
855 * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
856 if necessary, and remove watches from the connection.
858 * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
860 2002-12-26 Anders Carlsson <andersca@codefactory.se>
862 * dbus/dbus-marshal.c: (_dbus_marshal_string),
863 (_dbus_demarshal_double), (_dbus_demarshal_int32),
864 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
865 (_dbus_marshal_test):
866 * dbus/dbus-marshal.h:
867 Add string marshal functions and have the demarshal functions
868 return the new position.
870 2002-12-25 Havoc Pennington <hp@pobox.com>
872 * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
873 it is a simple protocol that just maps directly to SASL.
875 * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
876 initial implementation, not actually used yet.
878 * dbus/dbus-string.c (_dbus_string_find): new function
879 (_dbus_string_equal): new function
880 (_dbus_string_base64_encode): new function
881 (_dbus_string_base64_decode): new function
883 2002-12-25 Anders Carlsson <andersca@codefactory.se>
886 * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
887 (_dbus_marshal_int32), (_dbus_marshal_uint32),
888 (_dbus_demarshal_double), (_dbus_demarshal_int32),
889 (_dbus_demarshal_uint32), (_dbus_marshal_test):
890 * dbus/dbus-marshal.h:
891 * dbus/dbus-protocol.h:
892 * dbus/dbus-test.c: (main):
894 Add un-optimized marshalling/demarshalling routines.
896 2002-12-25 Harri Porten <porten@kde.org>
898 * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
900 2002-12-24 Zack Rusin <zack@kde.org>
902 * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
903 * qt/dbus-qt.h: skeleton with two sample implemenatation of the
906 2002-12-24 Havoc Pennington <hp@pobox.com>
908 * glib/dbus-gthread.c: fix include
910 * glib/dbus-glib.h: rename DBusMessageHandler for now.
911 I think glib API needs to change, though, as you don't
912 want to use DBusMessageFunction, you want to use the
913 DBusMessageHandler object. Probably
914 dbus_connection_open_with_g_main_loop()
915 and dbus_connection_setup_g_main_loop() or something like that
916 (but think of better names...) that just create a connection
917 that has watch/timeout functions etc. already set up.
919 * dbus/dbus-connection.c
920 (dbus_connection_send_message_with_reply): new function just to
921 show how the message handler helps us deal with replies.
923 * dbus/dbus-list.c (_dbus_list_remove_last): new function
925 * dbus/dbus-string.c (_dbus_string_test): free a string that
928 * dbus/dbus-hash.c: use memory pools for the hash entries
929 (rebuild_table): be more paranoid about overflow, and
930 shrink table when we can
931 (_dbus_hash_test): reduce number of sprintfs and write
932 valid C89. Add tests for case where we grow and then
933 shrink the hash table.
935 * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
937 * dbus/dbus-connection.c (dbus_connection_register_handler)
938 (dbus_connection_unregister_handler): new functions
940 * dbus/dbus-message.c (dbus_message_get_name): new
942 * dbus/dbus-list.c: fix docs typo
944 * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
945 an object representing a handler for messages.
947 2002-12-16 Anders Carlsson <andersca@codefactory.se>
950 * glib/dbus-gthread.c: (dbus_gthread_init):
951 Don't use the gdbus prefix for public functions.
953 2002-12-16 Anders Carlsson <andersca@codefactory.se>
957 Add GLib checks and fixup .pc files
961 * glib/dbus-gmain.c: (gdbus_connection_prepare),
962 (gdbus_connection_check), (gdbus_connection_dispatch),
963 (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
964 (dbus_connection_gsource_new):
965 * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
966 (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
967 * glib/test-dbus-glib.c: (message_handler), (main):
970 2002-12-15 Harri Porten <porten@kde.org>
972 * autogen.sh: check for libtoolize before attempting to use it
974 * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
977 * .cvsignore: ignore more stamp files
979 * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
981 * test/Makefile.am: added -I$(top_srcdir) to be able to compile
982 without make install.
984 2002-12-15 Havoc Pennington <hp@pobox.com>
986 * dbus/dbus-threads.c: add thread stubs that a higher library
987 layer can fill in. e.g. the GLib wrapper might fill them in with
988 GThread stuff. We still need to use this thread API to
989 thread-safe-ize the library.
991 2002-12-12 Havoc Pennington <hp@pobox.com>
993 * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
994 below new interfaces and include fewer system headers.
996 * dbus/dbus-sysdeps.c (_dbus_read): new function
997 (_dbus_write): new function
998 (_dbus_write_two): new function
999 (_dbus_connect_unix_socket): new function
1000 (_dbus_listen_unix_socket): new function
1002 * dbus/dbus-message-internal.h: change interfaces to use
1005 2002-12-11 Havoc Pennington <hp@pobox.com>
1007 * dbus/dbus-types.h: add dbus_unichar
1009 * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
1011 * dbus/dbus-connection.c (dbus_connection_send_message): return
1014 * dbus/dbus-transport.c: include dbus-watch.h
1016 * dbus/dbus-connection.c: include dbus-message-internal.h
1018 * HACKING: add file with coding guidelines stuff.
1020 * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
1021 handling here, for security purposes (as in vsftpd). Not actually
1022 using this class yet.
1024 * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
1025 system/libc usage here, as in vsftpd, for ease of auditing (and
1026 should also simplify portability). Haven't actually moved all the
1027 system/libc usage into here yet.
1029 2002-11-25 Havoc Pennington <hp@pobox.com>
1031 * dbus/dbus-internals.c (_dbus_verbose): fix to not
1032 always print the first verbose message.
1034 2002-11-24 Havoc Pennington <hp@pobox.com>
1036 * test/echo-client.c, test/echo-server.c: cheesy test
1039 * configure.in (AC_CHECK_FUNCS): check for writev
1041 * dbus/dbus-message.c (_dbus_message_get_network_data): new
1044 * dbus/dbus-list.c (_dbus_list_foreach): new function
1046 * dbus/dbus-internals.c (_dbus_verbose): new function
1048 * dbus/dbus-server.c, dbus/dbus-server.h: public object
1049 representing a server that listens for connections.
1051 * dbus/.cvsignore: create
1053 * dbus/dbus-errors.h, dbus/dbus-errors.c:
1054 public API for reporting errors
1056 * dbus/dbus-connection.h, dbus/dbus-connection.c:
1057 public object representing a connection that
1058 sends/receives messages. (Same object used for
1059 both client and server.)
1061 * dbus/dbus-transport.h, dbus/dbus-transport.c:
1062 Basic abstraction for different kinds of stream
1063 that we might read/write messages from.
1065 2002-11-23 Havoc Pennington <hp@pobox.com>
1067 * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
1070 * dbus/dbus-test.c (main): add list test, and include
1071 dbus-test.h as intended
1073 * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
1074 (_dbus_hash_table_remove_int): return value indicates
1075 whether the entry existed to remove
1077 * dbus/dbus-list.c: add linked list utility class,
1080 * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
1083 2002-11-23 Havoc Pennington <hp@pobox.com>
1085 * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
1086 DBUS_END_DECLS to nothing, that should fix this once and for all
1088 * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
1090 * dbus/dbus-message.c, dbus/dbus-hash.c:
1091 add some missing @brief
1093 2002-11-23 Havoc Pennington <hp@pobox.com>
1095 * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
1096 to avoid confusing Doxygen
1098 * dbus/dbus-hash.c: @} not }@
1100 * dbus/dbus-message.c (struct DBusMessage): split out
1103 2002-11-23 Havoc Pennington <hp@pobox.com>
1105 * configure.in: pile on more warning flags if using gcc
1107 * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
1108 to document static functions
1110 * configure.in: add summary to end of configure so it
1111 looks nice and attractive
1113 * dbus/dbus-hash.c: finish implementation and write unit
1116 * configure.in: add --enable-tests to enable unit tests
1118 * dbus/dbus-test.c: test program to run unit tests
1119 for all files in dbus/*, initially runs a test for
1122 * dbus/dbus-internals.h: file to hold some internal utility stuff
1124 2002-11-22 Havoc Pennington <hp@redhat.com>
1126 * dbus/dbus-hash.c: copy in Tcl hash table, not yet
1127 "ported" away from Tcl
1129 * dbus/dbus-types.h: header for types such as dbus_bool_t
1131 2002-11-22 Havoc Pennington <hp@redhat.com>
1133 * dbus/dbus.h: fixups for doc warnings
1135 * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
1137 (QUIET): make it quiet so we can see warnings
1139 * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
1141 2002-11-22 Havoc Pennington <hp@redhat.com>
1143 * Makefile.am: include "Doxyfile" target in all-local
1145 * configure.in: generate the Doxyfile
1147 * Doxyfile.in: move Doxyfile here, so we can use
1148 configure to generate a Doxyfile with the right
1151 2002-11-22 Havoc Pennington <hp@redhat.com>
1153 * dbus/dbus-message.c: move inline docs into .c file
1155 * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
1156 so all docs are under doc/
1157 (MAN_EXTENSION): generate man pages. Use extension
1158 ".3dbus" which matches ".3qt" on my system,
1159 I guess this is OK, I don't know really.
1160 (FILE_PATTERNS): look for .c files not .h, makes sense
1163 2002-11-22 Havoc Pennington <hp@pobox.com>
1165 * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
1166 because any app can be a server, and any app can be a client,
1167 the bus is a special kind of server.
1169 Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
1171 * Doxyfile : adding. Still needs Makefile rules to be generated
1172 automatically (just run "doxygen" in the toplevel dir for now to
1175 * dbus/dbus-message.h : Adding sample docs (javadoc since
1176 resembles gtk-doc a little more)
1178 * dbus/dbus.h : Adding sample docs
1180 2002-11-21 Havoc Pennington <hp@redhat.com>
1182 * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
1183 so we can allow ourselves to include files directly,
1184 instead of having to use dbus.h
1186 * dbus/dbus.h: fill in
1188 * dbus/dbus-message.h: sketch out a sample header file.
1189 Include griping if you include it directly instead of
1192 * dbus/dbus-macros.h: new file with macros for extern "C",
1193 TRUE/FALSE, NULL, etc.
1195 * doc/file-boilerplate.c: put include guards in here
1197 2002-11-21 Havoc Pennington <hp@redhat.com>
1199 * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
1201 * COPYING: include the GPL as well, and license code
1202 under both AFL and GPL.
1204 2002-11-21 Havoc Pennington <hp@redhat.com>
1206 * acconfig.h: get rid of this
1208 * autogen.sh (run_configure): add --no-configure option
1210 * configure.in: remove AC_ARG_PROGRAM to make
1211 autoconf complain less. add AC_PREREQ.
1212 add AC_DEFINE third arg.
1214 2002-11-21 Anders Carlsson <andersca@codefactory.se>
1217 Fix references so we can distcheck.
1219 2002-11-21 Havoc Pennington <hp@redhat.com>
1221 * Initial module creation