Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:13

0001 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
0002 /* dbus-types.h  types such as dbus_bool_t
0003  *
0004  * Copyright (C) 2002  Red Hat Inc.
0005  *
0006  * Licensed under the Academic Free License version 2.1
0007  *
0008  * This program is free software; you can redistribute it and/or modify
0009  * it under the terms of the GNU General Public License as published by
0010  * the Free Software Foundation; either version 2 of the License, or
0011  * (at your option) any later version.
0012  *
0013  * This program is distributed in the hope that it will be useful,
0014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0016  * GNU General Public License for more details.
0017  *
0018  * You should have received a copy of the GNU General Public License
0019  * along with this program; if not, write to the Free Software
0020  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
0021  *
0022  */
0023 #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
0024 #error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
0025 #endif
0026 
0027 #ifndef DBUS_TYPES_H
0028 #define DBUS_TYPES_H
0029 
0030 #include <stddef.h>
0031 #include <dbus/dbus-arch-deps.h>
0032 
0033 typedef dbus_uint32_t  dbus_unichar_t;
0034 /* boolean size must be fixed at 4 bytes due to wire protocol! */
0035 typedef dbus_uint32_t  dbus_bool_t;
0036 
0037 /* Normally docs are in .c files, but there isn't a .c file for this. */
0038 /**
0039  * @defgroup DBusTypes Basic types
0040  * @ingroup  DBus
0041  * @brief dbus_bool_t, dbus_int32_t, etc.
0042  *
0043  * Typedefs for common primitive types.
0044  *
0045  * @{
0046  */
0047 
0048 /**
0049  * @typedef dbus_bool_t
0050  *
0051  * A boolean, valid values are #TRUE and #FALSE.
0052  */
0053 
0054 /**
0055  * @typedef dbus_uint32_t
0056  *
0057  * A 32-bit unsigned integer on all platforms.
0058  */
0059 
0060 /**
0061  * @typedef dbus_int32_t
0062  *
0063  * A 32-bit signed integer on all platforms.
0064  */
0065 
0066 /**
0067  * @typedef dbus_uint16_t
0068  *
0069  * A 16-bit unsigned integer on all platforms.
0070  */
0071 
0072 /**
0073  * @typedef dbus_int16_t
0074  *
0075  * A 16-bit signed integer on all platforms.
0076  */
0077 
0078 
0079 /**
0080  * @typedef dbus_uint64_t
0081  *
0082  * A 64-bit unsigned integer.
0083  */
0084 
0085 /**
0086  * @typedef dbus_int64_t
0087  *
0088  * A 64-bit signed integer.
0089  */
0090 
0091 /**
0092  * @def DBUS_HAVE_INT64
0093  *
0094  * Always defined.
0095  *
0096  * In older libdbus versions, this would be undefined if there was no
0097  * 64-bit integer type on that platform. libdbus no longer supports
0098  * such platforms.
0099  */
0100 
0101 /**
0102  * @def DBUS_INT64_CONSTANT
0103  *
0104  * Declare a 64-bit signed integer constant. The macro
0105  * adds the necessary "LL" or whatever after the integer,
0106  * giving a literal such as "325145246765LL"
0107  */
0108 
0109 /**
0110  * @def DBUS_UINT64_CONSTANT
0111  *
0112  * Declare a 64-bit unsigned integer constant. The macro
0113  * adds the necessary "ULL" or whatever after the integer,
0114  * giving a literal such as "325145246765ULL"
0115  */
0116 
0117 /**
0118  * An 8-byte struct you could use to access int64 without having
0119  * int64 support. Use #dbus_int64_t or #dbus_uint64_t instead.
0120  */
0121 typedef struct
0122 {
0123   dbus_uint32_t first32;  /**< first 32 bits in the 8 bytes (beware endian issues) */
0124   dbus_uint32_t second32; /**< second 32 bits in the 8 bytes (beware endian issues) */
0125 } DBus8ByteStruct;
0126 
0127 /**
0128  * A simple value union that lets you access bytes as if they
0129  * were various types; useful when dealing with basic types via
0130  * void pointers and varargs.
0131  *
0132  * This union also contains a pointer member (which can be used
0133  * to retrieve a string from dbus_message_iter_get_basic(), for
0134  * instance), so on future platforms it could conceivably be larger
0135  * than 8 bytes.
0136  */
0137 typedef union
0138 {
0139   unsigned char bytes[8]; /**< as 8 individual bytes */
0140   dbus_int16_t  i16;   /**< as int16 */
0141   dbus_uint16_t u16;   /**< as int16 */
0142   dbus_int32_t  i32;   /**< as int32 */
0143   dbus_uint32_t u32;   /**< as int32 */
0144   dbus_bool_t   bool_val; /**< as boolean */
0145   dbus_int64_t  i64;   /**< as int64 */
0146   dbus_uint64_t u64;   /**< as int64 */
0147   DBus8ByteStruct eight; /**< as 8-byte struct */
0148   double dbl;          /**< as double */
0149   unsigned char byt;   /**< as byte */
0150   char *str;           /**< as char* (string, object path or signature) */
0151   int fd;              /**< as Unix file descriptor */
0152 } DBusBasicValue;
0153 
0154 /** @} */
0155 
0156 #endif /* DBUS_TYPES_H */