diff -pur dbus-0.92/dbus/dbus-connection.c dbus-0.92.new/dbus/dbus-connection.c --- dbus-0.92/dbus/dbus-connection.c 2006-08-17 01:30:15.000000000 +0300 +++ dbus-0.92.new/dbus/dbus-connection.c 2006-09-20 12:23:07.300247432 +0300 @@ -330,7 +330,7 @@ _dbus_connection_wakeup_mainloop (DBusCo * * @param connection the connection. * @param message the message to queue. - * @returns #TRUE on success. + * @returns #TRUE on success, #FALSE on out-of-memory. */ dbus_bool_t _dbus_connection_queue_received_message (DBusConnection *connection, @@ -1670,7 +1670,7 @@ _dbus_connection_open_internal (const ch * * @param address the address. * @param error address where an error can be returned. - * @returns new connection, or #NULL on failure. + * @returns new connection, or #NULL on failure or invalid parameters. */ DBusConnection* dbus_connection_open (const char *address, @@ -1700,7 +1700,7 @@ dbus_connection_open (const char *ad * * @param address the address. * @param error address where an error can be returned. - * @returns new connection, or #NULL on failure. + * @returns new connection, or #NULL on failure or invalid parameters. */ DBusConnection* dbus_connection_open_private (const char *address, @@ -1722,7 +1722,7 @@ dbus_connection_open_private (const char * Increments the reference count of a DBusConnection. * * @param connection the connection. - * @returns the connection. + * @returns the connection or #NULL if invalid connection was passed. */ DBusConnection * dbus_connection_ref (DBusConnection *connection) @@ -1992,7 +1992,7 @@ dbus_connection_get_is_authenticated (DB * connections returned from dbus_bus_get() it will be toggled on * by default. * - * @param connection the connection + * @param connection a valid connection * @param exit_on_disconnect #TRUE if _exit() should be called after a disconnect signal */ void @@ -2214,7 +2214,8 @@ _dbus_connection_send_preallocated_and_u * @param connection the connection * @param preallocated the preallocated resources * @param message the message to send - * @param client_serial return location for client serial assigned to the message + * @param client_serial return location for client serial assigned to + * the message; the pointer is unchanged on error. */ void dbus_connection_send_preallocated (DBusConnection *connection, @@ -2374,7 +2375,8 @@ reply_handler_timeout (void *data) * @param message the message to send * @param pending_return return location for a #DBusPendingCall object, or #NULLif connection is disconnected * @param timeout_milliseconds timeout in milliseconds or -1 for default - * @returns #FALSE if no memory, #TRUE otherwise. + * @returns #FALSE if no memory or if invalid parameters were passed, #TRUE + * otherwise. * */ dbus_bool_t @@ -2771,7 +2773,7 @@ _dbus_connection_block_pending_call (DBu * @param timeout_milliseconds timeout in milliseconds or -1 for default * @param error return location for error message * @returns the message that is the reply or #NULL with an error code if the - * function fails. + * function fails, or #NULL without an error code on invalid arguments. */ DBusMessage* dbus_connection_send_with_reply_and_block (DBusConnection *connection, @@ -2821,7 +2823,7 @@ dbus_connection_send_with_reply_and_bloc * * If you call this, you MUST call update_dispatch_status afterword... * - * @param connection the connection. + * @param connection a valid connection. */ DBusDispatchStatus _dbus_connection_flush_unlocked (DBusConnection *connection) @@ -2858,7 +2860,7 @@ _dbus_connection_flush_unlocked (DBusCon /** * Blocks until the outgoing message queue is empty. * - * @param connection the connection. + * @param connection a valid connection. */ void dbus_connection_flush (DBusConnection *connection) @@ -2988,7 +2990,8 @@ _dbus_connection_read_write_dispatch (DB * * @param connection the connection * @param timeout_milliseconds max time to block or -1 for infinite - * @returns #TRUE if the disconnect message has not been processed + * @returns #TRUE if the disconnect message has not been processed, or + * #FALSE on error. */ dbus_bool_t dbus_connection_read_write_dispatch (DBusConnection *connection, @@ -3013,7 +3016,8 @@ dbus_connection_read_write_dispatch (DBu * * @param connection the connection * @param timeout_milliseconds max time to block or -1 for infinite - * @returns #TRUE if the disconnect message has not been processed + * @returns #TRUE if the disconnect message has not been processed, or + * #FALSE on error. */ dbus_bool_t dbus_connection_read_write (DBusConnection *connection, @@ -3041,7 +3045,8 @@ dbus_connection_read_write (DBusConnecti * during a dbus_connection_dispatch(). * * @param connection the connection. - * @returns next message in the incoming queue. + * @returns next message in the incoming queue, or #NULL if there is + * no next message or invalid connection parameter was passed. */ DBusMessage* dbus_connection_borrow_message (DBusConnection *connection) @@ -3086,7 +3091,8 @@ dbus_connection_borrow_message (DBusConn * message from dbus_connection_borrow_message() was non-#NULL. * * @param connection the connection - * @param message the message from dbus_connection_borrow_message() + * @param message the message from dbus_connection_borrow_message(); + * the pointer is unchanged if invalid parameters were passed. */ void dbus_connection_return_message (DBusConnection *connection, @@ -3115,7 +3121,8 @@ dbus_connection_return_message (DBusConn * dbus_connection_pop_message(). * * @param connection the connection - * @param message the message from dbus_connection_borrow_message() + * @param message the message from dbus_connection_borrow_message(); + * the pointer is unchanged if invalid parameters were passed. */ void dbus_connection_steal_borrowed_message (DBusConnection *connection, @@ -3257,7 +3264,8 @@ _dbus_connection_putback_message_link_un * in the group is running. * * @param connection the connection. - * @returns next message in the incoming queue. + * @returns next message in the incoming queue, or #NULL if there is + * no message or invalid connection parameter was passed. */ DBusMessage* dbus_connection_pop_message (DBusConnection *connection) @@ -3466,7 +3474,8 @@ _dbus_connection_update_dispatch_status_ * dispatch any messages. * * @param connection the connection. - * @returns current dispatch status + * @returns current dispatch status, or DBUS_DISPATCH_COMPLETE if + * invalid connection was passed. */ DBusDispatchStatus dbus_connection_get_dispatch_status (DBusConnection *connection) @@ -3555,7 +3564,8 @@ _dbus_connection_run_builtin_filters_unl * our GSource is NO_RECURSE * * @param connection the connection - * @returns dispatch status + * @returns dispatch status, or DBUS_DISPATCH_COMPLETE if invalid + * connection was passed. */ DBusDispatchStatus dbus_connection_dispatch (DBusConnection *connection) @@ -3910,7 +3920,7 @@ dbus_connection_dispatch (DBusConnection * @param toggled_function function to notify of enable/disable * @param data data to pass to add_function and remove_function. * @param free_data_function function to be called to free the data. - * @returns #FALSE on failure (no memory) + * @returns #FALSE on failure (no memory or invalid parameters) */ dbus_bool_t dbus_connection_set_watch_functions (DBusConnection *connection, @@ -3992,7 +4002,7 @@ dbus_connection_set_watch_functions (DBu * @param toggled_function function to notify of enable/disable * @param data data to pass to add_function and remove_function. * @param free_data_function function to be called to free the data. - * @returns #FALSE on failure (no memory) + * @returns #FALSE on failure (no memory or invalid parameters) */ dbus_bool_t dbus_connection_set_timeout_functions (DBusConnection *connection, @@ -4192,7 +4202,8 @@ dbus_connection_get_unix_user (DBusConne * * @param connection the connection * @param pid return location for the process ID - * @returns #TRUE if uid is filled in with a valid process ID + * @returns #TRUE if uid is filled in with a valid process ID, and + * #FALSE on error. */ dbus_bool_t dbus_connection_get_unix_process_id (DBusConnection *connection, @@ -4271,7 +4282,8 @@ dbus_connection_set_unix_user_function ( * @param function function to handle messages * @param user_data user data to pass to the function * @param free_data_function function to use for freeing user data - * @returns #TRUE on success, #FALSE if not enough memory. + * @returns #TRUE on success, #FALSE if not enough memory or if invalid + * parameters were passed. */ dbus_bool_t dbus_connection_add_filter (DBusConnection *connection, @@ -4387,7 +4399,8 @@ dbus_connection_remove_filter (DBusConne * @param path a '/' delimited string of path elements * @param vtable the virtual table * @param user_data data to pass to functions in the vtable - * @returns #FALSE if not enough memory + * @returns #FALSE if not enough memory or invalid parameters were + * passed. */ dbus_bool_t dbus_connection_register_object_path (DBusConnection *connection, @@ -4430,7 +4443,8 @@ dbus_connection_register_object_path (DB * @param path a '/' delimited string of path elements * @param vtable the virtual table * @param user_data data to pass to functions in the vtable - * @returns #FALSE if not enough memory + * @returns #FALSE if not enough memory or invalid parameters were + * passed. */ dbus_bool_t dbus_connection_register_fallback (DBusConnection *connection, @@ -4470,7 +4484,8 @@ dbus_connection_register_fallback (DBusC * * @param connection the connection * @param path a '/' delimited string of path elements - * @returns #FALSE if not enough memory + * @returns #FALSE if not enough memory or invalid parameters were + * passed. */ dbus_bool_t dbus_connection_unregister_object_path (DBusConnection *connection, @@ -4502,7 +4517,8 @@ dbus_connection_unregister_object_path ( * @param connection the connection * @param path the path you registered with * @param data_p location to store the user data, or #NULL - * @returns #FALSE if not enough memory + * @returns #FALSE if not enough memory or invalid parameters were + * passed. */ dbus_bool_t dbus_connection_get_object_path_data (DBusConnection *connection, @@ -4539,7 +4555,8 @@ dbus_connection_get_object_path_data (DB * @param connection the connection * @param parent_path the path to list the child handlers of * @param child_entries returns #NULL-terminated array of children - * @returns #FALSE if no memory to allocate the child entries + * @returns #FALSE if no memory to allocate the child entries or if + * invalid parameters were passed. */ dbus_bool_t dbus_connection_list_registered (DBusConnection *connection, @@ -4621,7 +4638,8 @@ dbus_connection_free_data_slot (dbus_int * @param slot the slot number * @param data the data to store * @param free_data_func finalizer function for the data - * @returns #TRUE if there was enough memory to store the data + * @returns #TRUE if there was enough memory to store the data, and + * #FALSE on error. */ dbus_bool_t dbus_connection_set_data (DBusConnection *connection, @@ -4661,7 +4679,8 @@ dbus_connection_set_data (DBusConnection * * @param connection the connection * @param slot the slot to get data from - * @returns the data, or #NULL if not found + * @returns the data, or #NULL if not found or invalid connection + * was passed. */ void* dbus_connection_get_data (DBusConnection *connection, @@ -4718,7 +4737,8 @@ dbus_connection_set_max_message_size (DB * Gets the value set by dbus_connection_set_max_message_size(). * * @param connection the connection - * @returns the max size of a single message + * @returns the max size of a single message, or 0 if the connection + * parameter is invalid. */ long dbus_connection_get_max_message_size (DBusConnection *connection)