24#ifndef DBUS_STRING_PRIVATE_H
25#define DBUS_STRING_PRIVATE_H
27#include <dbus/dbus-internals.h>
28#include <dbus/dbus-memory.h>
29#include <dbus/dbus-types.h>
31#ifndef DBUS_CAN_USE_DBUS_STRING_PRIVATE
32#error "Don't go including dbus-string-private.h for no good reason"
69#define _DBUS_STRING_MAX_LENGTH (_DBUS_INT32_MAX - _DBUS_STRING_ALLOCATION_PADDING)
76#define DBUS_GENERIC_STRING_PREAMBLE(real) \
79 _dbus_assert ((real) != NULL); \
80 _dbus_assert ((real)->valid); \
81 _dbus_assert ((real)->len >= 0); \
82 _dbus_assert ((real)->allocated >= 0); \
83 _dbus_assert ((real)->len <= ((real)->allocated - _DBUS_STRING_ALLOCATION_PADDING)); \
84 _dbus_assert ((real)->len <= _DBUS_STRING_MAX_LENGTH); \
93#define DBUS_STRING_PREAMBLE(str) DBusRealString *real = (DBusRealString*) str; \
94 DBUS_GENERIC_STRING_PREAMBLE (real); \
95 _dbus_assert (!(real)->constant); \
96 _dbus_assert (!(real)->locked)
105#define DBUS_LOCKED_STRING_PREAMBLE(str) DBusRealString *real = (DBusRealString*) str; \
106 DBUS_GENERIC_STRING_PREAMBLE (real); \
107 _dbus_assert (!(real)->constant)
114#define DBUS_CONST_STRING_PREAMBLE(str) const DBusRealString *real = (DBusRealString*) str; \
115 DBUS_GENERIC_STRING_PREAMBLE (real)
121#define DBUS_IS_ASCII_BLANK(c) ((c) == ' ' || (c) == '\t')
127#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.
#define DBUS_END_DECLS
Macro used after declaring functions in the D-Bus header files.
unsigned int align_offset
str - align_offset is the actual malloc block
unsigned int valid
DBusString is valid (initialized and not freed)
unsigned int constant
String data is not owned by DBusString.
unsigned int locked
DBusString has been locked and can't be changed.
unsigned char * str
String data, plus nul termination.
int allocated
Allocated size of data.
int len
Length without nul.