summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-marshal.h
blob: 88a3b1a999d7ce42dd15bacca2ce71b4f088bd18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-marshal.h  Marshalling routines
 *
 * Copyright (C) 2002  CodeFactory AB
 *
 * Licensed under the Academic Free License version 1.2
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * 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
 *
 */

#ifndef DBUS_MARSHAL_H
#define DBUS_MARSHAL_H

#include <config.h>
#include <dbus/dbus-protocol.h>
#include <dbus/dbus-types.h>
#include <dbus/dbus-string.h>

#ifndef PACKAGE
#error "config.h not included here"
#endif

#ifdef WORDS_BIGENDIAN
#define DBUS_COMPILER_BYTE_ORDER DBUS_BIG_ENDIAN
#else
#define DBUS_COMPILER_BYTE_ORDER DBUS_LITTLE_ENDIAN
#endif

dbus_bool_t _dbus_marshal_double      (DBusString          *str,
				       int                  byte_order,
				       double               value);
dbus_bool_t _dbus_marshal_int32       (DBusString          *str,
				       int                  byte_order,
				       dbus_int32_t         value);
dbus_bool_t _dbus_marshal_uint32      (DBusString          *str,
				       int                  byte_order,
				       dbus_uint32_t        value);
dbus_bool_t _dbus_marshal_utf8_string (DBusString          *str,
				       int                  byte_order,
				       const char          *value);
dbus_bool_t _dbus_marshal_byte_array  (DBusString          *str,
				       int                  byte_order,
				       const unsigned char *value,
				       int                  len);


double        _dbus_demarshal_double      (DBusString *str,
					   int         byte_order,
					   int         pos,
					   int        *new_pos);
dbus_int32_t  _dbus_demarshal_int32       (DBusString *str,
					   int         byte_order,
					   int         pos,
					   int        *new_pos);
dbus_uint32_t _dbus_demarshal_uint32      (DBusString *str,
					   int         byte_order,
					   int         pos,
					   int        *new_pos);
char *        _dbus_demarshal_utf8_string (DBusString *str,
					   int         byte_order,
					   int         pos,
					   int        *new_pos);





#endif /* DBUS_PROTOCOL_H */