1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 /* dbus-protocol.h D-Bus protocol constants
4 * Copyright (C) 2015 Samsung Electronics
6 * Licensed under the Academic Free License version 2.1
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 #ifndef DBUS_PROTOCOL_GVARIANT_H
25 #define DBUS_PROTOCOL_GVARIANT_H
27 #define DBUS_PROTOCOL_VERSION_GVARIANT 2
29 /** Header format is defined as a signature:
31 * byte message type ID
33 * byte protocol version
35 * array of dict entries (uint64,variant) (field name, value)
37 * The length of the header can be computed as the
38 * fixed size of the initial data, plus the length of
39 * the array at the end, plus padding to an 8-boundary.
41 #define DBUS_HEADER_GVARIANT_SIGNATURE \
42 DBUS_TYPE_BYTE_AS_STRING \
43 DBUS_TYPE_BYTE_AS_STRING \
44 DBUS_TYPE_BYTE_AS_STRING \
45 DBUS_TYPE_BYTE_AS_STRING \
46 DBUS_TYPE_UINT64_AS_STRING \
47 DBUS_TYPE_ARRAY_AS_STRING \
48 DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING \
49 DBUS_TYPE_BYTE_AS_STRING \
50 DBUS_TYPE_VARIANT_AS_STRING \
51 DBUS_DICT_ENTRY_END_CHAR_AS_STRING \
52 DBUS_TYPE_VARIANT_AS_STRING
54 #define FIRST_GVARIANT_FIELD_OFFSET 16 /* yyyyut is before a{tv}*/
56 #endif /* DBUS_PROTOCOL_GVARIANT_H */