2003-01-07 Anders Carlsson <andersca@codefactory.se>
[platform/upstream/dbus.git] / ChangeLog
1 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
2
3         * dbus/dbus-connection-internal.h:
4         * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
5         (_dbus_connection_get_next_client_serial),
6         (dbus_connection_send_message):
7         * dbus/dbus-internals.h:
8         * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
9         (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
10         (_dbus_marshal_uint32), (_dbus_demarshal_double),
11         (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
12         (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
13         (_dbus_verbose_bytes), (_dbus_marshal_test):
14         * dbus/dbus-marshal.h:
15         * dbus/dbus-message-internal.h:
16         * dbus/dbus-message.c: (_dbus_message_set_client_serial),
17         (dbus_message_write_header), (_dbus_message_lock),
18         (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
19         (dbus_message_get_name), (dbus_message_append_int32),
20         (dbus_message_append_uint32), (dbus_message_append_double),
21         (dbus_message_append_string), (dbus_message_append_byte_array),
22         (dbus_message_get_fields_iter), (dbus_message_iter_ref),
23         (dbus_message_iter_unref), (dbus_message_iter_has_next),
24         (dbus_message_iter_next), (dbus_message_iter_get_field_type),
25         (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
26         (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
27         (decode_header_data), (_dbus_message_loader_return_buffer),
28         (message_iter_test), (_dbus_message_test):
29         * dbus/dbus-message.h:
30         * dbus/dbus-protocol.h:
31         * dbus/dbus-test.c: (main):
32         * dbus/dbus-test.h:
33         * glib/test-dbus-glib.c: (message_handler), (main):
34         * test/echo-client.c: (main):
35         * test/watch.c: (check_messages):
36         Make messages sendable and receivable for real.
37         
38 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
39
40         * dbus/dbus-marshal.c: (_dbus_marshal_double),
41         (_dbus_marshal_string), (_dbus_marshal_byte_array):
42         * dbus/dbus-message.c: (dbus_message_append_int32),
43         (dbus_message_append_uint32), (dbus_message_append_double),
44         (dbus_message_append_string), (dbus_message_append_byte_array):
45         Handle OOM restoration.
46         
47 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
48
49         * dbus/dbus-marshal.c: (_dbus_marshal_string),
50         (_dbus_demarshal_string), (_dbus_marshal_test):
51         * dbus/dbus-marshal.h:
52         * dbus/dbus-message.c: (dbus_message_get_name),
53         Document these functions.
54         
55         (dbus_message_append_int32), (dbus_message_append_uint32),
56         (dbus_message_append_double), (dbus_message_append_string),
57         (dbus_message_append_byte_array):
58         * dbus/dbus-message.h:
59         Add functions for adding message fields of different types.
60         
61         * dbus/dbus-protocol.h:
62         Add the different types.
63
64 2003-01-05  Havoc Pennington  <hp@pobox.com>
65
66         * bus/connection.c: implement routines for handling connections,
67         first thing is keeping a list of owned services on each connection
68         and setting up watches etc.
69
70         * bus/services.c: implement a mapping from service names to lists
71         of connections
72
73         * dbus/dbus-hash.c: add DBUS_HASH_POINTER
74
75         * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
76         to use static mutexes for global data
77
78         * dbus/dbus-connection.c (dbus_connection_set_data): add new
79         collection of functions to set/get application-specific data
80         on the DBusConnection.
81
82 2003-01-04  Havoc Pennington  <hp@pobox.com>
83
84         * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
85         (_dbus_poll): new function
86
87         * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
88         copied from GLib
89
90         * bus/loop.c: initial code for the daemon main loop
91
92 2003-01-04  Havoc Pennington  <hp@pobox.com>
93
94         * test/watch.c (error_handler): make it safe if the error handler 
95         is called multiple times (if we s/error handler/disconnect
96         handler/ we should just guarantee it's called only once)
97
98         * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
99         error handler on disconnect (it's quite possible we should
100         just change the error handler to a "disconnect handler," I'm 
101         not sure we have any other meaningful errors)
102
103         * configure.in: check for getpwnam_r
104
105         * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
106         dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
107         mechanism as in SASL spec, using socket credentials
108
109         * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
110         (_dbus_send_credentials_unix_socket): new function
111
112         * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
113         dbus_accept()
114         (_dbus_write): only check errno if <0 returned
115         (_dbus_write_two): ditto
116
117 2003-01-02  Anders Carlsson  <andersca@codefactory.se>
118
119         * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
120         (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
121         (_dbus_marshal_test):
122         * dbus/dbus-marshal.h:
123         Add _dbus_marshal_byte_array and rename _dbus_marshal_string
124         to _dbus_marshal_utf8_string. Also fix some tests.
125         
126 2002-12-28  Harri Porten  <porten@kde.org>
127
128         * configure.in: added check for C++ compiler and a very cheesy
129         check for the Qt integration
130
131         * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
132
133         * qt/Makefile.am: added 
134
135         * qt/.cvsignore: added  
136
137         * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
138         latter, added #ifdef QT_THREAD_SUPPORT guard.
139
140         * dbus/Makefile.am: added missing headers for make dist
141
142 2002-12-28  Kristian Rietveld  <kris@gtk.org>
143
144         * dbus/Makefile.am: fixup export-symbols-regex.
145
146 2002-12-27  Anders Carlsson  <andersca@codefactory.se>
147
148         * acinclude.m4: Add this file and put the 
149         PKG_CHECK_MODULE macro in it.
150
151 2002-12-27  Anders Carlsson  <andersca@codefactory.se>
152
153         * dbus/dbus-marshal.c: (_dbus_marshal_string),
154         (_dbus_demarshal_double), (_dbus_demarshal_int32),
155         (_dbus_demarshal_uint32), (_dbus_demarshal_string),
156         (_dbus_marshal_test):
157         Make the demarshalling routines align the pos argument.
158         Add string marshalling tests and fix the obvious bugs 
159         discovered.
160         
161 2002-12-26  Havoc Pennington  <hp@pobox.com>
162
163         * dbus/dbus-auth.c: fixes fixes fixes
164
165         * dbus/dbus-transport-unix.c: wire up support for
166         encoding/decoding data on the wire
167
168         * dbus/dbus-auth.c (_dbus_auth_encode_data) 
169         (_dbus_auth_decode_data): append to target string 
170         instead of nuking it.
171
172 2002-12-26  Havoc Pennington  <hp@pobox.com>
173
174         * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
175         WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
176         doh
177
178         * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
179         avoid swap_bytes() overhead (ignoring possible assembly stuff for 
180         now). Main point is because I wanted unpack_uint32 to implement
181         _dbus_verbose_bytes
182         (_dbus_verbose_bytes): new function
183
184         * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
185
186         * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
187         mechanism to handle a corrupt message stream
188         (_dbus_message_loader_new): fix preallocation to only prealloc, 
189         not prelengthen
190         
191         * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
192         (_dbus_string_test): enhance tests for copy/move and fix the
193         functions
194
195         * dbus/dbus-transport-unix.c: Hold references in more places to 
196         avoid reentrancy problems
197
198         * dbus/dbus-transport.c: ditto
199
200         * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
201         leak reference count in no-message case
202
203         * test/watch.c (do_mainloop): handle adding/removing watches
204         during iteration over the watches. Also, ref the connection/server
205         stored on a watch, so we don't try to mangle a destroyed one.
206
207         * dbus/dbus-transport-unix.c (do_authentication): perform
208         authentication
209
210         * dbus/dbus-auth.c (get_state): add a state
211         AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
212         (_dbus_auth_get_unused_bytes): append the unused bytes
213         to the passed in string, rather than prepend
214
215         * dbus/dbus-transport.c (_dbus_transport_init_base): create 
216         the auth conversation DBusAuth
217
218         * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
219         (_dbus_transport_new_for_domain_socket): when creating a
220         transport, pass in whether it's a client-side or server-side
221         transport so we know which DBusAuth to create
222
223 2002-12-03  Havoc Pennington  <hp@pobox.com>
224
225         * dbus/dbus-transport-unix.c (unix_finalize): finalize base
226         _after_ finalizing the derived members
227         (unix_connection_set): unref watch if we fail to add it
228
229         * dbus/dbus-connection.c (dbus_connection_unref): delete the
230         transport first, so that the connection owned by the 
231         transport will be valid as the transport finalizes.
232
233         * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
234         if necessary, and remove watches from the connection.
235         
236         * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
237         
238 2002-12-26  Anders Carlsson  <andersca@codefactory.se>
239
240         * dbus/dbus-marshal.c: (_dbus_marshal_string),
241         (_dbus_demarshal_double), (_dbus_demarshal_int32),
242         (_dbus_demarshal_uint32), (_dbus_demarshal_string),
243         (_dbus_marshal_test):
244         * dbus/dbus-marshal.h:
245         Add string marshal functions and have the demarshal functions
246         return the new position.
247         
248 2002-12-25  Havoc Pennington  <hp@pobox.com>
249
250         * doc/dbus-sasl-profile.txt: docs on the authentication protocol, 
251         it is a simple protocol that just maps directly to SASL.
252
253         * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
254         initial implementation, not actually used yet.
255         
256         * dbus/dbus-string.c (_dbus_string_find): new function
257         (_dbus_string_equal): new function
258         (_dbus_string_base64_encode): new function
259         (_dbus_string_base64_decode): new function
260
261 2002-12-25  Anders Carlsson  <andersca@codefactory.se>
262
263         * dbus/Makefile.am:
264         * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
265         (_dbus_marshal_int32), (_dbus_marshal_uint32),
266         (_dbus_demarshal_double), (_dbus_demarshal_int32),
267         (_dbus_demarshal_uint32), (_dbus_marshal_test):
268         * dbus/dbus-marshal.h:
269         * dbus/dbus-protocol.h:
270         * dbus/dbus-test.c: (main):
271         * dbus/dbus-test.h:
272         Add un-optimized marshalling/demarshalling routines.
273         
274 2002-12-25  Harri Porten  <porten@kde.org>
275
276         * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
277
278 2002-12-24  Zack Rusin  <zack@kde.org>
279
280         * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
281         * qt/dbus-qt.h: skeleton with two sample implemenatation of the
282         main loop stuff
283
284 2002-12-24  Havoc Pennington  <hp@pobox.com>
285
286         * glib/dbus-gthread.c: fix include
287
288         * glib/dbus-glib.h: rename DBusMessageHandler for now. 
289         I think glib API needs to change, though, as you don't 
290         want to use DBusMessageFunction, you want to use the 
291         DBusMessageHandler object. Probably 
292         dbus_connection_open_with_g_main_loop()
293         and dbus_connection_setup_g_main_loop() or something like that
294         (but think of better names...) that just create a connection 
295         that has watch/timeout functions etc. already set up.
296
297         * dbus/dbus-connection.c
298         (dbus_connection_send_message_with_reply): new function just to 
299         show how the message handler helps us deal with replies.
300
301         * dbus/dbus-list.c (_dbus_list_remove_last): new function
302
303         * dbus/dbus-string.c (_dbus_string_test): free a string that
304         wasn't
305
306         * dbus/dbus-hash.c: use memory pools for the hash entries
307         (rebuild_table): be more paranoid about overflow, and 
308         shrink table when we can
309         (_dbus_hash_test): reduce number of sprintfs and write
310         valid C89. Add tests for case where we grow and then 
311         shrink the hash table.
312
313         * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
314
315         * dbus/dbus-connection.c (dbus_connection_register_handler) 
316         (dbus_connection_unregister_handler): new functions
317
318         * dbus/dbus-message.c (dbus_message_get_name): new
319
320         * dbus/dbus-list.c: fix docs typo
321
322         * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
323         an object representing a handler for messages.
324
325 2002-12-16  Anders Carlsson  <andersca@codefactory.se>
326
327         * glib/dbus-glib.h:
328         * glib/dbus-gthread.c: (dbus_gthread_init):
329         Don't use the gdbus prefix for public functions.
330         
331 2002-12-16  Anders Carlsson  <andersca@codefactory.se>
332
333         * Makefile.am:
334         * configure.in:
335         Add GLib checks and fixup .pc files
336         
337         * glib/Makefile.am:
338         * glib/dbus-glib.h:
339         * glib/dbus-gmain.c: (gdbus_connection_prepare),
340         (gdbus_connection_check), (gdbus_connection_dispatch),
341         (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
342         (dbus_connection_gsource_new):
343         * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
344         (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
345         * glib/test-dbus-glib.c: (message_handler), (main):
346         Add GLib support.
347         
348 2002-12-15  Harri Porten  <porten@kde.org>
349
350         * autogen.sh: check for libtoolize before attempting to use it 
351         
352         * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
353         struct.
354         
355         * .cvsignore: ignore more stamp files
356
357         * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
358
359         * test/Makefile.am: added -I$(top_srcdir) to be able to compile
360         without make install.
361
362 2002-12-15  Havoc Pennington  <hp@pobox.com>
363
364         * dbus/dbus-threads.c: add thread stubs that a higher library
365         layer can fill in. e.g. the GLib wrapper might fill them in with
366         GThread stuff. We still need to use this thread API to
367         thread-safe-ize the library.
368
369 2002-12-12  Havoc Pennington  <hp@pobox.com>
370
371         * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
372         below new interfaces and include fewer system headers.
373
374         * dbus/dbus-sysdeps.c (_dbus_read): new function
375         (_dbus_write): new function
376         (_dbus_write_two): new function
377         (_dbus_connect_unix_socket): new function
378         (_dbus_listen_unix_socket): new function
379
380         * dbus/dbus-message-internal.h: change interfaces to use
381         DBusString
382
383 2002-12-11  Havoc Pennington  <hp@pobox.com>
384
385         * dbus/dbus-types.h: add dbus_unichar
386
387         * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
388
389         * dbus/dbus-connection.c (dbus_connection_send_message): return
390         TRUE on success
391
392         * dbus/dbus-transport.c: include dbus-watch.h   
393
394         * dbus/dbus-connection.c: include dbus-message-internal.h
395
396         * HACKING: add file with coding guidelines stuff.
397
398         * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
399         handling here, for security purposes (as in vsftpd). Not actually
400         using this class yet.
401
402         * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
403         system/libc usage here, as in vsftpd, for ease of auditing (and
404         should also simplify portability). Haven't actually moved all the
405         system/libc usage into here yet.
406         
407 2002-11-25  Havoc Pennington  <hp@pobox.com>
408
409         * dbus/dbus-internals.c (_dbus_verbose): fix to not 
410         always print the first verbose message.
411
412 2002-11-24  Havoc Pennington  <hp@pobox.com>
413
414         * test/echo-client.c, test/echo-server.c: cheesy test 
415         clients.
416         
417         * configure.in (AC_CHECK_FUNCS): check for writev
418
419         * dbus/dbus-message.c (_dbus_message_get_network_data): new
420         function
421
422         * dbus/dbus-list.c (_dbus_list_foreach): new function
423
424         * dbus/dbus-internals.c (_dbus_verbose): new function
425
426         * dbus/dbus-server.c, dbus/dbus-server.h: public object
427         representing a server that listens for connections.
428
429         * dbus/.cvsignore: create
430
431         * dbus/dbus-errors.h, dbus/dbus-errors.c:
432         public API for reporting errors
433
434         * dbus/dbus-connection.h, dbus/dbus-connection.c:
435         public object representing a connection that 
436         sends/receives messages. (Same object used for 
437         both client and server.)
438
439         * dbus/dbus-transport.h, dbus/dbus-transport.c:
440         Basic abstraction for different kinds of stream
441         that we might read/write messages from.
442
443 2002-11-23  Havoc Pennington  <hp@pobox.com>
444
445         * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN 
446         _DBUS_INT_MAX
447
448         * dbus/dbus-test.c (main): add list test, and include 
449         dbus-test.h as intended
450
451         * dbus/dbus-hash.c (_dbus_hash_table_remove_string) 
452         (_dbus_hash_table_remove_int): return value indicates 
453         whether the entry existed to remove
454
455         * dbus/dbus-list.c: add linked list utility class, 
456         with docs and tests
457
458         * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket 
459         array sometimes.
460
461 2002-11-23  Havoc Pennington  <hp@pobox.com>
462
463         * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
464         DBUS_END_DECLS to nothing, that should fix this once and for all
465
466         * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
467
468         * dbus/dbus-message.c, dbus/dbus-hash.c: 
469         add some missing @brief
470
471 2002-11-23  Havoc Pennington  <hp@pobox.com>
472
473         * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS 
474         to avoid confusing Doxygen
475
476         * dbus/dbus-hash.c: @} not }@
477
478         * dbus/dbus-message.c (struct DBusMessage): split out 
479         internals docs
480
481 2002-11-23  Havoc Pennington  <hp@pobox.com>
482
483         * configure.in: pile on more warning flags if using gcc
484
485         * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have 
486         to document static functions
487
488         * configure.in: add summary to end of configure so it 
489         looks nice and attractive
490
491         * dbus/dbus-hash.c: finish implementation and write unit 
492         tests and docs
493
494         * configure.in: add --enable-tests to enable unit tests
495
496         * dbus/dbus-test.c: test program to run unit tests 
497         for all files in dbus/*, initially runs a test for 
498         dbus-hash.c
499         
500         * dbus/dbus-internals.h: file to hold some internal utility stuff
501
502 2002-11-22  Havoc Pennington  <hp@redhat.com>
503
504         * dbus/dbus-hash.c: copy in Tcl hash table, not yet 
505         "ported" away from Tcl
506
507         * dbus/dbus-types.h: header for types such as dbus_bool_t
508
509 2002-11-22  Havoc Pennington  <hp@redhat.com>
510
511         * dbus/dbus.h: fixups for doc warnings
512
513         * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up 
514         macros
515         (QUIET): make it quiet so we can see warnings
516
517         * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
518
519 2002-11-22  Havoc Pennington  <hp@redhat.com>
520
521         * Makefile.am: include "Doxyfile" target in all-local
522
523         * configure.in: generate the Doxyfile
524
525         * Doxyfile.in: move Doxyfile here, so we can use 
526         configure to generate a Doxyfile with the right 
527         version number etc.
528
529 2002-11-22  Havoc Pennington  <hp@redhat.com>
530
531         * dbus/dbus-message.c: move inline docs into .c file
532
533         * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
534         so all docs are under doc/
535         (MAN_EXTENSION): generate man pages. Use extension 
536         ".3dbus" which matches ".3qt" on my system, 
537         I guess this is OK, I don't know really.
538         (FILE_PATTERNS): look for .c files not .h, makes sense
539         for plain C I think
540
541 2002-11-22  Havoc Pennington  <hp@pobox.com>
542
543         * Makefile.am (SUBDIRS): rename subdir "server" to "bus" 
544         because any app can be a server, and any app can be a client, 
545         the bus is a special kind of server.
546
547 Thu Nov 21 23:35:31 2002  Zack Rusin  <zack@kde.org>
548
549         * Doxyfile : adding. Still needs Makefile rules to be generated
550         automatically (just run "doxygen" in the toplevel dir for now to
551         generate docs)
552         
553         * dbus/dbus-message.h : Adding sample docs (javadoc since
554         resembles gtk-doc a little more)
555
556         * dbus/dbus.h : Adding sample docs
557
558 2002-11-21  Havoc Pennington  <hp@redhat.com>
559
560         * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION 
561         so we can allow ourselves to include files directly, 
562         instead of having to use dbus.h
563
564         * dbus/dbus.h: fill in
565
566         * dbus/dbus-message.h: sketch out a sample header file.
567         Include griping if you include it directly instead of 
568         via dbus.h
569
570         * dbus/dbus-macros.h: new file with macros for extern "C", 
571         TRUE/FALSE, NULL, etc.
572
573         * doc/file-boilerplate.c: put include guards in here
574
575 2002-11-21  Havoc Pennington  <hp@redhat.com>
576
577         * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
578
579         * COPYING: include the GPL as well, and license code 
580         under both AFL and GPL.
581
582 2002-11-21  Havoc Pennington  <hp@redhat.com>
583
584         * acconfig.h: get rid of this
585
586         * autogen.sh (run_configure): add --no-configure option
587
588         * configure.in: remove AC_ARG_PROGRAM to make
589         autoconf complain less. add AC_PREREQ. 
590         add AC_DEFINE third arg.
591         
592 2002-11-21  Anders Carlsson  <andersca@codefactory.se>
593
594         * doc/Makefile.am:
595         Fix references so we can distcheck.
596
597 2002-11-21  Havoc Pennington  <hp@redhat.com>
598
599         * Initial module creation
600