-/* -*- mode: C; c-file-style: "gnu" -*- */
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* dbus-marshal-recursive.h Marshalling routines for recursive types
*
* Copyright (C) 2004, 2005 Red Hat, Inc.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef DBUS_MARSHAL_RECURSIVE_H
#define DBUS_MARSHAL_RECURSIVE_H
-#include <config.h>
#include <dbus/dbus-protocol.h>
#include <dbus/dbus-list.h>
-#include <dbus/dbus-marshal-basic.h> /* this can vanish when we merge */
-
-#ifndef PACKAGE
-#error "config.h not included here"
-#endif
-
-/* Features we need to port dbus-message:
- * - memoize a position of a reader for small/fast access later
- * - delete an array element and re-align the remainder of the array
- * (not necessary yet to re-align remainder of entire string,
- * though that's probably just as hard/easy)
- * (really this one is to set a complex-type array element to
- * a new value, but for dbus-message.c delete-and-reappend would
- * be good enough)
- * - set string, int, etc. values at a memoized position
- * (implement generic set of any value? changes only
- * value_str not type_str)
- * - implement has_next()
- * - the all-in-one-block array accessors
- * - validation
- *
- * - remember to try a HAVE_INT64=0 build at the end
- */
-typedef struct DBusTypeMark DBusTypeMark;
typedef struct DBusTypeReader DBusTypeReader;
typedef struct DBusTypeWriter DBusTypeWriter;
typedef struct DBusTypeReaderClass DBusTypeReaderClass;
typedef struct DBusArrayLenFixup DBusArrayLenFixup;
-/** The mark is a way to compress a #DBusTypeReader; it isn't all that
- * successful though. The idea was to use this for caching header
- * fields in dbus-message.c. However now I'm thinking why not cache
- * the actual values (e.g. char*) and if the field needs to be set or
- * deleted, just linear search for it. Those operations are uncommon,
- * and getting the values should be fast and not involve all this type
- * reader nonsense.
- *
- * @todo DBusTypeMark isn't used right now and probably won't be, we should delete it
- */
-struct DBusTypeMark
-{
- dbus_uint32_t type_pos_in_value_str : 1; /**< true if the type_pos is in value_str and not type_str */
- dbus_uint32_t container_type : 3; /**< the "id" of the container type */
- dbus_uint32_t array_len_offset : 3; /**< bytes back from start_pos that len ends */
- dbus_uint32_t type_pos : DBUS_MAXIMUM_MESSAGE_LENGTH_BITS; /**< position in type_str */
- dbus_uint32_t value_pos : DBUS_MAXIMUM_MESSAGE_LENGTH_BITS; /**< position in value_str */
- dbus_uint32_t array_start_pos : DBUS_MAXIMUM_MESSAGE_LENGTH_BITS; /**< start of the array the reader was iterating over */
-};
-
/**
* The type reader is an iterator for reading values from a block of
* values.
int type_pos,
const DBusString *value_str,
int value_pos);
-void _dbus_type_reader_init_from_mark (DBusTypeReader *reader,
- int byte_order,
- const DBusString *type_str,
- const DBusString *value_str,
- const DBusTypeMark *mark);
void _dbus_type_reader_init_types_only (DBusTypeReader *reader,
const DBusString *type_str,
int type_pos);
-void _dbus_type_reader_init_types_only_from_mark (DBusTypeReader *reader,
- const DBusString *type_str,
- const DBusTypeMark *mark);
-void _dbus_type_reader_save_mark (const DBusTypeReader *reader,
- DBusTypeMark *mark);
int _dbus_type_reader_get_current_type (const DBusTypeReader *reader);
int _dbus_type_reader_get_element_type (const DBusTypeReader *reader);
int _dbus_type_reader_get_value_pos (const DBusTypeReader *reader);
void _dbus_type_reader_read_basic (const DBusTypeReader *reader,
void *value);
+int _dbus_type_reader_get_array_length (const DBusTypeReader *reader);
void _dbus_type_reader_read_fixed_multi (const DBusTypeReader *reader,
void *value,
int *n_elements);
const DBusTypeReader *realign_root);
dbus_bool_t _dbus_type_reader_delete (DBusTypeReader *reader,
const DBusTypeReader *realign_root);
-dbus_bool_t _dbus_type_reader_greater_than (const DBusTypeReader *lhs,
- const DBusTypeReader *rhs);
+
+dbus_bool_t _dbus_type_reader_equal_values (const DBusTypeReader *lhs,
+ const DBusTypeReader *rhs);
+
+void _dbus_type_signature_next (const char *signature,
+ int *type_pos);
void _dbus_type_writer_init (DBusTypeWriter *writer,
int byte_order,
DBusTypeWriter *sub);
dbus_bool_t _dbus_type_writer_write_reader (DBusTypeWriter *writer,
DBusTypeReader *reader);
-dbus_bool_t _dbus_type_writer_write_reader_partial (DBusTypeWriter *writer,
- DBusTypeReader *reader,
- const DBusTypeReader *start_after,
- int start_after_new_pos,
- int start_after_new_len,
- DBusList **fixups);
-void _dbus_type_writer_set_enabled (DBusTypeWriter *writer,
- dbus_bool_t enabled);
#endif /* DBUS_MARSHAL_RECURSIVE_H */