27#include "dbus-internals.h" 
   28#include "dbus-marshal-validate.h" 
   29#include "dbus-marshal-recursive.h" 
   30#include "dbus-marshal-basic.h" 
   31#include "dbus-signature.h" 
   32#include "dbus-string.h" 
   57  const unsigned char *p;
 
   58  const unsigned char *end;
 
   71  element_count_stack = 
NULL;
 
   86      result = DBUS_INVALID_SIGNATURE_TOO_LONG;
 
   90  p = _dbus_string_get_const_udata_len (type_str, type_pos, 0);
 
   92  end = _dbus_string_get_const_udata_len (type_str, type_pos + len, 0);
 
  102      _dbus_assert (opened_brackets[struct_depth + dict_entry_depth] == 
'\0');
 
  126              result = DBUS_INVALID_EXCEEDED_MAXIMUM_ARRAY_RECURSION;
 
  136              result = DBUS_INVALID_EXCEEDED_MAXIMUM_STRUCT_RECURSION;
 
  149          _dbus_assert (opened_brackets[struct_depth + dict_entry_depth - 1] == 
'\0');
 
  154          if (struct_depth == 0)
 
  156              result = DBUS_INVALID_STRUCT_ENDED_BUT_NOT_STARTED;
 
  162              result = DBUS_INVALID_STRUCT_HAS_NO_FIELDS;
 
  168          last_bracket = opened_brackets[struct_depth + dict_entry_depth - 1];
 
  172              result = DBUS_INVALID_STRUCT_ENDED_BUT_NOT_STARTED;
 
  179          opened_brackets[struct_depth + dict_entry_depth] = 
'\0';
 
  185              result = DBUS_INVALID_DICT_ENTRY_NOT_INSIDE_ARRAY;
 
  189          dict_entry_depth += 1;
 
  193              result = DBUS_INVALID_EXCEEDED_MAXIMUM_DICT_ENTRY_RECURSION;
 
  206          _dbus_assert (opened_brackets[struct_depth + dict_entry_depth - 1] == 
'\0');
 
  211          if (dict_entry_depth == 0)
 
  213              result = DBUS_INVALID_DICT_ENTRY_ENDED_BUT_NOT_STARTED;
 
  219          last_bracket = opened_brackets[struct_depth + dict_entry_depth - 1];
 
  223              result = DBUS_INVALID_DICT_ENTRY_ENDED_BUT_NOT_STARTED;
 
  227          dict_entry_depth -= 1;
 
  228          opened_brackets[struct_depth + dict_entry_depth] = 
