26#include "dbus-internals.h"
27#include "dbus-string.h"
211 int *minor_version_p,
212 int *micro_version_p)
215 *major_version_p = DBUS_MAJOR_VERSION;
217 *minor_version_p = DBUS_MINOR_VERSION;
219 *micro_version_p = DBUS_MICRO_VERSION;
225#ifdef DBUS_ENABLE_EMBEDDED_TESTS
227#ifndef DOXYGEN_SHOULD_SKIP_THIS
229#include "dbus-test.h"
234_dbus_misc_test (
void)
236 int major, minor, micro;
253#define MAKE_VERSION(x, y, z) (((x) << 16) | ((y) << 8) | (z))
256 _dbus_assert (MAKE_VERSION (1, 0, 0) > MAKE_VERSION (0, 0, 0));
257 _dbus_assert (MAKE_VERSION (1, 1, 0) > MAKE_VERSION (1, 0, 0));
258 _dbus_assert (MAKE_VERSION (1, 1, 1) > MAKE_VERSION (1, 1, 0));
260 _dbus_assert (MAKE_VERSION (2, 0, 0) > MAKE_VERSION (1, 1, 1));
261 _dbus_assert (MAKE_VERSION (2, 1, 0) > MAKE_VERSION (1, 1, 1));
262 _dbus_assert (MAKE_VERSION (2, 1, 1) > MAKE_VERSION (1, 1, 1));
265 _dbus_assert (MAKE_VERSION (major, minor, micro) == DBUS_VERSION);
268 _dbus_assert (MAKE_VERSION (major - 1, minor, micro) < DBUS_VERSION);
269 _dbus_assert (MAKE_VERSION (major, minor - 1, micro) < DBUS_VERSION);
270 _dbus_assert (MAKE_VERSION (major, minor, micro - 1) < DBUS_VERSION);
272 _dbus_assert (MAKE_VERSION (major + 1, minor, micro) > DBUS_VERSION);
273 _dbus_assert (MAKE_VERSION (major, minor + 1, micro) > DBUS_VERSION);
274 _dbus_assert (MAKE_VERSION (major, minor, micro + 1) > DBUS_VERSION);
#define DBUS_ERROR_INIT
Expands to a suitable initializer for a DBusError on the stack.
dbus_bool_t dbus_error_has_name(const DBusError *error, const char *name)
Checks whether the error is set and has the given name.
void dbus_set_error(DBusError *error, const char *name, const char *format,...)
Assigns an error name and message to a DBusError.
void dbus_error_free(DBusError *error)
Frees an error that's been set (or just initialized), then reinitializes the error as in dbus_error_i...
#define _dbus_assert_not_reached(explanation)
Aborts with an error message if called.
#define _dbus_assert(condition)
Aborts with an error message if the condition is false.
void _dbus_warn_check_failed(const char *format,...)
Prints a "critical" warning to stderr when an assertion fails; differs from _dbus_warn primarily in t...
dbus_bool_t _dbus_get_local_machine_uuid_encoded(DBusString *uuid_str, DBusError *error)
Gets the hex-encoded UUID of the machine this function is executed on.
#define NULL
A null pointer, defined appropriately for C or C++.
#define TRUE
Expands to "1".
char * dbus_get_local_machine_id(void)
Obtains the machine UUID of the machine this process is running on.
char * dbus_try_get_local_machine_id(DBusError *error)
Obtains the machine UUID of the machine this process is running on.
void dbus_get_version(int *major_version_p, int *minor_version_p, int *micro_version_p)
Gets the DYNAMICALLY LINKED version of libdbus.
#define DBUS_ERROR_NO_MEMORY
There was not enough memory to complete an operation.
dbus_bool_t _dbus_string_init(DBusString *str)
Initializes a string.
DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_append_int(DBusString *str, long value)
Appends an integer to a DBusString.
dbus_bool_t _dbus_string_steal_data(DBusString *str, char **data_return)
Like _dbus_string_get_data(), but removes the gotten data from the original string.
void _dbus_string_free(DBusString *str)
Frees a string created by _dbus_string_init().
dbus_bool_t _dbus_string_equal_c_str(const DBusString *a, const char *c_str)
Checks whether a string is equal to a C string.
dbus_bool_t _dbus_string_append_byte(DBusString *str, unsigned char byte)
Appends a single byte to the string, returning FALSE if not enough memory.
dbus_uint32_t dbus_bool_t
A boolean, valid values are TRUE and FALSE.
Object representing an exception.
const char * message
public error message field