DBusString implementation details
D-Bus secret internal implementation details

DBusString implementation details. More...

## Macros

#define | _DBUS_STRING_MAX_LENGTH (_DBUS_INT32_MAX - _DBUS_STRING_ALLOCATION_PADDING)
| The maximum length of a DBusString.
#define | DBUS_GENERIC_STRING_PREAMBLE(real)
| Checks a bunch of assertions about a string object.
#define | DBUS_STRING_PREAMBLE(str)
| Checks assertions about a string object that needs to be modifiable - may not be locked or const.
#define | DBUS_LOCKED_STRING_PREAMBLE(str)
| Checks assertions about a string object that may be locked but can't be const.
#define | DBUS_CONST_STRING_PREAMBLE(str)
| Checks assertions about a string that may be const or locked.
#define | DBUS_IS_ASCII_BLANK(c)
| Checks for ASCII blank byte.
#define | DBUS_IS_ASCII_WHITE(c)
| Checks for ASCII whitespace byte.

## Detailed Description

DBusString implementation details.

The guts of DBusString.

## Macro Definition Documentation

## _DBUS_STRING_MAX_LENGTH

#define _DBUS_STRING_MAX_LENGTH (_DBUS_INT32_MAX - _DBUS_STRING_ALLOCATION_PADDING)

The maximum length of a DBusString.

Definition at line 71 of file dbus-string-private.h.

Referenced by _dbus_string_append(), _dbus_string_init_const_len(), and _dbus_string_lengthen().

## DBUS_CONST_STRING_PREAMBLE

#define DBUS_CONST_STRING_PREAMBLE | ( |  | str | ) |

Value:
const DBusRealString *real = (DBusRealString*) str; \
DBUS_GENERIC_STRING_PREAMBLE (real)
DBusRealString
Internals of DBusString.
Definition dbus-string-private.h:46

Checks assertions about a string that may be const or locked.

Also declares the "real" variable pointing to DBusRealString.

Parameters

  str | the string.

Definition at line 116 of file dbus-string-private.h.

Referenced by _dbus_string_copy_data(), _dbus_string_copy_to_buffer(), _dbus_string_copy_to_buffer_with_nul(), _dbus_string_find_blank(), _dbus_string_find_byte_backward(), _dbus_string_find_eol(), _dbus_string_find_to(), _dbus_string_get_allocated_size(), _dbus_string_skip_blank(), _dbus_string_skip_white(), _dbus_string_skip_white_reverse(), _dbus_string_validate_ascii(), _dbus_string_validate_nul(), and _dbus_string_validate_utf8().

## DBUS_GENERIC_STRING_PREAMBLE

#define DBUS_GENERIC_STRING_PREAMBLE | ( |  | real | ) |

Value:
do { \
(void) real; /* might be unused unless asserting */ \
_dbus_assert ((real) != NULL); \
_dbus_assert ((real)->valid); \
_dbus_assert ((real)->len >= 0); \
_dbus_assert ((real)->allocated >= 0); \
_dbus_assert ((real)->len <= ((real)->allocated - _DBUS_STRING_ALLOCATION_PADDING)); \
_dbus_assert ((real)->len <= _DBUS_STRING_MAX_LENGTH); \
} while (0)
NULL
#define NULL
A null pointer, defined appropriately for C or C++.
Definition dbus-macros.h:51
_DBUS_STRING_MAX_LENGTH
#define _DBUS_STRING_MAX_LENGTH
The maximum length of a DBusString.
Definition dbus-string-private.h:71

Checks a bunch of assertions about a string object.

Parameters

  real | the DBusRealString

Definition at line 78 of file dbus-string-private.h.

Referenced by _dbus_string_ends_with_c_str(), _dbus_string_equal(), _dbus_string_equal_c_str(), _dbus_string_equal_len(), _dbus_string_equal_substring(), _dbus_string_free(), and _dbus_string_starts_with_c_str().

## DBUS_IS_ASCII_BLANK

#define DBUS_IS_ASCII_BLANK | ( |  | c | ) |

Value:
((c) == ' ' || (c) == '\t')

Checks for ASCII blank byte.

Parameters

  c | the byte

Definition at line 123 of file dbus-string-private.h.

Referenced by _dbus_string_skip_blank().

## DBUS_IS_ASCII_WHITE

#define DBUS_IS_ASCII_WHITE | ( |  | c | ) |

Value:
((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) == '\r')

Checks for ASCII whitespace byte.

Parameters

  c | the byte

Definition at line 129 of file dbus-string-private.h.

Referenced by _dbus_string_skip_white(), and _dbus_string_skip_white_reverse().

## DBUS_LOCKED_STRING_PREAMBLE

#define DBUS_LOCKED_STRING_PREAMBLE | ( |  | str | ) |

Value:
DBusRealString *real = (DBusRealString*) str; \
DBUS_GENERIC_STRING_PREAMBLE (real); \
_dbus_assert (!(real)->constant)

Checks assertions about a string object that may be locked but can't be const.

i.e. a string object that we can free. Also declares the "real" variable pointing to DBusRealString.

Parameters

  str | the string

Definition at line 107 of file dbus-string-private.h.

## DBUS_STRING_PREAMBLE

#define DBUS_STRING_PREAMBLE | ( |  | str | ) |

Value:
DBusRealString *real = (DBusRealString*) str; \
DBUS_GENERIC_STRING_PREAMBLE (real); \
_dbus_assert (!(real)->constant); \
_dbus_assert (!(real)->locked)

Checks assertions about a string object that needs to be modifiable - may not be locked or const.

Also declares the "real" variable pointing to DBusRealString.

Parameters

  str | the string

Definition at line 95 of file dbus-string-private.h.

Referenced by _dbus_string_append(), _dbus_string_append_byte(), _dbus_string_append_len(), _dbus_string_append_printf_valist(), _dbus_string_compact(), _dbus_string_delete(), _dbus_string_get_data_len(), _dbus_string_insert_2_aligned(), _dbus_string_insert_4_aligned(), _dbus_string_insert_8_aligned(), _dbus_string_insert_alignment(), _dbus_string_insert_byte(), _dbus_string_insert_bytes(), _dbus_string_lengthen(), _dbus_string_set_length(), _dbus_string_shorten(), _dbus_string_steal_data(), _dbus_string_tolower_ascii(), _dbus_string_toupper_ascii(), and _dbus_string_zero().