mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-01-06 07:10:14 +01:00
2003-04-22 Havoc Pennington <hp@redhat.com>
* dbus/dbus-message.c, dbus/dbus-marshal.c: add 64-bit integer support, and do some code cleanups to share more code and speed up array marshal/demarshal. * dbus-1.0.pc.in (Cflags): put libdir include file in cflags * configure.in: generate dbus-arch-deps.h * dbus/dbus-protocol.h (DBUS_TYPE_INT64, DBUS_TYPE_UINT64): add 64-bit typecodes
This commit is contained in:
parent
b3a3969897
commit
b29d0c534a
15 changed files with 1419 additions and 301 deletions
13
ChangeLog
13
ChangeLog
|
|
@ -1,3 +1,16 @@
|
|||
2003-04-22 Havoc Pennington <hp@redhat.com>
|
||||
|
||||
* dbus/dbus-message.c, dbus/dbus-marshal.c: add 64-bit integer
|
||||
support, and do some code cleanups to share more code and
|
||||
speed up array marshal/demarshal.
|
||||
|
||||
* dbus-1.0.pc.in (Cflags): put libdir include file in cflags
|
||||
|
||||
* configure.in: generate dbus-arch-deps.h
|
||||
|
||||
* dbus/dbus-protocol.h (DBUS_TYPE_INT64, DBUS_TYPE_UINT64): add
|
||||
64-bit typecodes
|
||||
|
||||
2003-04-22 Havoc Pennington <hp@redhat.com>
|
||||
|
||||
* test/data/valid-messages/opposite-endian.message: fix test
|
||||
|
|
|
|||
32
configure.in
32
configure.in
|
|
@ -146,23 +146,50 @@ AC_CHECK_SIZEOF(void *)
|
|||
AC_CHECK_SIZEOF(long long)
|
||||
AC_CHECK_SIZEOF(__int64)
|
||||
|
||||
### this is only used in decode-gcov.c right now
|
||||
### See what our 64 bit type is called
|
||||
AC_MSG_CHECKING([64-bit integer type])
|
||||
|
||||
case 8 in
|
||||
$ac_cv_sizeof_int)
|
||||
dbusint64=int
|
||||
dbusint64_constant='(val)'
|
||||
dbusuint64_constant='(val)'
|
||||
;;
|
||||
$ac_cv_sizeof_long)
|
||||
dbusint64=long
|
||||
dbusint64_constant='(val##L)'
|
||||
dbusuint64_constant='(val##UL)'
|
||||
;;
|
||||
$ac_cv_sizeof_long_long)
|
||||
dbusint64='long long'
|
||||
dbusint64_constant='(val##LL)'
|
||||
dbusuint64_constant='(val##ULL)'
|
||||
;;
|
||||
$ac_cv_sizeof___int64)
|
||||
dbusint64=__int64
|
||||
dbusint64_constant='(val##i64)'
|
||||
dbusuint64_constant='(val##ui64)'
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_DEFINE_UNQUOTED(DBUS_INT64_TYPE, $dbusint64, [64-bit integer type])
|
||||
if test -z "$dbusint64" ; then
|
||||
DBUS_INT64_TYPE="no_int64_type_detected"
|
||||
DBUS_HAVE_INT64=0
|
||||
DBUS_INT64_CONSTANT=
|
||||
DBUS_UINT64_CONSTANT=
|
||||
AC_MSG_RESULT([none found])
|
||||
else
|
||||
DBUS_INT64_TYPE="$dbusint64"
|
||||
DBUS_HAVE_INT64=1
|
||||
DBUS_INT64_CONSTANT="$dbusint64_constant"
|
||||
DBUS_UINT64_CONSTANT="$dbusuint64_constant"
|
||||
AC_MSG_RESULT($DBUS_INT64_TYPE)
|
||||
fi
|
||||
|
||||
AC_SUBST(DBUS_INT64_TYPE)
|
||||
AC_SUBST(DBUS_INT64_CONSTANT)
|
||||
AC_SUBST(DBUS_UINT64_CONSTANT)
|
||||
AC_SUBST(DBUS_HAVE_INT64)
|
||||
|
||||
## byte order
|
||||
AC_C_BIGENDIAN
|
||||
|
|
@ -521,6 +548,7 @@ bus/session.conf
|
|||
bus/messagebus
|
||||
Makefile
|
||||
dbus/Makefile
|
||||
dbus/dbus-arch-deps.h
|
||||
glib/Makefile
|
||||
qt/Makefile
|
||||
bus/Makefile
|
||||
|
|
|
|||
|
|
@ -7,5 +7,5 @@ Name: dbus
|
|||
Description: Free desktop message bus
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -ldbus-1
|
||||
Cflags: -I${includedir}/dbus-1.0
|
||||
Cflags: -I${includedir}/dbus-1.0 -I${libdir}/dbus-1.0/include
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ INCLUDES=-I$(top_srcdir) $(DBUS_CLIENT_CFLAGS) -DDBUS_COMPILATION \
|
|||
-DDBUS_SYSTEM_BUS_PATH=\""@DBUS_SYSTEM_SOCKET@"\"
|
||||
|
||||
dbusincludedir=$(includedir)/dbus-1.0/dbus
|
||||
dbusarchincludedir=$(libdir)/dbus-1.0/include/dbus
|
||||
|
||||
lib_LTLIBRARIES=libdbus-1.la
|
||||
|
||||
|
|
@ -21,6 +22,9 @@ dbusinclude_HEADERS= \
|
|||
dbus-threads.h \
|
||||
dbus-types.h
|
||||
|
||||
dbusarchinclude_HEADERS= \
|
||||
dbus-arch-deps.h
|
||||
|
||||
### source code that goes in the installed client library
|
||||
### and is specific to library functionality
|
||||
DBUS_LIB_SOURCES= \
|
||||
|
|
@ -116,6 +120,9 @@ libdbus_convenience_la_SOURCES= \
|
|||
$(DBUS_SHARED_SOURCES) \
|
||||
$(DBUS_UTIL_SOURCES)
|
||||
|
||||
BUILT_SOURCES=$(dbusarchinclude_HEADERS)
|
||||
EXTRA_DIST=dbus-arch-deps.h.in
|
||||
|
||||
## this library is the same as libdbus, but exports all the symbols
|
||||
## and is only used for static linking within the dbus package.
|
||||
noinst_LTLIBRARIES=libdbus-convenience.la
|
||||
|
|
|
|||
51
dbus/dbus-arch-deps.h.in
Normal file
51
dbus/dbus-arch-deps.h.in
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/* -*- mode: C; c-file-style: "gnu" -*- */
|
||||
/* dbus-arch-deps.h Header with architecture/compiler specific information, installed to libdir
|
||||
*
|
||||
* Copyright (C) 2003 Red Hat, Inc.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
|
||||
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
|
||||
#endif
|
||||
|
||||
#ifndef DBUS_ARCH_DEPS_H
|
||||
#define DBUS_ARCH_DEPS_H
|
||||
|
||||
#include <dbus/dbus-types.h>
|
||||
#include <dbus/dbus-macros.h>
|
||||
|
||||
DBUS_BEGIN_DECLS;
|
||||
|
||||
#if @DBUS_HAVE_INT64@
|
||||
#define DBUS_HAVE_INT64 1
|
||||
typedef @DBUS_INT64_TYPE@ dbus_int64_t;
|
||||
typedef unsigned @DBUS_INT64_TYPE@ dbus_uint64_t;
|
||||
|
||||
#define DBUS_INT64_CONSTANT(val) @DBUS_INT64_CONSTANT@
|
||||
#define DBUS_UINT64_CONSTANT(val) @DBUS_UINT64_CONSTANT@
|
||||
|
||||
#else
|
||||
#undef DBUS_HAVE_INT64
|
||||
#undef DBUS_INT64_CONSTANT
|
||||
#undef DBUS_UINT64_CONSTANT
|
||||
#endif
|
||||
|
||||
DBUS_END_DECLS;
|
||||
|
||||
#endif /* DBUS_ARCH_DEPS_H */
|
||||
|
|
@ -115,10 +115,13 @@ dbus_bool_t _dbus_string_array_contains (const char **array,
|
|||
const char *str);
|
||||
char** _dbus_dup_string_array (const char **array);
|
||||
|
||||
|
||||
#define _DBUS_INT_MIN (-_DBUS_INT_MAX - 1)
|
||||
#define _DBUS_INT_MAX 2147483647
|
||||
#define _DBUS_UINT_MAX 0xffffffff
|
||||
#define _DBUS_INT_MIN (-_DBUS_INT_MAX - 1)
|
||||
#define _DBUS_INT_MAX 2147483647
|
||||
#define _DBUS_UINT_MAX 0xffffffff
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
#define _DBUS_INT64_MAX DBUS_INT64_CONSTANT (9223372036854775807)
|
||||
#define _DBUS_UINT64_MAX DBUS_UINT64_CONSTANT (0xffffffffffffffff)
|
||||
#endif
|
||||
#define _DBUS_ONE_KILOBYTE 1024
|
||||
#define _DBUS_ONE_MEGABYTE 1024 * _DBUS_ONE_KILOBYTE
|
||||
#define _DBUS_ONE_HOUR_IN_MILLISECONDS (1000 * 60 * 60)
|
||||
|
|
|
|||
1037
dbus/dbus-marshal.c
1037
dbus/dbus-marshal.c
File diff suppressed because it is too large
Load diff
|
|
@ -27,6 +27,7 @@
|
|||
#include <config.h>
|
||||
#include <dbus/dbus-protocol.h>
|
||||
#include <dbus/dbus-types.h>
|
||||
#include <dbus/dbus-arch-deps.h>
|
||||
#include <dbus/dbus-string.h>
|
||||
|
||||
#ifndef PACKAGE
|
||||
|
|
@ -39,25 +40,63 @@
|
|||
#define DBUS_COMPILER_BYTE_ORDER DBUS_LITTLE_ENDIAN
|
||||
#endif
|
||||
|
||||
#define DBUS_UINT32_SWAP_LE_BE_CONSTANT(val) ((dbus_uint32_t) ( \
|
||||
(((dbus_uint32_t) (val) & (dbus_uint32_t) 0x000000ffU) << 24) | \
|
||||
(((dbus_uint32_t) (val) & (dbus_uint32_t) 0x0000ff00U) << 8) | \
|
||||
(((dbus_uint32_t) (val) & (dbus_uint32_t) 0x00ff0000U) >> 8) | \
|
||||
#define DBUS_UINT32_SWAP_LE_BE_CONSTANT(val) ((dbus_uint32_t) ( \
|
||||
(((dbus_uint32_t) (val) & (dbus_uint32_t) 0x000000ffU) << 24) | \
|
||||
(((dbus_uint32_t) (val) & (dbus_uint32_t) 0x0000ff00U) << 8) | \
|
||||
(((dbus_uint32_t) (val) & (dbus_uint32_t) 0x00ff0000U) >> 8) | \
|
||||
(((dbus_uint32_t) (val) & (dbus_uint32_t) 0xff000000U) >> 24)))
|
||||
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
|
||||
#define DBUS_UINT64_SWAP_LE_BE_CONSTANT(val) ((dbus_uint64_t) ( \
|
||||
(((dbus_uint64_t) (val) & \
|
||||
(dbus_uint64_t) DBUS_UINT64_CONSTANT (0x00000000000000ff)) << 56) | \
|
||||
(((dbus_uint64_t) (val) & \
|
||||
(dbus_uint64_t) DBUS_UINT64_CONSTANT (0x000000000000ff00)) << 40) | \
|
||||
(((dbus_uint64_t) (val) & \
|
||||
(dbus_uint64_t) DBUS_UINT64_CONSTANT (0x0000000000ff0000)) << 24) | \
|
||||
(((dbus_uint64_t) (val) & \
|
||||
(dbus_uint64_t) DBUS_UINT64_CONSTANT (0x00000000ff000000)) << 8) | \
|
||||
(((dbus_uint64_t) (val) & \
|
||||
(dbus_uint64_t) DBUS_UINT64_CONSTANT (0x000000ff00000000)) >> 8) | \
|
||||
(((dbus_uint64_t) (val) & \
|
||||
(dbus_uint64_t) DBUS_UINT64_CONSTANT (0x0000ff0000000000)) >> 24) | \
|
||||
(((dbus_uint64_t) (val) & \
|
||||
(dbus_uint64_t) DBUS_UINT64_CONSTANT (0x00ff000000000000)) >> 40) | \
|
||||
(((dbus_uint64_t) (val) & \
|
||||
(dbus_uint64_t) DBUS_UINT64_CONSTANT (0xff00000000000000)) >> 56)))
|
||||
#endif /* DBUS_HAVE_INT64 */
|
||||
|
||||
#define DBUS_UINT32_SWAP_LE_BE(val) (DBUS_UINT32_SWAP_LE_BE_CONSTANT (val))
|
||||
#define DBUS_INT32_SWAP_LE_BE(val) ((dbus_int32_t)DBUS_UINT32_SWAP_LE_BE_CONSTANT (val))
|
||||
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
#define DBUS_UINT64_SWAP_LE_BE(val) (DBUS_UINT64_SWAP_LE_BE_CONSTANT (val))
|
||||
#define DBUS_INT64_SWAP_LE_BE(val) ((dbus_int64_t)DBUS_UINT64_SWAP_LE_BE_CONSTANT (val))
|
||||
#endif /* DBUS_HAVE_INT64 */
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
#define DBUS_INT32_TO_BE(val) ((dbus_int32_t) (val))
|
||||
#define DBUS_UINT32_TO_BE(val) ((dbus_uint32_t) (val))
|
||||
#define DBUS_INT32_TO_LE(val) (DBUS_INT32_SWAP_LE_BE (val))
|
||||
#define DBUS_UINT32_TO_LE(val) (DBUS_UINT32_SWAP_LE_BE (val))
|
||||
# ifdef DBUS_HAVE_INT64
|
||||
#define DBUS_INT64_TO_BE(val) ((dbus_int64_t) (val))
|
||||
#define DBUS_UINT64_TO_BE(val) ((dbus_uint64_t) (val))
|
||||
#define DBUS_INT64_TO_LE(val) (DBUS_INT64_SWAP_LE_BE (val))
|
||||
#define DBUS_UINT64_TO_LE(val) (DBUS_UINT64_SWAP_LE_BE (val))
|
||||
# endif /* DBUS_HAVE_INT64 */
|
||||
#else
|
||||
#define DBUS_INT32_TO_LE(val) ((dbus_int32_t) (val))
|
||||
#define DBUS_UINT32_TO_LE(val) ((dbus_uint32_t) (val))
|
||||
#define DBUS_INT32_TO_BE(val) ((dbus_int32_t) DBUS_UINT32_SWAP_LE_BE (val))
|
||||
#define DBUS_UINT32_TO_BE(val) (DBUS_UINT32_SWAP_LE_BE (val))
|
||||
# ifdef DBUS_HAVE_INT64
|
||||
#define DBUS_INT64_TO_LE(val) ((dbus_int64_t) (val))
|
||||
#define DBUS_UINT64_TO_LE(val) ((dbus_uint64_t) (val))
|
||||
#define DBUS_INT64_TO_BE(val) ((dbus_int64_t) DBUS_UINT64_SWAP_LE_BE (val))
|
||||
#define DBUS_UINT64_TO_BE(val) (DBUS_UINT64_SWAP_LE_BE (val))
|
||||
# endif /* DBUS_HAVE_INT64 */
|
||||
#endif
|
||||
|
||||
/* The transformation is symmetric, so the FROM just maps to the TO. */
|
||||
|
|
@ -65,6 +104,12 @@
|
|||
#define DBUS_UINT32_FROM_LE(val) (DBUS_UINT32_TO_LE (val))
|
||||
#define DBUS_INT32_FROM_BE(val) (DBUS_INT32_TO_BE (val))
|
||||
#define DBUS_UINT32_FROM_BE(val) (DBUS_UINT32_TO_BE (val))
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
#define DBUS_INT64_FROM_LE(val) (DBUS_INT64_TO_LE (val))
|
||||
#define DBUS_UINT64_FROM_LE(val) (DBUS_UINT64_TO_LE (val))
|
||||
#define DBUS_INT64_FROM_BE(val) (DBUS_INT64_TO_BE (val))
|
||||
#define DBUS_UINT64_FROM_BE(val) (DBUS_UINT64_TO_BE (val))
|
||||
#endif /* DBUS_HAVE_INT64 */
|
||||
|
||||
void _dbus_pack_int32 (dbus_int32_t value,
|
||||
int byte_order,
|
||||
|
|
@ -76,6 +121,18 @@ void _dbus_pack_uint32 (dbus_uint32_t value,
|
|||
unsigned char *data);
|
||||
dbus_uint32_t _dbus_unpack_uint32 (int byte_order,
|
||||
const unsigned char *data);
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
void _dbus_pack_int64 (dbus_int64_t value,
|
||||
int byte_order,
|
||||
unsigned char *data);
|
||||
dbus_int64_t _dbus_unpack_int64 (int byte_order,
|
||||
const unsigned char *data);
|
||||
void _dbus_pack_uint64 (dbus_uint64_t value,
|
||||
int byte_order,
|
||||
unsigned char *data);
|
||||
dbus_uint64_t _dbus_unpack_uint64 (int byte_order,
|
||||
const unsigned char *data);
|
||||
#endif /* DBUS_HAVE_INT64 */
|
||||
|
||||
void _dbus_marshal_set_int32 (DBusString *str,
|
||||
int byte_order,
|
||||
|
|
@ -85,6 +142,16 @@ void _dbus_marshal_set_uint32 (DBusString *str,
|
|||
int byte_order,
|
||||
int offset,
|
||||
dbus_uint32_t value);
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
void _dbus_marshal_set_int64 (DBusString *str,
|
||||
int byte_order,
|
||||
int offset,
|
||||
dbus_int64_t value);
|
||||
void _dbus_marshal_set_uint64 (DBusString *str,
|
||||
int byte_order,
|
||||
int offset,
|
||||
dbus_uint64_t value);
|
||||
#endif /* DBUS_HAVE_INT64 */
|
||||
dbus_bool_t _dbus_marshal_set_string (DBusString *str,
|
||||
int byte_order,
|
||||
int offset,
|
||||
|
|
@ -97,6 +164,14 @@ dbus_bool_t _dbus_marshal_int32 (DBusString *str,
|
|||
dbus_bool_t _dbus_marshal_uint32 (DBusString *str,
|
||||
int byte_order,
|
||||
dbus_uint32_t value);
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
dbus_bool_t _dbus_marshal_int64 (DBusString *str,
|
||||
int byte_order,
|
||||
dbus_int64_t value);
|
||||
dbus_bool_t _dbus_marshal_uint64 (DBusString *str,
|
||||
int byte_order,
|
||||
dbus_uint64_t value);
|
||||
#endif /* DBUS_HAVE_INT64 */
|
||||
dbus_bool_t _dbus_marshal_double (DBusString *str,
|
||||
int byte_order,
|
||||
double value);
|
||||
|
|
@ -115,6 +190,16 @@ dbus_bool_t _dbus_marshal_uint32_array (DBusString *str,
|
|||
int byte_order,
|
||||
const dbus_uint32_t *value,
|
||||
int len);
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
dbus_bool_t _dbus_marshal_int64_array (DBusString *str,
|
||||
int byte_order,
|
||||
const dbus_int64_t *value,
|
||||
int len);
|
||||
dbus_bool_t _dbus_marshal_uint64_array (DBusString *str,
|
||||
int byte_order,
|
||||
const dbus_uint64_t *value,
|
||||
int len);
|
||||
#endif /* DBUS_HAVE_INT64 */
|
||||
dbus_bool_t _dbus_marshal_double_array (DBusString *str,
|
||||
int byte_order,
|
||||
const double *value,
|
||||
|
|
@ -135,6 +220,16 @@ dbus_uint32_t _dbus_demarshal_uint32 (const DBusString *str,
|
|||
int byte_order,
|
||||
int pos,
|
||||
int *new_pos);
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
dbus_int64_t _dbus_demarshal_int64 (const DBusString *str,
|
||||
int byte_order,
|
||||
int pos,
|
||||
int *new_pos);
|
||||
dbus_uint64_t _dbus_demarshal_uint64 (const DBusString *str,
|
||||
int byte_order,
|
||||
int pos,
|
||||
int *new_pos);
|
||||
#endif /* DBUS_HAVE_INT64 */
|
||||
char * _dbus_demarshal_string (const DBusString *str,
|
||||
int byte_order,
|
||||
int pos,
|
||||
|
|
@ -157,6 +252,20 @@ dbus_bool_t _dbus_demarshal_uint32_array (const DBusString *str,
|
|||
int *new_pos,
|
||||
dbus_uint32_t **array,
|
||||
int *array_len);
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
dbus_bool_t _dbus_demarshal_int64_array (const DBusString *str,
|
||||
int byte_order,
|
||||
int pos,
|
||||
int *new_pos,
|
||||
dbus_int64_t **array,
|
||||
int *array_len);
|
||||
dbus_bool_t _dbus_demarshal_uint64_array (const DBusString *str,
|
||||
int byte_order,
|
||||
int pos,
|
||||
int *new_pos,
|
||||
dbus_uint64_t **array,
|
||||
int *array_len);
|
||||
#endif /* DBUS_HAVE_INT64 */
|
||||
dbus_bool_t _dbus_demarshal_double_array (const DBusString *str,
|
||||
int byte_order,
|
||||
int pos,
|
||||
|
|
|
|||
|
|
@ -295,6 +295,8 @@ append_saved_length (DBusString *dest,
|
|||
* @code
|
||||
* INT32 <N> marshals an INT32
|
||||
* UINT32 <N> marshals a UINT32
|
||||
* INT64 <N> marshals an INT64
|
||||
* UINT64 <N> marshals a UINT64
|
||||
* DOUBLE <N> marshals a double
|
||||
* STRING 'Foo' marshals a string
|
||||
* BYTE_ARRAY { 'a', 3, 4, 5, 6} marshals a BYTE array
|
||||
|
|
|
|||
|
|
@ -1195,15 +1195,18 @@ dbus_message_get_service (DBusMessage *message)
|
|||
}
|
||||
|
||||
/**
|
||||
* Appends fields to a message given a variable argument
|
||||
* list. The variable argument list should contain the type
|
||||
* of the argument followed by the value to add.
|
||||
* Array values are specified by a int typecode followed by a pointer
|
||||
* to the array followed by an int giving the length of the array.
|
||||
* The argument list must be terminated with 0.
|
||||
* Appends fields to a message given a variable argument list. The
|
||||
* variable argument list should contain the type of the argument
|
||||
* followed by the value to add. Array values are specified by an int
|
||||
* typecode followed by a pointer to the array followed by an int
|
||||
* giving the length of the array. The argument list must be
|
||||
* terminated with DBUS_TYPE_INVALID.
|
||||
*
|
||||
* This function doesn't support dicts or non-fundamental arrays.
|
||||
*
|
||||
* This function supports #DBUS_TYPE_INT64 and #DBUS_TYPE_UINT64
|
||||
* only if #DBUS_HAVE_INT64 is defined.
|
||||
*
|
||||
* @param message the message
|
||||
* @param first_arg_type type of the first argument
|
||||
* @param ... value of first argument, list of additional type-value pairs
|
||||
|
|
@ -1227,10 +1230,11 @@ dbus_message_append_args (DBusMessage *message,
|
|||
}
|
||||
|
||||
/**
|
||||
* This function takes a va_list for use by language bindings
|
||||
* This function takes a va_list for use by language bindings.
|
||||
* It's otherwise the same as dbus_message_append_args().
|
||||
*
|
||||
* @todo: Shouldn't this function clean up the changes to the message
|
||||
* on failures?
|
||||
* on failures? (Yes)
|
||||
|
||||
* @see dbus_message_append_args.
|
||||
* @param message the message
|
||||
|
|
@ -1272,6 +1276,16 @@ dbus_message_append_args_valist (DBusMessage *message,
|
|||
if (!dbus_message_iter_append_uint32 (&iter, va_arg (var_args, dbus_uint32_t)))
|
||||
goto errorout;
|
||||
break;
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
case DBUS_TYPE_INT64:
|
||||
if (!dbus_message_iter_append_int64 (&iter, va_arg (var_args, dbus_int64_t)))
|
||||
goto errorout;
|
||||
break;
|
||||
case DBUS_TYPE_UINT64:
|
||||
if (!dbus_message_iter_append_uint64 (&iter, va_arg (var_args, dbus_uint64_t)))
|
||||
goto errorout;
|
||||
break;
|
||||
#endif /* DBUS_HAVE_INT64 */
|
||||
case DBUS_TYPE_DOUBLE:
|
||||
if (!dbus_message_iter_append_double (&iter, va_arg (var_args, double)))
|
||||
goto errorout;
|
||||
|
|
@ -1321,6 +1335,16 @@ dbus_message_append_args_valist (DBusMessage *message,
|
|||
if (!dbus_message_iter_append_uint32_array (&iter, (dbus_uint32_t *)data, len))
|
||||
goto errorout;
|
||||
break;
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
case DBUS_TYPE_INT64:
|
||||
if (!dbus_message_iter_append_int64_array (&iter, (dbus_int64_t *)data, len))
|
||||
goto errorout;
|
||||
break;
|
||||
case DBUS_TYPE_UINT64:
|
||||
if (!dbus_message_iter_append_uint64_array (&iter, (dbus_uint64_t *)data, len))
|
||||
goto errorout;
|
||||
break;
|
||||
#endif /* DBUS_HAVE_INT64 */
|
||||
case DBUS_TYPE_DOUBLE:
|
||||
if (!dbus_message_iter_append_double_array (&iter, (double *)data, len))
|
||||
goto errorout;
|
||||
|
|
@ -1447,6 +1471,9 @@ dbus_message_iter_get_args (DBusMessageIter *iter,
|
|||
/**
|
||||
* This function takes a va_list for use by language bindings
|
||||
*
|
||||
* This function supports #DBUS_TYPE_INT64 and #DBUS_TYPE_UINT64
|
||||
* only if #DBUS_HAVE_INT64 is defined.
|
||||
*
|
||||
* @todo this function (or some lower-level non-convenience function)
|
||||
* needs better error handling; should allow the application to
|
||||
* distinguish between out of memory, and bad data from the remote
|
||||
|
|
@ -1534,7 +1561,27 @@ dbus_message_iter_get_args_valist (DBusMessageIter *iter,
|
|||
*ptr = dbus_message_iter_get_uint32 (iter);
|
||||
break;
|
||||
}
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
case DBUS_TYPE_INT64:
|
||||
{
|
||||
dbus_int64_t *ptr;
|
||||
|
||||
ptr = va_arg (var_args, dbus_int64_t *);
|
||||
|
||||
*ptr = dbus_message_iter_get_int64 (iter);
|
||||
break;
|
||||
}
|
||||
case DBUS_TYPE_UINT64:
|
||||
{
|
||||
dbus_uint64_t *ptr;
|
||||
|
||||
ptr = va_arg (var_args, dbus_uint64_t *);
|
||||
|
||||
*ptr = dbus_message_iter_get_uint64 (iter);
|
||||
break;
|
||||
}
|
||||
#endif /* DBUS_HAVE_INT64 */
|
||||
|
||||
case DBUS_TYPE_DOUBLE:
|
||||
{
|
||||
double *ptr;
|
||||
|
|
@ -1628,6 +1675,22 @@ dbus_message_iter_get_args_valist (DBusMessageIter *iter,
|
|||
goto out;
|
||||
}
|
||||
break;
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
case DBUS_TYPE_INT64:
|
||||
if (!dbus_message_iter_get_int64_array (iter, (dbus_int64_t **)data, len))
|
||||
{
|
||||
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
|
||||
goto out;
|
||||
}
|
||||
break;
|
||||
case DBUS_TYPE_UINT64:
|
||||
if (!dbus_message_iter_get_uint64_array (iter, (dbus_uint64_t **)data, len))
|
||||
{
|
||||
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
|
||||
goto out;
|
||||
}
|
||||
break;
|
||||
#endif /* DBUS_HAVE_INT64 */
|
||||
case DBUS_TYPE_DOUBLE:
|
||||
if (!dbus_message_iter_get_double_array (iter, (double **)data, len))
|
||||
{
|
||||
|
|
@ -2077,7 +2140,7 @@ dbus_message_iter_get_boolean (DBusMessageIter *iter)
|
|||
/**
|
||||
* Returns the 32 bit signed integer value that an iterator may point to.
|
||||
* Note that you need to check that the iterator points to
|
||||
* an integer value before using this function.
|
||||
* a 32-bit integer value before using this function.
|
||||
*
|
||||
* @see dbus_message_iter_get_arg_type
|
||||
* @param iter the message iter
|
||||
|
|
@ -2102,7 +2165,7 @@ dbus_message_iter_get_int32 (DBusMessageIter *iter)
|
|||
/**
|
||||
* Returns the 32 bit unsigned integer value that an iterator may point to.
|
||||
* Note that you need to check that the iterator points to
|
||||
* an unsigned integer value before using this function.
|
||||
* a 32-bit unsigned integer value before using this function.
|
||||
*
|
||||
* @see dbus_message_iter_get_arg_type
|
||||
* @param iter the message iter
|
||||
|
|
@ -2124,6 +2187,64 @@ dbus_message_iter_get_uint32 (DBusMessageIter *iter)
|
|||
pos, NULL);
|
||||
}
|
||||
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
|
||||
/**
|
||||
* Returns the 64 bit signed integer value that an iterator may point
|
||||
* to. Note that you need to check that the iterator points to a
|
||||
* 64-bit integer value before using this function.
|
||||
*
|
||||
* This function only exists if #DBUS_HAVE_INT64 is defined.
|
||||
*
|
||||
* @see dbus_message_iter_get_arg_type
|
||||
* @param iter the message iter
|
||||
* @returns the integer
|
||||
*/
|
||||
dbus_int64_t
|
||||
dbus_message_iter_get_int64 (DBusMessageIter *iter)
|
||||
{
|
||||
DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
|
||||
int type, pos;
|
||||
|
||||
dbus_message_iter_check (real);
|
||||
|
||||
pos = dbus_message_iter_get_data_start (real, &type);
|
||||
|
||||
_dbus_assert (type == DBUS_TYPE_INT64);
|
||||
|
||||
return _dbus_demarshal_int64 (&real->message->body, real->message->byte_order,
|
||||
pos, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the 64 bit unsigned integer value that an iterator may point to.
|
||||
* Note that you need to check that the iterator points to
|
||||
* a 64-bit unsigned integer value before using this function.
|
||||
*
|
||||
* This function only exists if #DBUS_HAVE_INT64 is defined.
|
||||
*
|
||||
* @see dbus_message_iter_get_arg_type
|
||||
* @param iter the message iter
|
||||
* @returns the integer
|
||||
*/
|
||||
dbus_uint64_t
|
||||
dbus_message_iter_get_uint64 (DBusMessageIter *iter)
|
||||
{
|
||||
DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
|
||||
int type, pos;
|
||||
|
||||
dbus_message_iter_check (real);
|
||||
|
||||
pos = dbus_message_iter_get_data_start (real, &type);
|
||||
|
||||
_dbus_assert (type == DBUS_TYPE_UINT64);
|
||||
|
||||
return _dbus_demarshal_uint64 (&real->message->body, real->message->byte_order,
|
||||
pos, NULL);
|
||||
}
|
||||
|
||||
#endif /* DBUS_HAVE_INT64 */
|
||||
|
||||
/**
|
||||
* Returns the double value that an iterator may point to.
|
||||
* Note that you need to check that the iterator points to
|
||||
|
|
@ -2386,6 +2507,83 @@ dbus_message_iter_get_uint32_array (DBusMessageIter *iter,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
|
||||
/**
|
||||
* Returns the 64 bit signed integer array that the iterator may point
|
||||
* to. Note that you need to check that the iterator points to an
|
||||
* array of the correct type prior to using this function.
|
||||
*
|
||||
* This function only exists if #DBUS_HAVE_INT64 is defined.
|
||||
*
|
||||
* @param iter the iterator
|
||||
* @param value return location for the array
|
||||
* @param len return location for the array length
|
||||
* @returns #TRUE on success
|
||||
*/
|
||||
dbus_bool_t
|
||||
dbus_message_iter_get_int64_array (DBusMessageIter *iter,
|
||||
dbus_int64_t **value,
|
||||
int *len)
|
||||
{
|
||||
DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
|
||||
int type, pos;
|
||||
|
||||
dbus_message_iter_check (real);
|
||||
|
||||
pos = dbus_message_iter_get_data_start (real, &type);
|
||||
|
||||
_dbus_assert (type == DBUS_TYPE_ARRAY);
|
||||
|
||||
type = iter_get_array_type (real, NULL);
|
||||
|
||||
_dbus_assert (type == DBUS_TYPE_INT64);
|
||||
|
||||
if (!_dbus_demarshal_int64_array (&real->message->body, real->message->byte_order,
|
||||
pos, NULL, value, len))
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the 64 bit unsigned integer array that the iterator may point
|
||||
* to. Note that you need to check that the iterator points to an
|
||||
* array of the correct type prior to using this function.
|
||||
*
|
||||
* This function only exists if #DBUS_HAVE_INT64 is defined.
|
||||
*
|
||||
* @param iter the iterator
|
||||
* @param value return location for the array
|
||||
* @param len return location for the array length
|
||||
* @returns #TRUE on success
|
||||
*/
|
||||
dbus_bool_t
|
||||
dbus_message_iter_get_uint64_array (DBusMessageIter *iter,
|
||||
dbus_uint64_t **value,
|
||||
int *len)
|
||||
{
|
||||
DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
|
||||
int type, pos;
|
||||
|
||||
dbus_message_iter_check (real);
|
||||
|
||||
pos = dbus_message_iter_get_data_start (real, &type);
|
||||
|
||||
_dbus_assert (type == DBUS_TYPE_ARRAY);
|
||||
|
||||
type = iter_get_array_type (real, NULL);
|
||||
_dbus_assert (type == DBUS_TYPE_UINT64);
|
||||
|
||||
if (!_dbus_demarshal_uint64_array (&real->message->body, real->message->byte_order,
|
||||
pos, NULL, value, len))
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif /* DBUS_HAVE_INT64 */
|
||||
|
||||
/**
|
||||
* Returns the double array that the iterator may point to. Note that
|
||||
* you need to check that the iterator points to an array of the
|
||||
|
|
@ -2731,6 +2929,72 @@ dbus_message_iter_append_uint32 (DBusMessageIter *iter,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
|
||||
/**
|
||||
* Appends a 64 bit signed integer to the message.
|
||||
*
|
||||
* This function only exists if #DBUS_HAVE_INT64 is defined.
|
||||
*
|
||||
* @param iter an iterator pointing to the end of the message
|
||||
* @param value the integer value
|
||||
* @returns #TRUE on success
|
||||
*/
|
||||
dbus_bool_t
|
||||
dbus_message_iter_append_int64 (DBusMessageIter *iter,
|
||||
dbus_int64_t value)
|
||||
{
|
||||
DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
|
||||
|
||||
dbus_message_iter_append_check (real);
|
||||
|
||||
if (!dbus_message_iter_append_type (real, DBUS_TYPE_INT64))
|
||||
return FALSE;
|
||||
|
||||
if (!_dbus_marshal_int64 (&real->message->body, real->message->byte_order, value))
|
||||
{
|
||||
_dbus_string_set_length (&real->message->body, real->pos);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
dbus_message_iter_append_done (real);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a 64 bit unsigned integer to the message.
|
||||
*
|
||||
* This function only exists if #DBUS_HAVE_INT64 is defined.
|
||||
*
|
||||
* @param iter an iterator pointing to the end of the message
|
||||
* @param value the integer value
|
||||
* @returns #TRUE on success
|
||||
*/
|
||||
dbus_bool_t
|
||||
dbus_message_iter_append_uint64 (DBusMessageIter *iter,
|
||||
dbus_uint64_t value)
|
||||
{
|
||||
DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
|
||||
|
||||
dbus_message_iter_append_check (real);
|
||||
|
||||
if (!dbus_message_iter_append_type (real, DBUS_TYPE_UINT64))
|
||||
return FALSE;
|
||||
|
||||
if (!_dbus_marshal_uint64 (&real->message->body, real->message->byte_order, value))
|
||||
{
|
||||
_dbus_string_set_length (&real->message->body, real->pos);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
dbus_message_iter_append_done (real);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif /* DBUS_HAVE_INT64 */
|
||||
|
||||
/**
|
||||
* Appends a double value to the message.
|
||||
*
|
||||
|
|
@ -3145,6 +3409,75 @@ dbus_message_iter_append_uint32_array (DBusMessageIter *iter,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
|
||||
/**
|
||||
* Appends a 64 bit signed integer array to the message.
|
||||
*
|
||||
* This function only exists if #DBUS_HAVE_INT64 is defined.
|
||||
*
|
||||
* @param iter an iterator pointing to the end of the message
|
||||
* @param value the array
|
||||
* @param len the length of the array
|
||||
* @returns #TRUE on success
|
||||
*/
|
||||
dbus_bool_t
|
||||
dbus_message_iter_append_int64_array (DBusMessageIter *iter,
|
||||
const dbus_int64_t *value,
|
||||
int len)
|
||||
{
|
||||
DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
|
||||
|
||||
dbus_message_iter_append_check (real);
|
||||
|
||||
if (!append_array_type (real, DBUS_TYPE_INT64, NULL, NULL))
|
||||
return FALSE;
|
||||
|
||||
if (!_dbus_marshal_int64_array (&real->message->body, real->message->byte_order, value, len))
|
||||
{
|
||||
_dbus_string_set_length (&real->message->body, real->pos);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
dbus_message_iter_append_done (real);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a 64 bit unsigned integer array to the message.
|
||||
*
|
||||
* This function only exists if #DBUS_HAVE_INT64 is defined.
|
||||
*
|
||||
* @param iter an iterator pointing to the end of the message
|
||||
* @param value the array
|
||||
* @param len the length of the array
|
||||
* @returns #TRUE on success
|
||||
*/
|
||||
dbus_bool_t
|
||||
dbus_message_iter_append_uint64_array (DBusMessageIter *iter,
|
||||
const dbus_uint64_t *value,
|
||||
int len)
|
||||
{
|
||||
DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
|
||||
|
||||
dbus_message_iter_append_check (real);
|
||||
|
||||
if (!append_array_type (real, DBUS_TYPE_UINT64, NULL, NULL))
|
||||
return FALSE;
|
||||
|
||||
if (!_dbus_marshal_uint64_array (&real->message->body, real->message->byte_order, value, len))
|
||||
{
|
||||
_dbus_string_set_length (&real->message->body, real->pos);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
dbus_message_iter_append_done (real);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif /* DBUS_HAVE_INT64 */
|
||||
|
||||
/**
|
||||
* Appends a double array to the message.
|
||||
*
|
||||
|
|
@ -3648,7 +3981,8 @@ decode_string_field (const DBusString *data,
|
|||
|
||||
if (type != DBUS_TYPE_STRING)
|
||||
{
|
||||
_dbus_verbose ("%s field has wrong type\n", field_name);
|
||||
_dbus_verbose ("%s field has wrong type %s\n",
|
||||
field_name, _dbus_type_to_string (type));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -4414,6 +4748,16 @@ check_message_handling_type (DBusMessageIter *iter,
|
|||
case DBUS_TYPE_UINT32:
|
||||
dbus_message_iter_get_uint32 (iter);
|
||||
break;
|
||||
case DBUS_TYPE_INT64:
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
dbus_message_iter_get_int64 (iter);
|
||||
#endif
|
||||
break;
|
||||
case DBUS_TYPE_UINT64:
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
dbus_message_iter_get_uint64 (iter);
|
||||
#endif
|
||||
break;
|
||||
case DBUS_TYPE_DOUBLE:
|
||||
dbus_message_iter_get_double (iter);
|
||||
break;
|
||||
|
|
@ -5029,12 +5373,18 @@ verify_test_message (DBusMessage *message)
|
|||
int our_int_array_len;
|
||||
DBusMessageIter iter, dict;
|
||||
DBusError error;
|
||||
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
dbus_int64_t our_int64;
|
||||
#endif
|
||||
|
||||
dbus_message_iter_init (message, &iter);
|
||||
|
||||
dbus_error_init (&error);
|
||||
if (!dbus_message_iter_get_args (&iter, &error,
|
||||
DBUS_TYPE_INT32, &our_int,
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
DBUS_TYPE_INT64, &our_int64,
|
||||
#endif
|
||||
DBUS_TYPE_STRING, &our_str,
|
||||
DBUS_TYPE_DOUBLE, &our_double,
|
||||
DBUS_TYPE_BOOLEAN, &our_bool,
|
||||
|
|
@ -5048,6 +5398,11 @@ verify_test_message (DBusMessage *message)
|
|||
if (our_int != -0x12345678)
|
||||
_dbus_assert_not_reached ("integers differ!");
|
||||
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
if (our_int64 != -0x123456789abcd)
|
||||
_dbus_assert_not_reached ("64-bit integers differ!");
|
||||
#endif
|
||||
|
||||
if (our_double != 3.14159)
|
||||
_dbus_assert_not_reached ("doubles differ!");
|
||||
|
||||
|
|
@ -5134,6 +5489,9 @@ _dbus_message_test (const char *test_data_dir)
|
|||
_dbus_message_set_serial (message, 1);
|
||||
dbus_message_append_args (message,
|
||||
DBUS_TYPE_INT32, -0x12345678,
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
DBUS_TYPE_INT64, -0x123456789abcd,
|
||||
#endif
|
||||
DBUS_TYPE_STRING, "Test string",
|
||||
DBUS_TYPE_DOUBLE, 3.14159,
|
||||
DBUS_TYPE_BOOLEAN, TRUE,
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include <dbus/dbus-macros.h>
|
||||
#include <dbus/dbus-types.h>
|
||||
#include <dbus/dbus-arch-deps.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
DBUS_BEGIN_DECLS;
|
||||
|
|
@ -119,6 +120,10 @@ unsigned char dbus_message_iter_get_byte (DBusMessageIter *iter);
|
|||
dbus_bool_t dbus_message_iter_get_boolean (DBusMessageIter *iter);
|
||||
dbus_int32_t dbus_message_iter_get_int32 (DBusMessageIter *iter);
|
||||
dbus_uint32_t dbus_message_iter_get_uint32 (DBusMessageIter *iter);
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
dbus_int64_t dbus_message_iter_get_int64 (DBusMessageIter *iter);
|
||||
dbus_uint64_t dbus_message_iter_get_uint64 (DBusMessageIter *iter);
|
||||
#endif /* DBUS_HAVE_INT64 */
|
||||
double dbus_message_iter_get_double (DBusMessageIter *iter);
|
||||
char * dbus_message_iter_get_string (DBusMessageIter *iter);
|
||||
char * dbus_message_iter_get_dict_key (DBusMessageIter *iter);
|
||||
|
|
@ -144,6 +149,14 @@ dbus_bool_t dbus_message_iter_get_int32_array (DBusMessageIter *iter,
|
|||
dbus_bool_t dbus_message_iter_get_uint32_array (DBusMessageIter *iter,
|
||||
dbus_uint32_t **value,
|
||||
int *len);
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
dbus_bool_t dbus_message_iter_get_int64_array (DBusMessageIter *iter,
|
||||
dbus_int64_t **value,
|
||||
int *len);
|
||||
dbus_bool_t dbus_message_iter_get_uint64_array (DBusMessageIter *iter,
|
||||
dbus_uint64_t **value,
|
||||
int *len);
|
||||
#endif /* DBUS_HAVE_INT64 */
|
||||
dbus_bool_t dbus_message_iter_get_double_array (DBusMessageIter *iter,
|
||||
double **value,
|
||||
int *len);
|
||||
|
|
@ -163,6 +176,12 @@ dbus_bool_t dbus_message_iter_append_int32 (DBusMessageIter *iter,
|
|||
dbus_int32_t value);
|
||||
dbus_bool_t dbus_message_iter_append_uint32 (DBusMessageIter *iter,
|
||||
dbus_uint32_t value);
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
dbus_bool_t dbus_message_iter_append_int64 (DBusMessageIter *iter,
|
||||
dbus_int64_t value);
|
||||
dbus_bool_t dbus_message_iter_append_uint64 (DBusMessageIter *iter,
|
||||
dbus_uint64_t value);
|
||||
#endif /* DBUS_HAVE_INT64 */
|
||||
dbus_bool_t dbus_message_iter_append_double (DBusMessageIter *iter,
|
||||
double value);
|
||||
dbus_bool_t dbus_message_iter_append_string (DBusMessageIter *iter,
|
||||
|
|
@ -189,6 +208,14 @@ dbus_bool_t dbus_message_iter_append_int32_array (DBusMessageIter *iter,
|
|||
dbus_bool_t dbus_message_iter_append_uint32_array (DBusMessageIter *iter,
|
||||
const dbus_uint32_t *value,
|
||||
int len);
|
||||
#ifdef DBUS_HAVE_INT64
|
||||
dbus_bool_t dbus_message_iter_append_int64_array (DBusMessageIter *iter,
|
||||
const dbus_int64_t *value,
|
||||
int len);
|
||||
dbus_bool_t dbus_message_iter_append_uint64_array (DBusMessageIter *iter,
|
||||
const dbus_uint64_t *value,
|
||||
int len);
|
||||
#endif /* DBUS_HAVE_INT64 */
|
||||
dbus_bool_t dbus_message_iter_append_double_array (DBusMessageIter *iter,
|
||||
const double *value,
|
||||
int len);
|
||||
|
|
|
|||
|
|
@ -46,11 +46,13 @@ extern "C" {
|
|||
#define DBUS_TYPE_BOOLEAN 3
|
||||
#define DBUS_TYPE_INT32 4
|
||||
#define DBUS_TYPE_UINT32 5
|
||||
#define DBUS_TYPE_DOUBLE 6
|
||||
#define DBUS_TYPE_STRING 7
|
||||
#define DBUS_TYPE_NAMED 8
|
||||
#define DBUS_TYPE_ARRAY 9
|
||||
#define DBUS_TYPE_DICT 10
|
||||
#define DBUS_TYPE_INT64 6
|
||||
#define DBUS_TYPE_UINT64 7
|
||||
#define DBUS_TYPE_DOUBLE 8
|
||||
#define DBUS_TYPE_STRING 9
|
||||
#define DBUS_TYPE_NAMED 10
|
||||
#define DBUS_TYPE_ARRAY 11
|
||||
#define DBUS_TYPE_DICT 12
|
||||
|
||||
#define DBUS_TYPE_LAST DBUS_TYPE_DICT
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
#define DBUS_INSIDE_DBUS_H 1
|
||||
|
||||
#include <dbus/dbus-arch-deps.h>
|
||||
#include <dbus/dbus-address.h>
|
||||
#include <dbus/dbus-bus.h>
|
||||
#include <dbus/dbus-connection.h>
|
||||
|
|
|
|||
|
|
@ -327,25 +327,33 @@
|
|||
<entry>UINT32</entry>
|
||||
<entry>5</entry>
|
||||
<entry>32-bit unsigned integer</entry>
|
||||
</row><row>
|
||||
<entry>INT64</entry>
|
||||
<entry>6</entry>
|
||||
<entry>64-bit signed integer</entry>
|
||||
</row><row>
|
||||
<entry>UINT64</entry>
|
||||
<entry>7</entry>
|
||||
<entry>64-bit unsigned integer</entry>
|
||||
</row><row>
|
||||
<entry>DOUBLE</entry>
|
||||
<entry>6</entry>
|
||||
<entry>8</entry>
|
||||
<entry>IEEE 754 double</entry>
|
||||
</row><row>
|
||||
<entry>STRING</entry>
|
||||
<entry>7</entry>
|
||||
<entry>9</entry>
|
||||
<entry>UTF-8 string (<emphasis>must</emphasis> be valid UTF-8). Must be zero terminated. </entry>
|
||||
</row><row>
|
||||
<entry>NAMED</entry>
|
||||
<entry>8</entry>
|
||||
<entry>10</entry>
|
||||
<entry>A named byte array, used for custom types</entry>
|
||||
</row><row>
|
||||
<entry>ARRAY</entry>
|
||||
<entry>9</entry>
|
||||
<entry>11</entry>
|
||||
<entry>Array</entry>
|
||||
</row><row>
|
||||
<entry>DICT</entry>
|
||||
<entry>10</entry>
|
||||
<entry>12</entry>
|
||||
<entry>A dictionary of key/value pairs</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
|
|
@ -382,6 +390,12 @@
|
|||
</row><row>
|
||||
<entry>UINT32</entry>
|
||||
<entry>32-bit unsigned integer in the message's byte order, aligned to 4-byte boundary.</entry>
|
||||
</row><row>
|
||||
<entry>INT64</entry>
|
||||
<entry>64-bit signed integer in the message's byte order, aligned to 8-byte boundary.</entry>
|
||||
</row><row>
|
||||
<entry>UINT64</entry>
|
||||
<entry>64-bit unsigned integer in the message's byte order, aligned to 8-byte boundary.</entry>
|
||||
</row><row>
|
||||
<entry>DOUBLE</entry>
|
||||
<entry>64-bit IEEE 754 double in the message's byte order, aligned to 8-byte boundary.</entry>
|
||||
|
|
|
|||
|
|
@ -68,8 +68,6 @@ fetch_long (long *dest,
|
|||
return 0;
|
||||
}
|
||||
|
||||
typedef DBUS_INT64_TYPE dbus_int64_t;
|
||||
|
||||
static int
|
||||
fetch_long64 (dbus_int64_t *dest,
|
||||
const char *source,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue