1 /* -*- mode: C; c-file-style: "gnu" -*- */
2 /* dbus-string-private.h String utility class (internal to D-BUS implementation)
4 * Copyright (C) 2002, 2003 Red Hat, Inc.
6 * Licensed under the Academic Free License version 1.2
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #ifndef DBUS_STRING_PRIVATE_H
25 #define DBUS_STRING_PRIVATE_H
29 #include <dbus/dbus-memory.h>
30 #include <dbus/dbus-types.h>
32 #ifndef DBUS_CAN_USE_DBUS_STRING_PRIVATE
33 #error "Don't go including dbus-string-private.h for no good reason"
39 * @brief Internals of DBusString.
41 * DBusString internals. DBusString is an opaque objects, it must be
42 * used via accessor functions.
46 unsigned char *str; /**< String data, plus nul termination */
47 int len; /**< Length without nul */
48 int allocated; /**< Allocated size of data */
49 int max_length; /**< Max length of this string, without nul byte */
50 unsigned int constant : 1; /**< String data is not owned by DBusString */
51 unsigned int locked : 1; /**< DBusString has been locked and can't be changed */
52 unsigned int invalid : 1; /**< DBusString is invalid (e.g. already freed) */
53 unsigned int align_offset : 3; /**< str - align_offset is the actual malloc block */
58 #endif /* DBUS_STRING_PRIVATE_H */