24 #ifndef DBUS_STRING_PRIVATE_H
25 #define DBUS_STRING_PRIVATE_H
27 #include <dbus/dbus-memory.h>
28 #include <dbus/dbus-types.h>
30 #ifndef DBUS_CAN_USE_DBUS_STRING_PRIVATE
31 #error "Don't go including dbus-string-private.h for no good reason"
48 unsigned int constant : 1;
49 unsigned int locked : 1;
50 unsigned int invalid : 1;
51 unsigned int align_offset : 3;
69 #define _DBUS_STRING_MAX_MAX_LENGTH (_DBUS_INT32_MAX - _DBUS_STRING_ALLOCATION_PADDING)
76 #define DBUS_GENERIC_STRING_PREAMBLE(real) _dbus_assert ((real) != NULL); _dbus_assert (!(real)->invalid); _dbus_assert ((real)->len >= 0); _dbus_assert ((real)->allocated >= 0); _dbus_assert ((real)->max_length >= 0); _dbus_assert ((real)->len <= ((real)->allocated - _DBUS_STRING_ALLOCATION_PADDING)); _dbus_assert ((real)->len <= (real)->max_length)
84 #define DBUS_STRING_PREAMBLE(str) DBusRealString *real = (DBusRealString*) str; \
85 DBUS_GENERIC_STRING_PREAMBLE (real); \
86 _dbus_assert (!(real)->constant); \
87 _dbus_assert (!(real)->locked)
96 #define DBUS_LOCKED_STRING_PREAMBLE(str) DBusRealString *real = (DBusRealString*) str; \
97 DBUS_GENERIC_STRING_PREAMBLE (real); \
98 _dbus_assert (!(real)->constant)
105 #define DBUS_CONST_STRING_PREAMBLE(str) const DBusRealString *real = (DBusRealString*) str; \
106 DBUS_GENERIC_STRING_PREAMBLE (real)
112 #define DBUS_IS_ASCII_BLANK(c) ((c) == ' ' || (c) == '\t')
118 #define DBUS_IS_ASCII_WHITE(c) ((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) == '\r')