26 #ifndef DBUS_STRING_PRIVATE_H
27 #define DBUS_STRING_PRIVATE_H
29 #include <dbus/dbus-internals.h>
30 #include <dbus/dbus-memory.h>
31 #include <dbus/dbus-types.h>
33 #ifndef DBUS_CAN_USE_DBUS_STRING_PRIVATE
34 #error "Don't go including dbus-string-private.h for no good reason"
50 unsigned int constant : 1;
51 unsigned int locked : 1;
52 unsigned int valid : 1;
53 unsigned int align_offset : 3;
71 #define _DBUS_STRING_MAX_LENGTH (_DBUS_INT32_MAX - _DBUS_STRING_ALLOCATION_PADDING)
78 #define DBUS_GENERIC_STRING_PREAMBLE(real) \
81 _dbus_assert ((real) != NULL); \
82 _dbus_assert ((real)->valid); \
83 _dbus_assert ((real)->len >= 0); \
84 _dbus_assert ((real)->allocated >= 0); \
85 _dbus_assert ((real)->len <= ((real)->allocated - _DBUS_STRING_ALLOCATION_PADDING)); \
86 _dbus_assert ((real)->len <= _DBUS_STRING_MAX_LENGTH); \
95 #define DBUS_STRING_PREAMBLE(str) DBusRealString *real = (DBusRealString*) str; \
96 DBUS_GENERIC_STRING_PREAMBLE (real); \
97 _dbus_assert (!(real)->constant); \
98 _dbus_assert (!(real)->locked)
107 #define DBUS_LOCKED_STRING_PREAMBLE(str) DBusRealString *real = (DBusRealString*) str; \
108 DBUS_GENERIC_STRING_PREAMBLE (real); \
109 _dbus_assert (!(real)->constant)
116 #define DBUS_CONST_STRING_PREAMBLE(str) const DBusRealString *real = (DBusRealString*) str; \
117 DBUS_GENERIC_STRING_PREAMBLE (real)
123 #define DBUS_IS_ASCII_BLANK(c) ((c) == ' ' || (c) == '\t')
129 #define DBUS_IS_ASCII_WHITE(c) ((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) == '\r')
#define DBUS_BEGIN_DECLS
Macro used prior to declaring functions in the D-Bus header files.
int len
Length without nul.
int allocated
Allocated size of data.
unsigned char * str
String data, plus nul termination.
#define DBUS_END_DECLS
Macro used after declaring functions in the D-Bus header files.