dbus-marshal-byteswap: Byte-swap Unix fd indexes if needed
[platform/upstream/dbus.git] / dbus / dbus-protocol-gvariant.h
1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 /* dbus-protocol.h  D-Bus protocol constants
3  *
4  * Copyright (C) 2015  Samsung Electronics
5  *
6  * Licensed under the Academic Free License version 2.1
7  *
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.
12  *
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.
17  *
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
21  *
22  */
23
24 #ifndef DBUS_PROTOCOL_GVARIANT_H
25 #define DBUS_PROTOCOL_GVARIANT_H
26
27 #define DBUS_PROTOCOL_VERSION_GVARIANT 2
28
29 /** Header format is defined as a signature:
30  *   byte                            byte order
31  *   byte                            message type ID
32  *   byte                            flags
33  *   byte                            protocol version
34  *   uint64                          cookie
35  *   array of dict entries (uint64,variant)  (field name, value)
36  *
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.
40  */
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
53
54 #define FIRST_GVARIANT_FIELD_OFFSET  16 /* yyyyut is before a{tv}*/
55
56 #endif /* DBUS_PROTOCOL_GVARIANT_H */