index.html
Main Page
|
modules.html
Modules
|
namespaces.html
Namespace List
|
hierarchy.html
Class Hierarchy
|
annotated.html
Data Structures
|
dirs.html
Directories
|
files.html
File List
|
namespacemembers.html
Namespace Members
|
functions.html
Data Fields
|
pages.html
Related Pages
DBusMessage implementation details
[
group__DBusInternals.html
D-BUS internal implementation details
]
structDBusMessage.html
DBusMessage
private implementation details.
#_details
More...
Data Structures
struct
structDBusMessageLoader.html
DBusMessageLoader
Implementation details of DBusMessageLoader.
structDBusMessageLoader.html#_details
More...
struct
structDBusMessage.html
DBusMessage
Internals of DBusMessage.
structDBusMessage.html#_details
More...
struct
structDBusMessageRealIter.html
DBusMessageRealIter
Internals of
structDBusMessageIter.html
DBusMessageIter
.
structDBusMessageRealIter.html#_details
More...
Defines
#define
group__DBusMessageInternals.html#ga33
CHANGED_STAMP_BITS
21
How many bits are in the changed_stamp used to validate iterators.
#define
group__DBusMessageInternals.html#ga34
ensure_byte_order
(message)
#define
group__DBusMessageInternals.html#ga35
INITIAL_LOADER_DATA_LEN
32
The initial buffer size of the message loader.
#ga35
Typedefs
typedef
structDBusMessageRealIter.html
DBusMessageRealIter
group__DBusMessageInternals.html#ga0
DBusMessageRealIter
typedef for internals of message iterator
typedef
structDBusMessageLoader.html
DBusMessageLoader
group__DBusMessageInternals.html#ga37
DBusMessageLoader
The
structDBusMessageLoader.html
DBusMessageLoader
object encapsulates the process of converting a byte stream into a series of
structDBusMessage.html
DBusMessage
.
#ga37
Enumerations
enum
{
DBUS_MESSAGE_ITER_TYPE_READER
=  3,
DBUS_MESSAGE_ITER_TYPE_WRITER
=  7
}
Functions
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessageInternals.html#ga2
_dbus_message_iter_get_args_valist
(
structDBusMessageIter.html
DBusMessageIter
*iter,
structDBusError.html
DBusError
*error, int first_arg_type, va_list var_args)
This function takes a va_list for use by language bindings and is otherwise the same as dbus_message_iter_get_args().
#ga2
group__DBusMessageInternals.html#ga3
_DBUS_STRING_DEFINE_STATIC
(_dbus_empty_signature_str,"")
An static string representing an empty signature.
void
group__DBusMessageInternals.html#ga6
_dbus_message_get_network_data
(
structDBusMessage.html
DBusMessage
*message, const
structDBusString.html
DBusString
**header, const
structDBusString.html
DBusString
**body)
Gets the data to be sent over the network for this message.
#ga6
void
group__DBusMessageInternals.html#ga7
_dbus_message_set_serial
(
structDBusMessage.html
DBusMessage
*message,
group__DBusTypes.html#ga3
dbus_uint32_t
serial)
Sets the serial number of a message.
#ga7
void
group__DBusMessageInternals.html#ga8
_dbus_message_add_size_counter_link
(
structDBusMessage.html
DBusMessage
*message,
structDBusList.html
DBusList
*link)
Adds a counter to be incremented immediately with the size of this message, and decremented by the size of this message when this message if finalized.
#ga8
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessageInternals.html#ga9
_dbus_message_add_size_counter
(
structDBusMessage.html
DBusMessage
*message,
structDBusCounter.html
DBusCounter
*counter)
Adds a counter to be incremented immediately with the size of this message, and decremented by the size of this message when this message if finalized.
#ga9
void
group__DBusMessageInternals.html#ga10
_dbus_message_remove_size_counter
(
structDBusMessage.html
DBusMessage
*message,
structDBusCounter.html
DBusCounter
*counter,
structDBusList.html
DBusList
**link_return)
Removes a counter tracking the size of this message, and decrements the counter by the size of this message.
#ga10
void
group__DBusMessageInternals.html#ga11
_dbus_message_lock
(
structDBusMessage.html
DBusMessage
*message)
Locks a message.
#ga11
structDBusMessageLoader.html
DBusMessageLoader
*
group__DBusMessageInternals.html#ga13
_dbus_message_loader_new
(void)
Creates a new message loader.
#ga13
structDBusMessageLoader.html
DBusMessageLoader
*
group__DBusMessageInternals.html#ga14
_dbus_message_loader_ref
(
structDBusMessageLoader.html
DBusMessageLoader
*loader)
Increments the reference count of the loader.
#ga14
void
group__DBusMessageInternals.html#ga15
_dbus_message_loader_unref
(
structDBusMessageLoader.html
DBusMessageLoader
*loader)
Decrements the reference count of the loader and finalizes the loader when the count reaches zero.
#ga15
void
group__DBusMessageInternals.html#ga16
_dbus_message_loader_get_buffer
(
structDBusMessageLoader.html
DBusMessageLoader
*loader,
structDBusString.html
DBusString
**buffer)
Gets the buffer to use for reading data from the network.
#ga16
void
group__DBusMessageInternals.html#ga17
_dbus_message_loader_return_buffer
(
structDBusMessageLoader.html
DBusMessageLoader
*loader,
structDBusString.html
DBusString
*buffer, int bytes_read)
Returns a buffer obtained from
group__DBusMessageInternals.html#ga16
_dbus_message_loader_get_buffer()
, indicating to the loader how many bytes of the buffer were filled in.
#ga17
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessageInternals.html#ga19
_dbus_message_loader_queue_messages
(
structDBusMessageLoader.html
DBusMessageLoader
*loader)
Converts buffered data into messages, if we have enough data.
#ga19
structDBusMessage.html
DBusMessage
*
group__DBusMessageInternals.html#ga20
_dbus_message_loader_peek_message
(
structDBusMessageLoader.html
DBusMessageLoader
*loader)
Peeks at first loaded message, returns
group__DBusMacros.html#ga4
NULL
if no messages have been queued.
#ga20
structDBusMessage.html
DBusMessage
*
group__DBusMessageInternals.html#ga21
_dbus_message_loader_pop_message
(
structDBusMessageLoader.html
DBusMessageLoader
*loader)
Pops a loaded message (passing ownership of the message to the caller).
#ga21
structDBusList.html
DBusList
*
group__DBusMessageInternals.html#ga22
_dbus_message_loader_pop_message_link
(
structDBusMessageLoader.html
DBusMessageLoader
*loader)
Pops a loaded message inside a list link (passing ownership of the message and link to the caller).
#ga22
void
group__DBusMessageInternals.html#ga23
_dbus_message_loader_putback_message_link
(
structDBusMessageLoader.html
DBusMessageLoader
*loader,
structDBusList.html
DBusList
*link)
Returns a popped message link, used to undo a pop.
#ga23
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessageInternals.html#ga24
_dbus_message_loader_get_is_corrupted
(
structDBusMessageLoader.html
DBusMessageLoader
*loader)
Checks whether the loader is confused due to bad data.
#ga24
void
group__DBusMessageInternals.html#ga25
_dbus_message_loader_set_max_message_size
(
structDBusMessageLoader.html
DBusMessageLoader
*loader, long size)
Sets the maximum size message we allow.
#ga25
long
group__DBusMessageInternals.html#ga26
_dbus_message_loader_get_max_message_size
(
structDBusMessageLoader.html
DBusMessageLoader
*loader)
Gets the maximum allowed message size in bytes.
#ga26
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessageInternals.html#ga27
dbus_message_allocate_data_slot
(
group__DBusTypes.html#ga4
dbus_int32_t
*slot_p)
Allocates an integer ID to be used for storing application-specific data on any
structDBusMessage.html
DBusMessage
.
#ga27
void
group__DBusMessageInternals.html#ga28
dbus_message_free_data_slot
(
group__DBusTypes.html#ga4
dbus_int32_t
*slot_p)
Deallocates a global ID for message data slots.
#ga28
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessageInternals.html#ga29
dbus_message_set_data
(
structDBusMessage.html
DBusMessage
*message,
group__DBusTypes.html#ga4
dbus_int32_t
slot, void *data,
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_func)
Stores a pointer on a
structDBusMessage.html
DBusMessage
, along with an optional function to be used for freeing the data when the data is set again, or when the message is finalized.
#ga29
void *
group__DBusMessageInternals.html#ga30
dbus_message_get_data
(
structDBusMessage.html
DBusMessage
*message,
group__DBusTypes.html#ga4
dbus_int32_t
slot)
Retrieves data previously set with
group__DBusMessageInternals.html#ga29
dbus_message_set_data()
.
#ga30
int
group__DBusMessageInternals.html#ga31
dbus_message_type_from_string
(const char *type_str)
Utility function to convert a machine-readable (not translated) string into a D-BUS message type.
#ga31
const char *
group__DBusMessageInternals.html#ga32
dbus_message_type_to_string
(int type)
Utility function to convert a D-BUS message type into a machine-readable string (not translated).
#ga32
Detailed Description
structDBusMessage.html
DBusMessage
private implementation details.
The guts of
structDBusMessage.html
DBusMessage
and its methods.
Define Documentation
#define ensure_byte_order
(
message
)
Value:
if
(message->byte_order != DBUS_COMPILER_BYTE_ORDER)   \
_dbus_message_byteswap (message)
Definition at line
dbus-message_8c-source.html#l00129
129
of file
dbus-message_8c-source.html
dbus-message.c
.
#define INITIAL_LOADER_DATA_LEN   32
The initial buffer size of the message loader.
todo.html#_todo000052
Todo:
this should be based on min header size plus some average body size, or something.
Or rather, the min header size only, if we want to try to read only the header, store that in a
structDBusMessage.html
DBusMessage
, then read only the body and store that, etc., depends on how we optimize
group__DBusMessageInternals.html#ga16
_dbus_message_loader_get_buffer()
and what the exact message format is.
Definition at line
dbus-message_8c-source.html#l03114
3114
of file
dbus-message_8c-source.html
dbus-message.c
.
Referenced by
dbus-message_8c-source.html#l03123
_dbus_message_loader_new()
.
Typedef Documentation
structDBusMessageLoader.html
DBusMessageLoader
The
structDBusMessageLoader.html
DBusMessageLoader
object encapsulates the process of converting a byte stream into a series of
structDBusMessage.html
DBusMessage
.
It buffers the incoming bytes as efficiently as possible, and generates a queue of messages.
structDBusMessageLoader.html
DBusMessageLoader
is typically used as part of a
structDBusTransport.html
DBusTransport
implementation. The
structDBusTransport.html
DBusTransport
then hands off the loaded messages to a
structDBusConnection.html
DBusConnection
, making the messages visible to the application.
todo.html#_todo000041
Todo:
write tests for break-loader that a) randomly delete header fields and b) set string fields to zero-length and other funky values.
Definition at line
dbus-message-internal_8h-source.html#l00032
32
of file
dbus-message-internal_8h-source.html
dbus-message-internal.h
.
Function Documentation
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_message_add_size_counter
(
structDBusMessage.html
DBusMessage
*
message
,
structDBusCounter.html
DBusCounter
*
counter
)
Adds a counter to be incremented immediately with the size of this message, and decremented by the size of this message when this message if finalized.
Parameters:
message
the message
counter
the counter
Returns:
group__DBusMacros.html#ga3
FALSE
if no memory
Definition at line
dbus-message_8c-source.html#l00221
221
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-resources_8c-source.html#l00102
_dbus_counter_ref()
,
dbus-list_8c-source.html#l00221
_dbus_list_alloc_link()
,
dbus-message_8c-source.html#l00185
_dbus_message_add_size_counter_link()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-transport_8c-source.html#l00857
_dbus_transport_queue_messages()
.
void _dbus_message_add_size_counter_link
(
structDBusMessage.html
DBusMessage
*
message
,
structDBusList.html
DBusList
*
link
)
Adds a counter to be incremented immediately with the size of this message, and decremented by the size of this message when this message if finalized.
The link contains a counter with its refcount already incremented, but the counter itself not incremented. Ownership of link and counter refcount is passed to the message.
Parameters:
message
the message
link
link with counter as data
Definition at line
dbus-message_8c-source.html#l00185
185
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-resources_8c-source.html#l00141
_dbus_counter_adjust()
,
dbus-list_8c-source.html#l00294
_dbus_list_append_link()
,
dbus-message-private_8h-source.html#l00094
DBusMessage::body
,
dbus-list_8h-source.html#l00039
DBusList::data
,
dbus-marshal-header_8h-source.html#l00054
DBusHeader::data
,
dbus-message-private_8h-source.html#l00092
DBusMessage::header
,
group__DBusMacros.html#ga4
NULL
,
dbus-message-private_8h-source.html#l00105
DBusMessage::size_counter_delta
, and
dbus-message-private_8h-source.html#l00104
DBusMessage::size_counters
.
Referenced by
dbus-message_8c-source.html#l00221
_dbus_message_add_size_counter()
.
void _dbus_message_get_network_data
(
structDBusMessage.html
DBusMessage
*
message
,
const
structDBusString.html
DBusString
**
header
,
const
structDBusString.html
DBusString
**
body
)
Gets the data to be sent over the network for this message.
The header and then the body should be written out. This function is guaranteed to always return the same data once a message is locked (with
group__DBusMessageInternals.html#ga11
_dbus_message_lock()
).
Parameters:
message
the message.
header
return location for message header data.
body
return location for message body data.
Definition at line
dbus-message_8c-source.html#l00144
144
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-message-private_8h-source.html#l00094
DBusMessage::body
,
dbus-marshal-header_8h-source.html#l00054
DBusHeader::data
,
dbus-message-private_8h-source.html#l00092
DBusMessage::header
, and
dbus-message-private_8h-source.html#l00098
DBusMessage::locked
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_message_iter_get_args_valist
(
structDBusMessageIter.html
DBusMessageIter
*
iter
,
structDBusError.html
DBusError
*
error
,
int
first_arg_type
,
va_list
var_args
)
This function takes a va_list for use by language bindings and is otherwise the same as dbus_message_iter_get_args().
group__DBusMessage.html#ga24
dbus_message_get_args()
is the place to go for complete documentation.
See also:
group__DBusMessage.html#ga24
dbus_message_get_args
Parameters:
iter
the message iter
error
error to be filled in
first_arg_type
type of the first argument
var_args
return location for first argument, followed by list of type/location pairs
Returns:
group__DBusMacros.html#ga3
FALSE
if error was set
Definition at line
dbus-message_8c-source.html#l01760
1760
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-internals_8c-source.html#l00303
_dbus_strdup()
,
dbus-marshal-recursive_8c-source.html#l00881
_dbus_type_reader_get_current_type()
,
dbus-marshal-recursive_8c-source.html#l00916
_dbus_type_reader_get_element_type()
,
dbus-marshal-recursive_8c-source.html#l01147
_dbus_type_reader_next()
,
dbus-marshal-recursive_8c-source.html#l00965
_dbus_type_reader_read_basic()
,
dbus-marshal-recursive_8c-source.html#l01019
_dbus_type_reader_read_fixed_multi()
,
dbus-marshal-recursive_8c-source.html#l01084
_dbus_type_reader_recurse()
,
dbus-marshal-basic_8c-source.html#l01308
_dbus_type_to_string()
,
dbus-internals_8c-source.html#l00203
_dbus_warn()
,
dbus-memory_8c-source.html#l00650
dbus_free_string_array()
,
dbus-message_8c-source.html#l01556
dbus_message_iter_get_arg_type()
,
dbus-memory_8h-source.html#l00042
dbus_new0
,
dbus-errors_8c-source.html#l00313
dbus_set_error()
,
dbus-signature_8c-source.html#l00285
dbus_type_is_basic()
,
dbus-signature_8c-source.html#l00307
dbus_type_is_fixed()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-message_8c-source.html#l01393
dbus_message_get_args_valist()
.
void _dbus_message_loader_get_buffer
(
structDBusMessageLoader.html
DBusMessageLoader
*
loader
,
structDBusString.html
DBusString
**
buffer
)
Gets the buffer to use for reading data from the network.
Network data is read directly into an allocated buffer, which is then used in the
structDBusMessage.html
DBusMessage
, to avoid as many extra memcpy's as possible. The buffer must always be returned immediately using
group__DBusMessageInternals.html#ga17
_dbus_message_loader_return_buffer()
, even if no bytes are successfully read.
todo.html#_todo000053
Todo:
this function can be a lot more clever.
For example it can probably always return a buffer size to read exactly the body of the next message, thus avoiding any memory wastage or reallocs.
todo.html#_todo000053
Todo:
we need to enforce a max length on strings in header fields.
Parameters:
loader
the message loader.
buffer
the buffer
Definition at line
dbus-message_8c-source.html#l03206
3206
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-message-private_8h-source.html#l00070
DBusMessageLoader::buffer_outstanding
,
dbus-message-private_8h-source.html#l00064
DBusMessageLoader::data
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_message_loader_get_is_corrupted
(
structDBusMessageLoader.html
DBusMessageLoader
*
loader
)
Checks whether the loader is confused due to bad data.
If messages are received that are invalid, the loader gets confused and gives up permanently. This state is called "corrupted."
Parameters:
loader
the loader
Returns:
group__DBusMacros.html#ga2
TRUE
if the loader is hosed.
Definition at line
dbus-message_8c-source.html#l03533
3533
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-message-private_8h-source.html#l00072
DBusMessageLoader::corrupted
, and
dbus-message-private_8h-source.html#l00074
DBusMessageLoader::corruption_reason
.
Referenced by
dbus-transport_8c-source.html#l00857
_dbus_transport_queue_messages()
.
long _dbus_message_loader_get_max_message_size
(
structDBusMessageLoader.html
DBusMessageLoader
*
loader
)
Gets the maximum allowed message size in bytes.
Parameters:
loader
the loader
Returns:
max size in bytes
Definition at line
dbus-message_8c-source.html#l03566
3566
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-message-private_8h-source.html#l00068
DBusMessageLoader::max_message_size
.
Referenced by
dbus-transport_8c-source.html#l00922
_dbus_transport_get_max_message_size()
.
structDBusMessageLoader.html
DBusMessageLoader
* _dbus_message_loader_new
(
void
)
Creates a new message loader.
Returns
group__DBusMacros.html#ga4
NULL
if memory can't be allocated.
Returns:
new loader, or
group__DBusMacros.html#ga4
NULL
.
Definition at line
dbus-message_8c-source.html#l03123
3123
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-string_8c-source.html#l00174
_dbus_string_init()
,
dbus-string_8c-source.html#l00853
_dbus_string_set_length()
,
dbus-message-private_8h-source.html#l00072
DBusMessageLoader::corrupted
,
dbus-message-private_8h-source.html#l00074
DBusMessageLoader::corruption_reason
,
dbus-message-private_8h-source.html#l00064
DBusMessageLoader::data
,
dbus-memory_8c-source.html#l00612
dbus_free()
,
dbus-memory_8h-source.html#l00042
dbus_new0
,
group__DBusMacros.html#ga3
FALSE
,
dbus-message_8c-source.html#l03114
INITIAL_LOADER_DATA_LEN
,
dbus-message-private_8h-source.html#l00068
DBusMessageLoader::max_message_size
,
group__DBusMacros.html#ga4
NULL
, and
dbus-message-private_8h-source.html#l00062
DBusMessageLoader::refcount
.
Referenced by
dbus-transport_8c-source.html#l00091
_dbus_transport_init_base()
.
structDBusMessage.html
DBusMessage
* _dbus_message_loader_peek_message
(
structDBusMessageLoader.html
DBusMessageLoader
*
loader
)
Peeks at first loaded message, returns
group__DBusMacros.html#ga4
NULL
if no messages have been queued.
Parameters:
loader
the loader.
Returns:
the next message, or
group__DBusMacros.html#ga4
NULL
if none.
Definition at line
dbus-message_8c-source.html#l03474
3474
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-list_8h-source.html#l00039
DBusList::data
,
dbus-message-private_8h-source.html#l00066
DBusMessageLoader::messages
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-transport_8c-source.html#l00819
_dbus_transport_get_dispatch_status()
.
structDBusMessage.html
DBusMessage
* _dbus_message_loader_pop_message
(
structDBusMessageLoader.html
DBusMessageLoader
*
loader
)
Pops a loaded message (passing ownership of the message to the caller).
Returns
group__DBusMacros.html#ga4
NULL
if no messages have been queued.
Parameters:
loader
the loader.
Returns:
the next message, or
group__DBusMacros.html#ga4
NULL
if none.
Definition at line
dbus-message_8c-source.html#l03491
3491
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-list_8c-source.html#l00663
_dbus_list_pop_first()
, and
dbus-message-private_8h-source.html#l00066
DBusMessageLoader::messages
.
structDBusList.html
DBusList
* _dbus_message_loader_pop_message_link
(
structDBusMessageLoader.html
DBusMessageLoader
*
loader
)
Pops a loaded message inside a list link (passing ownership of the message and link to the caller).
Returns
group__DBusMacros.html#ga4
NULL
if no messages have been loaded.
Parameters:
loader
the loader.
Returns:
the next message link, or
group__DBusMacros.html#ga4
NULL
if none.
Definition at line
dbus-message_8c-source.html#l03505
3505
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-list_8c-source.html#l00642
_dbus_list_pop_first_link()
, and
dbus-message-private_8h-source.html#l00066
DBusMessageLoader::messages
.
Referenced by
dbus-transport_8c-source.html#l00857
_dbus_transport_queue_messages()
.
void _dbus_message_loader_putback_message_link
(
structDBusMessageLoader.html
DBusMessageLoader
*
loader
,
structDBusList.html
DBusList
*
link
)
Returns a popped message link, used to undo a pop.
Parameters:
loader
the loader
link
the link with a message in it
Definition at line
dbus-message_8c-source.html#l03517
3517
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-list_8c-source.html#l00312
_dbus_list_prepend_link()
, and
dbus-message-private_8h-source.html#l00066
DBusMessageLoader::messages
.
Referenced by
dbus-transport_8c-source.html#l00857
_dbus_transport_queue_messages()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_message_loader_queue_messages
(
structDBusMessageLoader.html
DBusMessageLoader
*
loader
)
Converts buffered data into messages, if we have enough data.
If we don't have enough data, does nothing.
todo.html#_todo000055
Todo:
we need to check that the proper named header fields exist for each message type.
todo.html#_todo000055
Todo:
If a message has unknown type, we should probably eat it right here rather than passing it out to applications.
However it's not an error to see messages of unknown type.
Parameters:
loader
the loader.
Returns:
group__DBusMacros.html#ga2
TRUE
if we had enough memory to finish.
Definition at line
dbus-message_8c-source.html#l03411
3411
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-marshal-header_8c-source.html#l00660
_dbus_header_have_message_untrusted()
,
dbus-list_8c-source.html#l00486
_dbus_list_find_last()
,
dbus-message-private_8h-source.html#l00072
DBusMessageLoader::corrupted
,
dbus-message-private_8h-source.html#l00074
DBusMessageLoader::corruption_reason
,
dbus-message-private_8h-source.html#l00064
DBusMessageLoader::data
,
dbus-message_8c-source.html#l01097
dbus_message_unref()
,
group__DBusMacros.html#ga3
FALSE
,
dbus-message-private_8h-source.html#l00068
DBusMessageLoader::max_message_size
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-transport_8c-source.html#l00819
_dbus_transport_get_dispatch_status()
.
structDBusMessageLoader.html
DBusMessageLoader
* _dbus_message_loader_ref
(
structDBusMessageLoader.html
DBusMessageLoader
*
loader
)
Increments the reference count of the loader.
Parameters:
loader
the loader.
Returns:
the loader
Definition at line
dbus-message_8c-source.html#l03159
3159
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-message-private_8h-source.html#l00062
DBusMessageLoader::refcount
.
void _dbus_message_loader_return_buffer
(
structDBusMessageLoader.html
DBusMessageLoader
*
loader
,
structDBusString.html
DBusString
*
buffer
,
int
bytes_read
)
Returns a buffer obtained from
group__DBusMessageInternals.html#ga16
_dbus_message_loader_get_buffer()
, indicating to the loader how many bytes of the buffer were filled in.
This function must always be called, even if no bytes were successfully read.
Parameters:
loader
the loader.
buffer
the buffer.
bytes_read
number of bytes that were read into the buffer.
Definition at line
dbus-message_8c-source.html#l03227
3227
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-message-private_8h-source.html#l00070
DBusMessageLoader::buffer_outstanding
,
dbus-message-private_8h-source.html#l00064
DBusMessageLoader::data
, and
group__DBusMacros.html#ga3
FALSE
.
void _dbus_message_loader_set_max_message_size
(
structDBusMessageLoader.html
DBusMessageLoader
*
loader
,
long
size
)
Sets the maximum size message we allow.
Parameters:
loader
the loader
size
the max message size in bytes
Definition at line
dbus-message_8c-source.html#l03547
3547
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-message-private_8h-source.html#l00068
DBusMessageLoader::max_message_size
.
Referenced by
dbus-transport_8c-source.html#l00909
_dbus_transport_set_max_message_size()
.
void _dbus_message_loader_unref
(
structDBusMessageLoader.html
DBusMessageLoader
*
loader
)
Decrements the reference count of the loader and finalizes the loader when the count reaches zero.
Parameters:
loader
the loader.
Definition at line
dbus-message_8c-source.html#l03173
3173
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-list_8c-source.html#l00556
_dbus_list_clear()
,
dbus-list_8c-source.html#l00796
_dbus_list_foreach()
,
dbus-string_8c-source.html#l00261
_dbus_string_free()
,
dbus-message-private_8h-source.html#l00064
DBusMessageLoader::data
,
dbus-memory_8c-source.html#l00612
dbus_free()
,
dbus-message_8c-source.html#l01097
dbus_message_unref()
,
dbus-message-private_8h-source.html#l00066
DBusMessageLoader::messages
,
group__DBusMacros.html#ga4
NULL
, and
dbus-message-private_8h-source.html#l00062
DBusMessageLoader::refcount
.
Referenced by
dbus-transport_8c-source.html#l00186
_dbus_transport_finalize_base()
, and
dbus-transport_8c-source.html#l00091
_dbus_transport_init_base()
.
void _dbus_message_lock
(
structDBusMessage.html
DBusMessage
*
message
)
Locks a message.
Allows checking that applications don't keep a reference to a message in the outgoing queue and change it underneath us. Messages are locked when they enter the outgoing queue (dbus_connection_send_message()), and the library complains if the message is modified while locked.
Parameters:
message
the message to lock.
Definition at line
dbus-message_8c-source.html#l00277
277
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-marshal-header_8c-source.html#l01179
_dbus_header_update_lengths()
,
dbus-message-private_8h-source.html#l00094
DBusMessage::body
,
dbus-message_8c-source.html#l02819
dbus_message_get_signature()
,
dbus-message-private_8h-source.html#l00092
DBusMessage::header
,
dbus-message-private_8h-source.html#l00098
DBusMessage::locked
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
void _dbus_message_remove_size_counter
(
structDBusMessage.html
DBusMessage
*
message
,
structDBusCounter.html
DBusCounter
*
counter
,
structDBusList.html
DBusList
**
link_return
)
Removes a counter tracking the size of this message, and decrements the counter by the size of this message.
Parameters:
message
the message
link_return
return the link used
counter
the counter
Definition at line
dbus-message_8c-source.html#l00245
245
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-resources_8c-source.html#l00141
_dbus_counter_adjust()
,
dbus-resources_8c-source.html#l00118
_dbus_counter_unref()
,
dbus-list_8c-source.html#l00486
_dbus_list_find_last()
,
dbus-list_8c-source.html#l00233
_dbus_list_free_link()
,
dbus-list_8c-source.html#l00513
_dbus_list_unlink()
,
group__DBusMacros.html#ga4
NULL
,
dbus-message-private_8h-source.html#l00105
DBusMessage::size_counter_delta
, and
dbus-message-private_8h-source.html#l00104
DBusMessage::size_counters
.
Referenced by
dbus-connection_8c-source.html#l00492
_dbus_connection_message_sent()
.
void _dbus_message_set_serial
(
structDBusMessage.html
DBusMessage
*
message
,
group__DBusTypes.html#ga3
dbus_uint32_t
serial
)
Sets the serial number of a message.
This can only be done once on a message.
Parameters:
message
the message
serial
the serial
Definition at line
dbus-message_8c-source.html#l00162
162
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-marshal-header_8c-source.html#l00390
_dbus_header_set_serial()
,
dbus-message_8c-source.html#l00384
dbus_message_get_serial()
,
dbus-message-private_8h-source.html#l00098
DBusMessage::locked
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-connection_8c-source.html#l02416
dbus_connection_send_with_reply()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_allocate_data_slot
(
group__DBusTypes.html#ga4
dbus_int32_t
*
slot_p
)
Allocates an integer ID to be used for storing application-specific data on any
structDBusMessage.html
DBusMessage
.
The allocated ID may then be used with
group__DBusMessageInternals.html#ga29
dbus_message_set_data()
and
group__DBusMessageInternals.html#ga30
dbus_message_get_data()
. The passed-in slot must be initialized to -1, and is filled in with the slot ID. If the passed-in slot is not -1, it's assumed to be already allocated, and its refcount is incremented.
The allocated slot is global, i.e. all
structDBusMessage.html
DBusMessage
objects will have a slot with the given integer ID reserved.
Parameters:
slot_p
address of a global variable storing the slot
Returns:
group__DBusMacros.html#ga3
FALSE
on failure (no memory)
Definition at line
dbus-message_8c-source.html#l03589
3589
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-dataslot_8c-source.html#l00067
_dbus_data_slot_allocator_alloc()
, and
dbus-internals_8h-source.html#l00267
_DBUS_LOCK_NAME
.
void dbus_message_free_data_slot
(
group__DBusTypes.html#ga4
dbus_int32_t
*
slot_p
)
Deallocates a global ID for message data slots.
group__DBusMessageInternals.html#ga30
dbus_message_get_data()
and
group__DBusMessageInternals.html#ga29
dbus_message_set_data()
may no longer be used with this slot. Existing data stored on existing
structDBusMessage.html
DBusMessage
objects will be freed when the message is finalized, but may not be retrieved (and may only be replaced if someone else reallocates the slot). When the refcount on the passed-in slot reaches 0, it is set to -1.
Parameters:
slot_p
address storing the slot to deallocate
Definition at line
dbus-message_8c-source.html#l03608
3608
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-dataslot_8c-source.html#l00161
_dbus_data_slot_allocator_free()
.
void* dbus_message_get_data
(
structDBusMessage.html
DBusMessage
*
message
,
group__DBusTypes.html#ga4
dbus_int32_t
slot
)
Retrieves data previously set with
group__DBusMessageInternals.html#ga29
dbus_message_set_data()
.
The slot must still be allocated (must not have been freed).
Parameters:
message
the message
slot
the slot to get data from
Returns:
the data, or
group__DBusMacros.html#ga4
NULL
if not found
Definition at line
dbus-message_8c-source.html#l03665
3665
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-dataslot_8c-source.html#l00295
_dbus_data_slot_list_get()
,
group__DBusMacros.html#ga4
NULL
, and
dbus-message-private_8h-source.html#l00109
DBusMessage::slot_list
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_set_data
(
structDBusMessage.html
DBusMessage
*
message
,
group__DBusTypes.html#ga4
dbus_int32_t
slot
,
void *
data
,
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_func
)
Stores a pointer on a
structDBusMessage.html
DBusMessage
, along with an optional function to be used for freeing the data when the data is set again, or when the message is finalized.
The slot number must have been allocated with
group__DBusMessageInternals.html#ga27
dbus_message_allocate_data_slot()
.
Parameters:
message
the message
slot
the slot number
data
the data to store
free_data_func
finalizer function for the data
Returns:
group__DBusMacros.html#ga2
TRUE
if there was enough memory to store the data
Definition at line
dbus-message_8c-source.html#l03629
3629
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-dataslot_8c-source.html#l00233
_dbus_data_slot_list_set()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
dbus-message-private_8h-source.html#l00109
DBusMessage::slot_list
.
int dbus_message_type_from_string
(
const char *
type_str
)
Utility function to convert a machine-readable (not translated) string into a D-BUS message type.
"method_call"
-> DBUS_MESSAGE_TYPE_METHOD_CALL
"method_return"
-> DBUS_MESSAGE_TYPE_METHOD_RETURN
"signal"
-> DBUS_MESSAGE_TYPE_SIGNAL
"error"
-> DBUS_MESSAGE_TYPE_ERROR
anything
else
-> DBUS_MESSAGE_TYPE_INVALID
Definition at line
dbus-message_8c-source.html#l03693
3693
of file
dbus-message_8c-source.html
dbus-message.c
.
const char* dbus_message_type_to_string
(
int
type
)
Utility function to convert a D-BUS message type into a machine-readable string (not translated).
DBUS_MESSAGE_TYPE_METHOD_CALL    ->
"method_call"
DBUS_MESSAGE_TYPE_METHOD_RETURN  ->
"method_return"
DBUS_MESSAGE_TYPE_SIGNAL         ->
"signal"
DBUS_MESSAGE_TYPE_ERROR          ->
"error"
DBUS_MESSAGE_TYPE_INVALID        ->
"invalid"
Definition at line
dbus-message_8c-source.html#l03721
3721
of file
dbus-message_8c-source.html
dbus-message.c
.
Generated on Tue Sep 13 01:28:09 2005 for D-BUS by
http://www.doxygen.org/index.html
doxygen
1.4.4
