summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-marshal-recursive.c
Commit message (Collapse)AuthorAgeFilesLines
* 2005-05-11 Colin Walters <walters@verbum.org>Colin Walters2005-05-111-0/+15
| | | | | | | | | | | | | | | | | * dbus/dbus-signature.c (dbus_signature_iter_get_signature): New function, returns signature string for signature iter. * dbus/dbus-signature.h: Prototype it. * dbus/dbus-message.c (dbus_message_iter_get_signature): New function, returns signature string for message iter. (dbus_message_iter_get_array_len): New function, returns length of array. (dbus_message_iter_get_fixed_array): Fix assertion; this function should be used when the iter is pointing to the contents of an array * dbus/dbus-message.h: Prototypes. * dbus/dbus-marshal-recursive.c (_dbus_type_reader_get_array_length): New function; returns length of an array. * dbus/dbus-marshal-recursive.h: Prototype it.
* 2005-03-09 Colin Walters <walters@verbum.org>Colin Walters2005-03-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * glib/dbus-gproxy.c (dbus_g_proxy_invoke): New method; calls to this are generated for client-side wrappers. Invokes a D-BUS method and returns reply values. * glib/dbus-binding-tool-glib.c (write_args_sig_for_direction): New function; writes signature string for argument direction. (write_args_for_direction): Change to pass input values directly instead of via address, and fix indentation. (generate_client_glue): Change to invoke dbus_g_proxy_invoke. Also make generated wrappers inlineable. * dbus/dbus-message.c (dbus_message_iter_get_fixed_array): Add note about using dbus_type_is_fixed. * dbus/dbus-marshal-basic.c (_dbus_type_is_fixed): Moved to dbus/dbus-signature.c as dbus_type_is_fixed. All callers updated. * dbus/dbus-signature.c (dbus_type_is_fixed): Moved here from dbus/dbus-marshal-basic.c:_dbus_type_is_fixed. * dbus/dbus-signature.h: Prototype. * glib/dbus-binding-tool-glib.c (compute_marshaller_name): Fix error printf code. * test/glib/test-dbus-glib.c (main): Be sure to clear error as appropriate instead of just freeing it. (main): Free returned strings using g_free. * test/glib/Makefile.am (test-service-glib-glue.h) (test-service-glib-bindings.h): Add dependency on dbus-binding-tool. * glib/dbus-gvalue.c (MAP_BASIC): Refactored from MAP_BASIC_INIT; simply maps a simple D-BUS type to GType. (dbus_dbus_type_to_gtype): Function which maps D-BUS type to GType. (dbus_gvalue_init): Just invoke dbus_dbus_type_to_gtype and initialize the value with it. (dbus_gvalue_binding_type_from_type): Unused, delete. (dbus_gvalue_demarshal): Switch to hardcoding demarshalling for various types instead of unmarshalling to value data directly. Remove can_convert boolean. (dbus_gvalue_marshal): Remove duplicate initialization; switch to returning directly instead of using can_convert boolean. (dbus_gvalue_store): New function; not related to D-BUS per-se. Stores a GValue in a pointer to a value of its corresponding C type. * glib/dbus-gvalue.h: Remove dbus_gvalue_binding_type_from_type, add dbus_gvalue_store.
* 2005-02-24 Colin Walters <walters@verbum.org>Colin Walters2005-02-241-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-signature.c: New file; implements various functions related to type signatures. Includes an interator for parsing, validation functions. (dbus_type_is_basic): Moved here from dbus-marshal-basic.c:_dbus_type_is_basic. (dbus_type_is_container): Moved here from dbus-marshal-basic.c:_dbus_type_is_container. All callers of _dbus_type_is_container and _dbus_type_is_basic updated, and include dbus-signature.h. * dbus/dbus-signature.h: New file; prototypes for the above. * dbus/Makefile.am (DBUS_LIB_SOURCES): Add dbus-signature.c, dbus-signature.h. * dbus/dbus-marshal-basic.c (map_type_char_to_type): New utility function factored out of _dbus_first_type_in_signature. (_dbus_first_type_in_signature_c_str): New function; returns first type code for a type signature character. * dbus/dbus-marshal-basic.h: Prototype _dbus_first_type_in_signature_c_str, handle function moves. * dbus/dbus-marshal-recursive.h: Export _dbus_type_signature_next. * dbus/dbus-marshal-recursive.c (_dbus_type_signature_next): New function; skips to next complete type in type signature. Implemented using previous skip_one_complete_type. Now skip_one_complete_type just delegates to _dbus_type_signature_next. * dbus/dbus-marshal-basic.c (_dbus_type_is_basic): Moved to dbus-signature.c (_dbus_type_is_container): Ditto. * doc/dbus-specification.xml: Update introspection sample to use real type signatures. * dbus/dbus-test.h: Prototype signature test. * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): Run signature tests. * dbus/dbus-protocol.h (DBUS_ERROR_INVALID_SIGNATURE): New error.
* 2005-01-28 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-281-25/+127
| | | | | | | | | | | | | * doc/dbus-specification.xml: update to describe 16-bit types and dict entries * dbus/dbus-marshal-basic.c (_dbus_unpack_uint16): fix broken assertion * dbus/dbus-protocol.h (DBUS_TYPE_DICT_ENTRY): add DICT_ENTRY as a type * dbus/dbus-marshal-recursive.c: implement
* 2005-01-26 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-271-1/+1
| | | | | * dbus/dbus-marshal-validate-util.c: break this out (and fix build, apparently - nobody noticed?)
* 2005-01-24 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-241-1/+1
| | | | | | | * dbus/dbus-message-factory.c: more testing of message validation * dbus/dbus-protocol.h (DBUS_MINIMUM_HEADER_SIZE): move to this header
* 2005-01-17 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-171-38/+23
| | | | | | | | | | | * Throughout, align variant bodies according to the contained type, rather than always to 8. Should save a fair bit of space in message headers. * dbus/dbus-marshal-validate.c (_dbus_validate_body_with_reason): fix handling of case where p == end * doc/TODO: remove the dbus_bool_t item and variant alignment items
* 2005-01-16 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-171-2922/+1
| | | | | | | | | | | | | | | | | | | | | | | | This is about it on what can be disabled/deleted from libdbus easily, back below 150K anyhow. Deeper cuts are more work than just turning the code off as I've done here. * dbus/dbus-marshal-basic.c (_dbus_pack_int32): we don't need the signed int convenience funcs * dbus/dbus-internals.c (_dbus_verbose_real): omit when not in verbose mode * dbus/dbus-string-util.c, dbus/dbus-string.c: more breaking things out of libdbus * dbus/dbus-sysdeps.c, dbus/dbus-sysdeps-util.c: same * dbus/dbus-hash.c: purge the TWO_STRINGS crap (well, make it tests-enabled-only, though it should probably be deleted) * dbus/dbus-message-util.c: same stuff * dbus/dbus-auth-util.c: same stuff
* 2005-01-16 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-171-23/+7
| | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-internals.c (_dbus_real_assert): print the function name the assertion failed in * dbus/dbus-internals.h (_dbus_return_if_fail) (_dbus_return_val_if_fail): assert that the name of the function containing the check doesn't start with '_', since we only want to use checks on public functions * dbus/dbus-connection.c (_dbus_connection_ref_unlocked): change checks to assertions * dbus/dbus-marshal-header.c (_dbus_header_set_field_basic): change checks to asserts for private function * dbus/dbus-message.c (_dbus_message_set_serial): checks to asserts for private function * dbus/dbus-marshal-recursive.c (skip_one_complete_type): remove broken assertion that was breaking make check (_dbus_type_reader_array_is_empty): remove this rather than fix it, was only used in assertions
* 2005-01-16 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-161-43/+131
| | | | | | | | | | | | | | | | | * Add and fix docs according to Doxygen warnings throughout source. * dbus/dbus-marshal-recursive.c (_dbus_type_reader_array_is_empty): change this to just call array_reader_get_array_len() and make it static * dbus/dbus-message.c (dbus_message_iter_get_element_type): rename from get_array_type (dbus_message_iter_init_append): rename from append_iter_init * dbus/dbus-marshal-recursive.c (_dbus_type_reader_get_element_type): rename from _dbus_type_reader_get_array_type
* 2005-01-15 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-161-31/+52
| | | | | | | | | | | | | | | * test/glib/test-profile.c (with_bus_server_filter): fix crash * dbus/dbus-marshal-basic.c (_dbus_unpack_uint32): inline as macro when DBUS_DISABLE_ASSERT (_dbus_marshal_set_basic): be sure we align for the string length * dbus/dbus-marshal-recursive.c (skip_one_complete_type): make this look faster * dbus/dbus-string.c (_dbus_string_get_const_data_len): add an inline macro version (_dbus_string_set_byte): provide inline macro version
* 2005-01-15 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-151-180/+758
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Land the new message args API and type system. This patch is huge, but the public API change is not really large. The set of D-BUS types has changed somewhat, and the arg "getters" are more geared toward language bindings; they don't make a copy, etc. There are also some known issues. See these emails for details on this huge patch: http://lists.freedesktop.org/archives/dbus/2004-December/001836.html http://lists.freedesktop.org/archives/dbus/2005-January/001922.html * dbus/dbus-marshal-*: all the new stuff * dbus/dbus-message.c: basically rewritten * dbus/dbus-memory.c (check_guards): with "guards" enabled, init freed blocks to be all non-nul bytes so using freed memory is less likely to work right * dbus/dbus-internals.c (_dbus_test_oom_handling): add DBUS_FAIL_MALLOC=N environment variable, so you can do DBUS_FAIL_MALLOC=0 to skip the out-of-memory checking, or DBUS_FAIL_MALLOC=10 to make it really, really, really slow and thorough. * qt/message.cpp: port to the new message args API (operator<<): use str.utf8() rather than str.unicode() (pretty sure this is right from the Qt docs?) * glib/dbus-gvalue.c: port to the new message args API * bus/dispatch.c, bus/driver.c: port to the new message args API * dbus/dbus-string.c (_dbus_string_init_const_len): initialize the "locked" flag to TRUE and align_offset to 0; I guess we never looked at these anyhow, but seems cleaner. * dbus/dbus-string.h (_DBUS_STRING_ALLOCATION_PADDING): move allocation padding macro to this header; use it to implement (_DBUS_STRING_STATIC): ability to declare a static string. * dbus/dbus-message.c (_dbus_message_has_type_interface_member): change to return TRUE if the interface is not set. * dbus/dbus-string.[hc]: move the D-BUS specific validation stuff to dbus-marshal-validate.[hc] * dbus/dbus-marshal-basic.c (_dbus_type_to_string): move here from dbus-internals.c * dbus/Makefile.am: cut over from dbus-marshal.[hc] to dbus-marshal-*.[hc] * dbus/dbus-object-tree.c (_dbus_decompose_path): move this function here from dbus-marshal.c
* finish off my TODO list for stuff needed to port dbus-message.c. NextHavoc Pennington2005-01-031-82/+258
| | | | step is to do so.
* just when the file was looking all beautiful, add horrible hacky code toHavoc Pennington2005-01-031-97/+763
| | | | fixup array lengths after setting a value somewhere within the array.
* cleanup args to read func in test suiteHavoc Pennington2005-01-031-40/+40
|
* checkpoint set_variable_length workHavoc Pennington2005-01-031-146/+311
|
* values-only DBusTypeWriterHavoc Pennington2005-01-021-29/+142
|
* minor cleanupHavoc Pennington2005-01-021-48/+75
|
* clean up the naming of dbus_marshal functionsHavoc Pennington2005-01-021-38/+39
|
* delete some more noise, put args in consistent order (a big bug trap sadly),Havoc Pennington2005-01-021-51/+115
| | | | and work on the set value stuff some
* cleanups and fixesHavoc Pennington2005-01-021-73/+116
|
* implement _dbus_type_writer_write_reader() (to copy a block of values)Havoc Pennington2005-01-021-91/+249
| | | | | which is the first step toward a sane reimplementation of all that delete/modify and realign nonsense in dbus-message.c
* change strings to be marshaled consistently with the other basic types ↵Havoc Pennington2005-01-021-6/+9
| | | | (address of the value passed in, so char**)
* make reader const-correctHavoc Pennington2005-01-021-24/+58
|
* extend unit test to display progress and to verify that we are inserting not ↵Havoc Pennington2005-01-021-73/+225
| | | | appending in all cases
* add DBusTypeMarkHavoc Pennington2005-01-021-42/+188
|
* chop dbus-marshal-basic in half and move it to be insertion rather than ↵Havoc Pennington2005-01-011-67/+36
| | | | append based
* all types now unit tested and working.Havoc Pennington2005-01-011-49/+537
|
* add more "subclassing" to the test node classesHavoc Pennington2005-01-011-236/+106
|
* yay, variant values working before the new year.Havoc Pennington2005-01-011-45/+157
|
* minor tweakingHavoc Pennington2005-01-011-5/+70
|
* add int64 to test suites, fix minor bug where marshaling assumed that ↵Havoc Pennington2005-01-011-1/+97
| | | | DBusOctets8 was aligned when passed in as a function argument
* remove old unit test code, and clean up whitespaceHavoc Pennington2005-01-011-1496/+182
|
* test framework extensionHavoc Pennington2005-01-011-122/+378
|
* further extend testsHavoc Pennington2004-12-311-50/+469
|
* new test framework in placeHavoc Pennington2004-12-311-38/+611
|
* use vtable instead of flags for types only iteratorsHavoc Pennington2004-12-311-107/+144
|
* add "types only" TypeReader, will move to use a vtable instead of a flag in ↵Havoc Pennington2004-12-311-69/+136
| | | | a minute
* - add variant readerHavoc Pennington2004-12-301-2/+41
| | | | - further squish the iterator structs
* remove unused element_type_len fieldHavoc Pennington2004-12-301-1/+0
|
* - remove DICT typeHavoc Pennington2004-12-301-112/+183
| | | | | | | | - add SIGNATURE type - fix max name len of 256, should be 255 so it fits in a byte if it's going to be a number near 256 - generalize some of the recursive type marshaling code to share between arrays and variants - just started on implementing variant
* DBusTypeWriterClass isn't going to work well, so remove vestiges of it.Havoc Pennington2004-12-291-0/+10
|
* switch to a vtable approach for the readerHavoc Pennington2004-12-291-286/+362
|
* put it in the test suite arrays (ok, I need to rewrite the unit tests here ↵Havoc Pennington2004-12-291-1/+13
| | | | to be more automated...)
* struct of array of struct and array of struct of arrayHavoc Pennington2004-12-291-14/+361
|
* checkpoint with array-of-struct workingHavoc Pennington2004-12-291-231/+444
|
* arrays are working, wootHavoc Pennington2004-12-281-56/+125
|
* sync busted marshaling work in progressHavoc Pennington2004-12-281-126/+938
|
* 2004-12-19 Havoc Pennington <hp@redhat.com>Havoc Pennington2004-12-191-73/+289
| | | | | | | * dbus/dbus-string.c (_dbus_string_insert_4_aligned) (_dbus_string_insert_8_aligned): new functions * dbus/dbus-string.c (_dbus_string_alloc_space): new function
* back up some files I'm working on that don't do anything yetHavoc Pennington2004-12-191-0/+713