D-Bus  1.12.16
dbus-marshal-header.h
1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 /* dbus-marshal-header.h Managing marshaling/demarshaling of message headers
3  *
4  * Copyright (C) 2005 Red Hat, Inc.
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_MARSHAL_HEADER_H
25 #define DBUS_MARSHAL_HEADER_H
26 
27 #include <dbus/dbus-marshal-basic.h>
28 #include <dbus/dbus-marshal-validate.h>
29 
30 typedef struct DBusHeader DBusHeader;
31 typedef struct DBusHeaderField DBusHeaderField;
32 
33 #define _DBUS_HEADER_FIELD_VALUE_UNKNOWN -1
34 #define _DBUS_HEADER_FIELD_VALUE_NONEXISTENT -2
35 
40 {
41  int value_pos;
42 };
43 
47 struct DBusHeader
48 {
60 };
61 
63 void _dbus_header_free (DBusHeader *header);
64 void _dbus_header_reinit (DBusHeader *header);
66  int byte_order,
67  int type,
68  const char *destination,
69  const char *path,
70  const char *interface,
71  const char *member,
72  const char *error_name);
74  DBusHeader *dest);
77  dbus_uint32_t serial);
80  int body_len);
81 DBUS_PRIVATE_EXPORT
83  int field,
84  int type,
85  const void *value);
87  int field,
88  int type,
89  void *value);
90 DBUS_PRIVATE_EXPORT
92  int field,
93  const DBusString **str,
94  int *pos);
95 DBUS_PRIVATE_EXPORT
97  int field);
99  dbus_uint32_t flag,
100  dbus_bool_t value);
102  dbus_uint32_t flag);
103 dbus_bool_t _dbus_header_ensure_signature (DBusHeader *header,
104  DBusString **type_str,
105  int *type_pos);
106 dbus_bool_t _dbus_header_have_message_untrusted (int max_message_length,
107  DBusValidity *validity,
108  int *byte_order,
109  int *fields_array_len,
110  int *header_len,
111  int *body_len,
112  const DBusString *str,
113  int start,
114  int len);
116  DBusValidationMode mode,
117  DBusValidity *validity,
118  int byte_order,
119  int fields_array_len,
120  int header_len,
121  int body_len,
122  const DBusString *str,
123  int start,
124  int len);
125 void _dbus_header_byteswap (DBusHeader *header,
126  int new_order);
127 DBUS_PRIVATE_EXPORT
128 char _dbus_header_get_byte_order (const DBusHeader *header);
129 
130 
131 
132 #endif /* DBUS_MARSHAL_HEADER_H */