summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-marshal-basic.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'fd-passing'Thiago Macieira2009-07-161-0/+9
|\ | | | | | | | | | | | | Conflicts: dbus/dbus-connection.c dbus/dbus-message-util.c dbus/dbus-sysdeps-unix.c
| * unix-fd: add basic marshalling code for unix fdsLennart Poettering2009-05-201-0/+9
| | | | | | | | | | This is actually pretty boring since we store our fds as indexes that are stored as uint32_t's.
* | Bug 21161 - Update the FSF addressTobias Mueller2009-07-101-1/+1
|/ | | | | | No comment. Signed-off-by: Colin Walters <walters@verbum.org>
* Bug 20137 - Fix alignment usage when demarshaling basicsColin Walters2009-03-171-12/+28
| | | | | | | | | | | We can't safely type-pun from e.g. char * to DBusBasicValue *, because the latter has higher alignment requirements. Instead, create an explicit pointer for each case. Also, we mark each one volatile to sidestep strict aliasing issues, for the future when we turn on strict aliasing support. Original patch and review from Jay Estabrook <jay.estabrook@hp.com>.
* Various compiler warning fixesColin Walters2008-12-191-1/+1
|
* 2007-07-13 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-07-141-1/+1
| | | | * Add indent-tabs-mode: nil to all file headers.
* 2006-10-17 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-10-171-2/+2
| | | | | | * dbus/dbus-internals.c (_dbus_warn_check_failed): new function to be used for return_if_fail type warnings; prefixes the pid, and fatal by default.
* * dbus/dbus-internal.c: Add dbus_is_verbose so we can have moreJohn (J5) Palmieri2006-09-111-55/+52
| | | | | | | | complex debugging code * dbus/dbus-marshal-basic.c (_dbus_marshal_read_fixed_multi): Move between the test suite ifdefs (_dbus_verbose_bytes): return if verbosity is not enabled
* * doc/TODO, various source files: Audited todo's and FIXME's andJohn (J5) Palmieri2006-09-061-2/+4
| | | | | | prepended the ones we should be looking at with 1.0. Those prepended with 1.0? need clerification or might not be needed for 1.0
* Patches by Kjartan Maraas <kmaraas at gnome dot org>John (J5) Palmieri2006-08-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bus/services.c (bus_service_list_queued_owners): Add a pointer cast to fix compiler warning * dbus/dbus-dataslot.c (_dbus_data_slot_list_get): return a NULL instead of FALSE since the return type is not expecting a boolean * dbus/dbus-marshal-basic.c (_dbus_marshal_test): Remove unused variable * dbus/dbus-marshal-recursive-util.c (node_new): return a NULL instead of FALSE since the return type is not expecting a boolean * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new): Send a NULL into _dbus_transport_new_for_fd instead of a FALSE because we are expecting a pointer not a boolean * dbus/dbus-sysdeps-util.c (_dbus_get_tmpdir): add void as the parameter so some compilers don't complain * dbus/dbus-transport-unix.c (_dbus_transport_new_for_domain_socket, _dbus_transport_new_for_tcp_socket): Send a NULL into _dbus_transport_new_for_fd instead of a FALSE because we are expecting a pointer not a boolean * test/shell-test.c (test_command_line): cast the second argument to _dbus_list_append to avoid compiler warnings * test/test-names.c (main): remove unused variable * test/test-service.c (check_hello_from_self_reply): Initialize echo_message and echo_reply to NULL * test/test-shell-service.c (handle_echo): Remove unused variable and cast the third parameter passed to dbus_connection_get_object_path_data to avoid compiler warrnings * test/name-test/test-names.c (clear_message_queue): Remove unused function * test/name-test/test-pending-call-dispatch.c: Fix format string in printf
* 2006-07-17 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-07-171-0/+4
| | | | | * dbus/dbus-marshal-basic.c (_dbus_type_to_string): support 64-bit ints, reported by Owen Taylor
* 2005-03-09 Colin Walters <walters@verbum.org>Colin Walters2005-03-091-31/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-66/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-02-06 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-02-061-2/+5
| | | | | | | * dbus/dbus-message-factory.c (generate_special): more tests * dbus/dbus-marshal-validate.c (validate_body_helper): detect array length that exceeds the maximum
* 2005-01-28 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-281-2/+18
| | | | | | | | | | | | | * 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-27 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-281-4/+154
| | | | | | | | | | | * dbus/dbus-arch-deps.h.in: add 16/32-bit types * configure.in: find the right type for 16 and 32 bit ints as well as 64 * dbus/dbus-protocol.h (DBUS_TYPE_INT16, DBUS_TYPE_UINT16): add the 16-bit types so people don't have to stuff them in 32-bit or byte arrays.
* 2005-01-27 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-271-28/+49
| | | | | | | | | | * dbus/dbus-message.c: byteswap the message if you init an iterator to read/write from it * dbus/dbus-marshal-byteswap.c: new file implementing _dbus_marshal_byteswap() * dbus/dbus-marshal-basic.c: add _dbus_swap_array()
* 2005-01-17 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-171-0/+24
| | | | | | | | | | | * 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-17 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-171-9/+12
| | | | | | | | * dbus/dbus-types.h: hardcode dbus_bool_t to 32 bits * Throughout: modify DBUS_TYPE_BOOLEAN to be a 32-bit type instead of an 8-bit type. Now dbus_bool_t is the type to use whenever you are marshaling/unmarshaling a boolean.
* 2005-01-16 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-171-29/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * 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-0/+1
| | | | | | | | | | | | | | | | | * 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-33/+22
| | | | | | | | | | | | | | | * 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-54/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-99/+209
| | | | step is to do so.
* just when the file was looking all beautiful, add horrible hacky code toHavoc Pennington2005-01-031-7/+7
| | | | fixup array lengths after setting a value somewhere within the array.
* clean up the naming of dbus_marshal functionsHavoc Pennington2005-01-021-66/+61
|
* delete some more noise, put args in consistent order (a big bug trap sadly),Havoc Pennington2005-01-021-591/+648
| | | | and work on the set value stuff some
* implement _dbus_type_writer_write_reader() (to copy a block of values)Havoc Pennington2005-01-021-16/+33
| | | | | 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-8/+10
| | | | (address of the value passed in, so char**)
* chop dbus-marshal-basic in half and move it to be insertion rather than ↵Havoc Pennington2005-01-011-2042/+569
| | | | append based
* all types now unit tested and working.Havoc Pennington2005-01-011-6/+67
|
* add int64 to test suites, fix minor bug where marshaling assumed that ↵Havoc Pennington2005-01-011-5/+17
| | | | DBusOctets8 was aligned when passed in as a function argument
* - remove DICT typeHavoc Pennington2004-12-301-65/+2
| | | | | | | | - 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
* sync busted marshaling work in progressHavoc Pennington2004-12-281-7/+70
|
* 2004-12-19 Havoc Pennington <hp@redhat.com>Havoc Pennington2004-12-191-84/+119
| | | | | | | * 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/+2945