Defines | |
#define | TYPE_IS_CONTAINER(typecode) |
macro that checks whether a typecode is a container type | |
Functions | |
void | dbus_signature_iter_init (DBusSignatureIter *iter, const char *signature) |
Initializes a DBusSignatureIter for reading a type signature. | |
int | dbus_signature_iter_get_current_type (const DBusSignatureIter *iter) |
Returns the current type pointed to by the iterator. | |
char * | dbus_signature_iter_get_signature (const DBusSignatureIter *iter) |
Returns the full type signature represented by the current iterator as a C string. | |
int | dbus_signature_iter_get_element_type (const DBusSignatureIter *iter) |
Convenience function for returning the element type of an array; This function allows you to avoid initializing a sub-iterator and getting its current type. | |
dbus_bool_t | dbus_signature_iter_next (DBusSignatureIter *iter) |
Skip to the next value on this "level". | |
void | dbus_signature_iter_recurse (const DBusSignatureIter *iter, DBusSignatureIter *subiter) |
Initialize a new iterator pointing to the first type current container. | |
dbus_bool_t | dbus_signature_validate (const char *signature, DBusError *error) |
Check a type signature for validity. | |
dbus_bool_t | dbus_signature_validate_single (const char *signature, DBusError *error) |
Check that a type signature is both valid and contains exactly one complete type. | |
dbus_bool_t | dbus_type_is_container (int typecode) |
A "container type" can contain basic types, or nested container types. | |
dbus_bool_t | dbus_type_is_basic (int typecode) |
A "basic type" is a somewhat arbitrary concept, but the intent is to include those types that are fully-specified by a single typecode, with no additional type information or nested values. | |
dbus_bool_t | dbus_type_is_fixed (int typecode) |
Tells you whether values of this type can change length if you set them to some other value. |
|
Value: ((typecode) == DBUS_TYPE_STRUCT || \ (typecode) == DBUS_TYPE_DICT_ENTRY || \ (typecode) == DBUS_TYPE_VARIANT || \ (typecode) == DBUS_TYPE_ARRAY)
Definition at line 250 of file dbus-signature.c. Referenced by dbus_type_is_basic(), and dbus_type_is_container(). |
|
Returns the current type pointed to by the iterator. If the iterator is pointing at a type code such as 's', then it will be returned directly. However, when the parser encounters a container type start character such as '(' for a structure, the corresponding type for the container will be returned, e.g. DBUS_TYPE_STRUCT, not '('. In this case, you should initialize a sub-iterator with dbus_signature_iter_recurse to parse the container type.
Definition at line 79 of file dbus-signature.c. References _dbus_first_type_in_signature_c_str(), and DBusSignatureRealIter::pos. Referenced by dbus_signature_iter_get_element_type(), dbus_signature_iter_recurse(), and dbus_signature_validate_single(). |
|
Convenience function for returning the element type of an array; This function allows you to avoid initializing a sub-iterator and getting its current type. It is an error to invoke this function if the current type of the iterator is not DBUS_TYPE_ARRAY.
Definition at line 128 of file dbus-signature.c. References _dbus_first_type_in_signature_c_str(), dbus_signature_iter_get_current_type(), and DBusSignatureRealIter::pos. |
|
Returns the full type signature represented by the current iterator as a C string.
Definition at line 94 of file dbus-signature.c. References _dbus_string_append_len(), _dbus_string_free(), _dbus_string_init(), _dbus_string_steal_data(), _dbus_type_signature_next(), NULL, and DBusSignatureRealIter::pos. |
|
Initializes a DBusSignatureIter for reading a type signature. This function is not safe to use on invalid signatures; be sure to validate potentially invalid signatures with dbus_signature_validate before using this function.
Definition at line 54 of file dbus-signature.c. References FALSE, DBusSignatureRealIter::finished, DBusSignatureRealIter::in_array, and DBusSignatureRealIter::pos. Referenced by dbus_signature_validate_single(). |
|
Skip to the next value on this "level". e.g. the next field in a struct, the next value in an array. Returns FALSE at the end of the current container.
Definition at line 146 of file dbus-signature.c. References _dbus_type_signature_next(), FALSE, DBusSignatureRealIter::finished, DBusSignatureRealIter::in_array, DBusSignatureRealIter::pos, and TRUE. Referenced by dbus_signature_validate_single(). |
|
Initialize a new iterator pointing to the first type current container. It's an error to call this if the current type is a non-container (i.e. if dbus_type_is_container returns FALSE).
Definition at line 186 of file dbus-signature.c. References dbus_signature_iter_get_current_type(), dbus_type_is_container(), DBusSignatureRealIter::in_array, DBusSignatureRealIter::pos, and TRUE. |
|
Check a type signature for validity.
Definition at line 209 of file dbus-signature.c. References _dbus_string_init_const(), _dbus_validate_signature(), dbus_set_error(), FALSE, and TRUE. Referenced by dbus_signature_validate_single(). |
|
Check that a type signature is both valid and contains exactly one complete type.
Definition at line 231 of file dbus-signature.c. References dbus_set_error(), dbus_signature_iter_get_current_type(), dbus_signature_iter_init(), dbus_signature_iter_next(), dbus_signature_validate(), FALSE, and TRUE. |
|
A "basic type" is a somewhat arbitrary concept, but the intent is to include those types that are fully-specified by a single typecode, with no additional type information or nested values. So all numbers and strings are basic types and structs, arrays, and variants are not basic types. DBUS_TYPE_INVALID is not a basic type. This function will crash if passed a typecode that isn't in dbus-protocol.h
Definition at line 287 of file dbus-signature.c. References _dbus_type_is_valid(), FALSE, and TYPE_IS_CONTAINER. Referenced by _dbus_marshal_read_basic(), _dbus_marshal_read_fixed_multi(), _dbus_marshal_write_basic(), _dbus_message_iter_get_args_valist(), _dbus_type_reader_set_basic(), _dbus_validate_signature_with_reason(), dbus_message_append_args_valist(), and dbus_message_iter_append_basic(). |
|
A "container type" can contain basic types, or nested container types. DBUS_TYPE_INVALID is not a container type. This function will crash if passed a typecode that isn't in dbus-protocol.h
Definition at line 265 of file dbus-signature.c. References _dbus_type_is_valid(), FALSE, and TYPE_IS_CONTAINER. Referenced by dbus_message_iter_open_container(), and dbus_signature_iter_recurse(). |
|
Tells you whether values of this type can change length if you set them to some other value. For this purpose, you assume that the first byte of the old and new value would be in the same location, so alignment padding is not a factor. This function is useful to determine whether dbus_message_iter_get_fixed_array may be used.
Definition at line 309 of file dbus-signature.c. Referenced by _dbus_marshal_read_fixed_multi(), _dbus_marshal_write_fixed_multi(), _dbus_message_iter_get_args_valist(), _dbus_type_reader_read_fixed_multi(), _dbus_type_reader_set_basic(), _dbus_type_writer_write_fixed_multi(), dbus_message_append_args_valist(), dbus_message_iter_append_fixed_array(), and dbus_message_iter_get_fixed_array(). |