'\0';
 
  233          if (element_count != 2)
 
  235              if (element_count == 0)
 
  236                result = DBUS_INVALID_DICT_ENTRY_HAS_NO_FIELDS;
 
  237              else if (element_count == 1)
 
  238                result = DBUS_INVALID_DICT_ENTRY_HAS_ONLY_ONE_FIELD;
 
  240                result = DBUS_INVALID_DICT_ENTRY_HAS_TOO_MANY_FIELDS;
 
  249          result = DBUS_INVALID_UNKNOWN_TYPECODE;
 
  274               const unsigned char *p1;
 
  279                   result = DBUS_INVALID_MISSING_ARRAY_ELEMENT_TYPE;
 
  293              result = DBUS_INVALID_DICT_KEY_MUST_BE_BASIC_TYPE;
 
  305      result = DBUS_INVALID_MISSING_ARRAY_ELEMENT_TYPE;
 
  309  if (struct_depth > 0)
 
  311       result = DBUS_INVALID_STRUCT_STARTED_BUT_NOT_ENDED;
 
  315  if (dict_entry_depth > 0)
 
  317      result =  DBUS_INVALID_DICT_ENTRY_STARTED_BUT_NOT_ENDED;
 
 
  340                      const unsigned char  *p,
 
  341                      const unsigned char  *end,
 
  342                      const unsigned char **new_p)
 
  353      return DBUS_INVALID_NESTED_TOO_DEEPLY;
 
  358      const unsigned char *a;
 
  362      _dbus_verbose (
"   validating value of type %s type reader %p type_pos %d p %p end %p %d remain\n",
 
  369        return DBUS_INVALID_NOT_ENOUGH_DATA;
 
  371      switch (current_type)
 
  389          a = _DBUS_ALIGN_ADDRESS (p, alignment);
 
  391            return DBUS_INVALID_NOT_ENOUGH_DATA;
 
  395                return DBUS_INVALID_ALIGNMENT_PADDING_NOT_NUL;
 
  404                return DBUS_INVALID_NOT_ENOUGH_DATA;
 
  408              if (!(v == 0 || v == 1))
 
  409                return DBUS_INVALID_BOOLEAN_NOT_ZERO_OR_ONE;
 
  422            a = _DBUS_ALIGN_ADDRESS (p, 4);
 
  424              return DBUS_INVALID_NOT_ENOUGH_DATA;
 
  428                  return DBUS_INVALID_ALIGNMENT_PADDING_NOT_NUL;
 
  448                    return DBUS_INVALID_UNKNOWN_TYPECODE;
 
  453                a = _DBUS_ALIGN_ADDRESS (p, alignment);
 
  457                  return DBUS_INVALID_NOT_ENOUGH_DATA;
 
  462                      return DBUS_INVALID_ALIGNMENT_PADDING_NOT_NUL;
 
  467            if (claimed_len > (
unsigned long) (end - p))
 
  468              return DBUS_INVALID_LENGTH_OUT_OF_BOUNDS;
 
  475                                          _dbus_string_get_length (&str)))
 
  476                  return DBUS_INVALID_BAD_PATH;
 
  485                                                 _dbus_string_get_length (&str)))
 
  486                  return DBUS_INVALID_BAD_UTF8_IN_STRING;
 
  494                const unsigned char *array_end;
 
  498                  return DBUS_INVALID_ARRAY_LENGTH_EXCEEDS_MAXIMUM;
 
  506                array_end = p + claimed_len;
 
  522                                  alignment == 4 || alignment == 8);
 
  527                    if ((claimed_len & (alignment - 1)) != 0)
 
  528                      return DBUS_INVALID_ARRAY_LENGTH_INCORRECT;
 
  537                        while (p < array_end)
 
  541                            if (!(v == 0 || v == 1))
 
  542                              return DBUS_INVALID_BOOLEAN_NOT_ZERO_OR_ONE;
 
  556                    while (p < array_end)
 
  558                        validity = validate_body_helper (&sub, byte_order, 
FALSE,
 
  567                  return DBUS_INVALID_ARRAY_LENGTH_INCORRECT;
 
  574                  return DBUS_INVALID_NOT_ENOUGH_DATA;
 
  577                  return DBUS_INVALID_STRING_MISSING_NUL;
 
  593            if (claimed_len + 1 > (
unsigned long) (end - p))
 
  594              return DBUS_INVALID_SIGNATURE_LENGTH_OUT_OF_BOUNDS;
 
  599                                                    _dbus_string_get_length (&str));
 
  608              return DBUS_INVALID_SIGNATURE_MISSING_NUL;
 
  612            _dbus_verbose (
"p = %p end = %p claimed_len %u\n", p, end, claimed_len);
 
  629            int contained_alignment;
 
  637            if (claimed_len + 1 > (
unsigned long) (end - p))
 
  638              return DBUS_INVALID_VARIANT_SIGNATURE_LENGTH_OUT_OF_BOUNDS;
 
  642                                           _dbus_string_get_length (&sig));
 
  648                  return DBUS_INVALID_VARIANT_SIGNATURE_BAD;
 
  654              return DBUS_INVALID_VARIANT_SIGNATURE_MISSING_NUL;
 
  659              return DBUS_INVALID_VARIANT_SIGNATURE_EMPTY;
 
  663            a = _DBUS_ALIGN_ADDRESS (p, contained_alignment);
 
  665              return DBUS_INVALID_NOT_ENOUGH_DATA;
 
  669                  return DBUS_INVALID_ALIGNMENT_PADDING_NOT_NUL;
 
  677            validity = validate_body_helper (&sub, byte_order, 
FALSE,
 
  684              return DBUS_INVALID_VARIANT_SIGNATURE_SPECIFIES_MULTIPLE_VALUES;
 
  696            a = _DBUS_ALIGN_ADDRESS (p, 8);
 
  698              return DBUS_INVALID_NOT_ENOUGH_DATA;
 
  702                  return DBUS_INVALID_ALIGNMENT_PADDING_NOT_NUL;
 
  708            validity = validate_body_helper (&sub, byte_order, 
TRUE,
 
  722      _dbus_verbose (
"   validated value of type %s type reader %p type_pos %d p %p end %p %d remain\n",
 
  729          _dbus_verbose (
"not enough data!!! p = %p end = %p end-p = %d\n",
 
  730                         p, end, (
int) (end - p));
 
  731          return DBUS_INVALID_NOT_ENOUGH_DATA;
 
  734      if (walk_reader_to_end)
 
  768                                 int               expected_signature_start,
 
  770                                 int              *bytes_remaining,
 
  776  const unsigned char *p;
 
  777  const unsigned char *end;
 
  782  _dbus_assert (value_pos <= _dbus_string_get_length (value_str) - len);
 
  784  _dbus_verbose (
"validating body from pos %d len %d sig '%s'\n",
 
  785                 value_pos, len, _dbus_string_get_const_data_len (expected_signature,
 
  786                                                                  expected_signature_start,
 
  790                                     expected_signature, expected_signature_start);
 
  792  p = _dbus_string_get_const_udata_len (value_str, value_pos, len);
 
  795  validity = validate_body_helper (&reader, byte_order, 
TRUE, 0, p, end, &p);
 
  801      *bytes_remaining = end - p;
 
 
  817#define VALID_INITIAL_NAME_CHARACTER(c)         \ 
  818  ( ((c) >= 'A' && (c) <= 'Z') ||               \ 
  819    ((c) >= 'a' && (c) <= 'z') ||               \ 
 
  826#define VALID_NAME_CHARACTER(c)                 \ 
  827  ( ((c) >= '0' && (c) <= '9') ||               \ 
  828    ((c) >= 'A' && (c) <= 'Z') ||               \ 
  829    ((c) >= 'a' && (c) <= 'z') ||               \ 
 
  853  const unsigned char *s;
 
  854  const unsigned char *end;
 
  855  const unsigned char *last_slash;
 
  861  if (len > _dbus_string_get_length (str) - start)
 
  867  s = _dbus_string_get_const_udata (str) + start;
 
  879          if ((s - last_slash) < 2)
 
  893  if ((end - last_slash) < 2 &&
 
 
  906    case DBUS_INVALID_FOR_UNKNOWN_REASON:                          
return "Unknown reason";
 
  907    case DBUS_VALID_BUT_INCOMPLETE:                                
return "Valid but incomplete";
 
  908    case DBUS_VALIDITY_UNKNOWN:                                    
return "Validity unknown";
 
  910    case DBUS_INVALID_UNKNOWN_TYPECODE:                            
return "Unknown typecode";
 
  911    case DBUS_INVALID_MISSING_ARRAY_ELEMENT_TYPE:                  
return "Missing array element type";
 
  912    case DBUS_INVALID_SIGNATURE_TOO_LONG:                          
return "Signature is too long";
 
  913    case DBUS_INVALID_EXCEEDED_MAXIMUM_ARRAY_RECURSION:            
return "Exceeded maximum array recursion";
 
  914    case DBUS_INVALID_EXCEEDED_MAXIMUM_STRUCT_RECURSION:           
return "Exceeded maximum struct recursion";
 
  915    case DBUS_INVALID_STRUCT_ENDED_BUT_NOT_STARTED:                
return "Struct ended but not started";
 
  916    case DBUS_INVALID_STRUCT_STARTED_BUT_NOT_ENDED:                
return "Struct started but not ended";
 
  917    case DBUS_INVALID_STRUCT_HAS_NO_FIELDS:                        
return "Struct has no fields";
 
  918    case DBUS_INVALID_ALIGNMENT_PADDING_NOT_NUL:                   
return "Alignment padding not null";
 
  919    case DBUS_INVALID_BOOLEAN_NOT_ZERO_OR_ONE:                     
return "Boolean is not zero or one";
 
  920    case DBUS_INVALID_NOT_ENOUGH_DATA:                             
return "Not enough data";
 
  922    case DBUS_INVALID_BAD_BYTE_ORDER:                              
return "Bad byte order";
 
  923    case DBUS_INVALID_BAD_PROTOCOL_VERSION:                        
return "Bad protocol version";
 
  924    case DBUS_INVALID_BAD_MESSAGE_TYPE:                            
return "Bad message type";
 
  925    case DBUS_INVALID_BAD_SERIAL:                                  
return "Bad serial";
 
  926    case DBUS_INVALID_INSANE_FIELDS_ARRAY_LENGTH:                  
return "Insane fields array length";
 
  927    case DBUS_INVALID_INSANE_BODY_LENGTH:                          
return "Insane body length";
 
  928    case DBUS_INVALID_MESSAGE_TOO_LONG:                            
return "Message too long";
 
  929    case DBUS_INVALID_HEADER_FIELD_CODE:                           
return "Header field code";
 
  930    case DBUS_INVALID_HEADER_FIELD_HAS_WRONG_TYPE:                 
return "Header field has wrong type";
 
  931    case DBUS_INVALID_USES_LOCAL_INTERFACE:                        
return "Uses local interface";
 
  932    case DBUS_INVALID_USES_LOCAL_PATH:                             
return "Uses local path";
 
  933    case DBUS_INVALID_HEADER_FIELD_APPEARS_TWICE:                  
return "Header field appears twice";
 
  934    case DBUS_INVALID_BAD_DESTINATION:                             
return "Bad destination";
 
  935    case DBUS_INVALID_BAD_INTERFACE:                               
return "Bad interface";
 
  936    case DBUS_INVALID_BAD_MEMBER:                                  
return "Bad member";
 
  937    case DBUS_INVALID_BAD_ERROR_NAME:                              
return "Bad error name";
 
  938    case DBUS_INVALID_BAD_SENDER:                                  
return "Bad sender";
 
  939    case DBUS_INVALID_MISSING_PATH:                                
return "Missing path";
 
  940    case DBUS_INVALID_MISSING_INTERFACE:                           
return "Missing interface";
 
  941    case DBUS_INVALID_MISSING_MEMBER:                              
return "Missing member";
 
  942    case DBUS_INVALID_MISSING_ERROR_NAME:                          
return "Missing error name";
 
  943    case DBUS_INVALID_MISSING_REPLY_SERIAL:                        
return "Missing reply serial";
 
  944    case DBUS_INVALID_LENGTH_OUT_OF_BOUNDS:                        
return "Length out of bounds";
 
  945    case DBUS_INVALID_ARRAY_LENGTH_EXCEEDS_MAXIMUM:                
return "Array length exceeds maximum";
 
  946    case DBUS_INVALID_BAD_PATH:                                    
return "Bad path";
 
  947    case DBUS_INVALID_SIGNATURE_LENGTH_OUT_OF_BOUNDS:              
return "Signature length out of bounds";
 
  948    case DBUS_INVALID_BAD_UTF8_IN_STRING:                          
return "Bad utf8 in string";
 
  949    case DBUS_INVALID_ARRAY_LENGTH_INCORRECT:                      
return "Array length incorrect";
 
  950    case DBUS_INVALID_VARIANT_SIGNATURE_LENGTH_OUT_OF_BOUNDS:      
return "Variant signature length out of bounds";
 
  951    case DBUS_INVALID_VARIANT_SIGNATURE_BAD:                       
return "Variant signature bad";
 
  952    case DBUS_INVALID_VARIANT_SIGNATURE_EMPTY:                     
return "Variant signature empty";
 
  953    case DBUS_INVALID_VARIANT_SIGNATURE_SPECIFIES_MULTIPLE_VALUES: 
return "Variant signature specifies multiple values";
 
  954    case DBUS_INVALID_VARIANT_SIGNATURE_MISSING_NUL:               
return "Variant signature missing nul";
 
  955    case DBUS_INVALID_STRING_MISSING_NUL:                          
return "String missing nul";
 
  956    case DBUS_INVALID_SIGNATURE_MISSING_NUL:                       
return "Signature missing nul";
 
  957    case DBUS_INVALID_EXCEEDED_MAXIMUM_DICT_ENTRY_RECURSION:       
return "Exceeded maximum dict entry recursion";
 
  958    case DBUS_INVALID_DICT_ENTRY_ENDED_BUT_NOT_STARTED:            
return "Dict entry ended but not started";
 
  959    case DBUS_INVALID_DICT_ENTRY_STARTED_BUT_NOT_ENDED:            
return "Dict entry started but not ended";
 
  960    case DBUS_INVALID_DICT_ENTRY_HAS_NO_FIELDS:                    
return "Dict entry has no fields";
 
  961    case DBUS_INVALID_DICT_ENTRY_HAS_ONLY_ONE_FIELD:               
return "Dict entry has only one field";
 
  962    case DBUS_INVALID_DICT_ENTRY_HAS_TOO_MANY_FIELDS:              
return "Dict entry has too many fields";
 
  963    case DBUS_INVALID_DICT_ENTRY_NOT_INSIDE_ARRAY:                 
return "Dict entry not inside array";
 
  964    case DBUS_INVALID_DICT_KEY_MUST_BE_BASIC_TYPE:                 
return "Dict key must be basic type";
 
  965    case DBUS_INVALID_MISSING_UNIX_FDS:                            
return "Unix file descriptor missing";
 
  966    case DBUS_INVALID_NESTED_TOO_DEEPLY:                           
return "Variants cannot be used to create a hugely recursive tree of values";
 
  967    case DBUS_VALIDITY_LAST:
 
  991  const unsigned char *s;
 
  992  const unsigned char *end;
 
  993  const unsigned char *iface;
 
  994  const unsigned char *last_dot;
 
 1000  if (len > _dbus_string_get_length (str) - start)
 
 1010  iface = _dbus_string_get_const_udata (str) + start;
 
 1017  if (_DBUS_UNLIKELY (*s == 
'.')) 
 
 1028          if (_DBUS_UNLIKELY ((s + 1) == end))
 
 1043  if (_DBUS_UNLIKELY (last_dot == 
NULL))
 
 
 1067  const unsigned char *s;
 
 1068  const unsigned char *end;
 
 1069  const unsigned char *member;
 
 1075  if (len > _dbus_string_get_length (str) - start)
 
 1084  member = _dbus_string_get_const_udata (str) + start;
 
 
 1136#define VALID_INITIAL_BUS_NAME_CHARACTER(c)         \ 
 1137  ( ((c) >= 'A' && (c) <= 'Z') ||               \ 
 1138    ((c) >= 'a' && (c) <= 'z') ||               \ 
 1139    ((c) == '_') || ((c) == '-')) 
 
 1145#define VALID_BUS_NAME_CHARACTER(c)                 \ 
 1146  ( ((c) >= '0' && (c) <= '9') ||               \ 
 1147    ((c) >= 'A' && (c) <= 'Z') ||               \ 
 1148    ((c) >= 'a' && (c) <= 'z') ||               \ 
 1149    ((c) == '_') || ((c) == '-')) 
 
 1152_dbus_validate_bus_name_full (
const DBusString  *str,
 
 1157  const unsigned char *s;
 
 1158  const unsigned char *end;
 
 1159  const unsigned char *iface;
 
 1160  const unsigned char *last_dot;
 
 1166  if (len > _dbus_string_get_length (str) - start)
 
 1176  iface = _dbus_string_get_const_udata (str) + start;
 
 1191            if (_DBUS_UNLIKELY ((s + 1) == end))
 
 1207  else if (_DBUS_UNLIKELY (*s == 
'.')) 
 
 1218          if (_DBUS_UNLIKELY ((s + 1) == end))
 
 1233  if (!is_namespace && _DBUS_UNLIKELY (last_dot == 
NULL))
 
 1257  return _dbus_validate_bus_name_full (str, start, len, 
FALSE);
 
 
 1278  return _dbus_validate_bus_name_full (str, start, len, 
TRUE);
 
 
#define _DBUS_INT_TO_POINTER(integer)
Safely stuffs an integer into a pointer, to be extracted later with _DBUS_POINTER_TO_INT.
#define _dbus_assert_not_reached(explanation)
Aborts with an error message if called.
#define _dbus_assert(condition)
Aborts with an error message if the condition is false.
#define _DBUS_POINTER_TO_INT(pointer)
Safely casts a void* to an integer; should only be used on void* that actually contain integers,...
#define _DBUS_N_ELEMENTS(array)
Computes the number of elements in a fixed-size array using sizeof().
#define _DBUS_INT32_MAX
Maximum value of type "int32".
void * _dbus_list_pop_last(DBusList **list)
Removes the last value in the list and returns it.
void _dbus_list_clear(DBusList **list)
Frees all links in the list and sets the list head to NULL.
dbus_bool_t _dbus_list_append(DBusList **list, void *data)
Appends a value to the list.
#define NULL
A null pointer, defined appropriately for C or C++.
#define TRUE
Expands to "1".
#define FALSE
Expands to "0".
void _dbus_type_reader_recurse(DBusTypeReader *reader, DBusTypeReader *sub)
Initialize a new reader pointing to the first type and corresponding value that's a child of the curr...
DBusValidity
This is primarily used in unit testing, so we can verify that each invalid message is invalid for the...
DBusValidity _dbus_validate_signature_with_reason(const DBusString *type_str, int type_pos, int len)
Verifies that the range of type_str from type_pos to type_end is a valid signature.
#define VALID_NAME_CHARACTER(c)
Determine wether the given character is valid as a second or later character in a name.
#define VALID_INITIAL_BUS_NAME_CHARACTER(c)
Determine wether the given character is valid as the first character in a bus name.
#define VALID_BUS_NAME_CHARACTER(c)
Determine wether the given character is valid as a second or later character in a bus name.
int _dbus_type_get_alignment(int typecode)
Gets the alignment requirement for the given type; will be 1, 2, 4, or 8.
#define DEFINE_DBUS_NAME_CHECK(what)
Define a name check to be used in _dbus_return_if_fail() statements.
void _dbus_type_reader_init_types_only(DBusTypeReader *reader, const DBusString *type_str, int type_pos)
Like _dbus_type_reader_init() but the iteration is over the signature, not over values.
dbus_bool_t _dbus_validate_error_name(const DBusString *str, int start, int len)
Checks that the given range of the string is a valid error name in the D-Bus protocol.
dbus_uint32_t _dbus_unpack_uint32(int byte_order, const unsigned char *data)
Unpacks a 32 bit unsigned integer from a data pointer.
int _dbus_first_type_in_signature(const DBusString *str, int pos)
Get the first type in the signature.
int _dbus_type_reader_get_element_type(const DBusTypeReader *reader)
Gets the type of an element of the array the reader is currently pointing to.
dbus_bool_t _dbus_validate_member(const DBusString *str, int start, int len)
Checks that the given range of the string is a valid member name in the D-Bus protocol.
dbus_bool_t _dbus_type_reader_next(DBusTypeReader *reader)
Skip to the next value on this "level".
dbus_bool_t _dbus_validate_bus_namespace(const DBusString *str, int start, int len)
Checks that the given range of the string is a prefix of a valid bus name in the D-Bus protocol.
#define VALID_INITIAL_NAME_CHARACTER(c)
Determine wether the given character is valid as the first character in a name.
dbus_bool_t _dbus_validate_path(const DBusString *str, int start, int len)
Checks that the given range of the string is a valid object path name in the D-Bus protocol.
dbus_bool_t _dbus_validate_interface(const DBusString *str, int start, int len)
Checks that the given range of the string is a valid interface name in the D-Bus protocol.
const char * _dbus_type_to_string(int typecode)
Returns a string describing the given type.
DBusValidity _dbus_validate_body_with_reason(const DBusString *expected_signature, int expected_signature_start, int byte_order, int *bytes_remaining, const DBusString *value_str, int value_pos, int len)
Verifies that the range of value_str from value_pos to value_end is a legitimate value of type expect...
int _dbus_type_reader_get_current_type(const DBusTypeReader *reader)
Gets the type of the value the reader is currently pointing to; or for a types-only reader gets the t...
dbus_bool_t _dbus_validate_bus_name(const DBusString *str, int start, int len)
Checks that the given range of the string is a valid bus name in the D-Bus protocol.
@ DBUS_VALIDITY_UNKNOWN_OOM_ERROR
can't determine validity due to OOM
@ DBUS_INVALID_TOO_MUCH_DATA
trailing junk makes it invalid
@ DBUS_VALID
the data is valid
#define DBUS_TYPE_SIGNATURE
Type code marking a D-Bus type signature.
#define DBUS_MAXIMUM_SIGNATURE_LENGTH
This one is 255 so it fits in a byte.
#define DBUS_DICT_ENTRY_END_CHAR
Code marking the end of a dict entry type in a type signature.
#define DBUS_TYPE_OBJECT_PATH
Type code marking a D-Bus object path.
#define DBUS_TYPE_BYTE
Type code marking an 8-bit unsigned integer.
#define DBUS_TYPE_INT16
Type code marking a 16-bit signed integer.
#define DBUS_TYPE_VARIANT
Type code marking a D-Bus variant type.
#define DBUS_MAXIMUM_ARRAY_LENGTH
Max length of a marshaled array in bytes (64M, 2^26) We use signed int for lengths so must be INT_MAX...
#define DBUS_TYPE_INT32
Type code marking a 32-bit signed integer.
#define DBUS_TYPE_UNIX_FD
Type code marking a unix file descriptor.
#define DBUS_TYPE_BOOLEAN
Type code marking a boolean.
#define DBUS_STRUCT_BEGIN_CHAR
Code marking the start of a struct type in a type signature.
#define DBUS_TYPE_STRING
Type code marking a UTF-8 encoded, nul-terminated Unicode string.
#define DBUS_MAXIMUM_NAME_LENGTH
Max length in bytes of a bus name, interface, or member (not object path, paths are unlimited).
#define DBUS_TYPE_ARRAY
Type code marking a D-Bus array type.
#define DBUS_TYPE_INVALID
Type code that is never equal to a legitimate type code.
#define DBUS_MAXIMUM_TYPE_RECURSION_DEPTH
Depth of recursion in the type tree.
#define DBUS_TYPE_INT64
Type code marking a 64-bit signed integer.
#define DBUS_TYPE_DOUBLE
Type code marking an 8-byte double in IEEE 754 format.
#define DBUS_TYPE_UINT64
Type code marking a 64-bit unsigned integer.
#define DBUS_TYPE_DICT_ENTRY
Type code used to represent a dict entry; however, this type code does not appear in type signatures,...
#define DBUS_DICT_ENTRY_BEGIN_CHAR
Code marking the start of a dict entry type in a type signature.
#define DBUS_TYPE_UINT16
Type code marking a 16-bit unsigned integer.
#define DBUS_TYPE_STRUCT
STRUCT and DICT_ENTRY are sort of special since their codes can't appear in a type string,...
#define DBUS_STRUCT_END_CHAR
Code marking the end of a struct type in a type signature.
#define DBUS_TYPE_UINT32
Type code marking a 32-bit unsigned integer.
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 ful...
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.
dbus_bool_t dbus_type_is_valid(int typecode)
Return TRUE if the argument is a valid typecode.
dbus_bool_t _dbus_string_validate_utf8(const DBusString *str, int start, int len)
Checks that the given range of the string is valid UTF-8.
void _dbus_string_init_const_len(DBusString *str, const char *value, int len)
Initializes a constant string with a length.
unsigned int dbus_uint32_t
A 32-bit unsigned integer on all platforms.
dbus_uint32_t dbus_bool_t
A boolean, valid values are TRUE and FALSE.
The type reader is an iterator for reading values from a block of values.
int type_pos
current position in signature