From f1ee877d76000920e6dbec1b59be1ffab39d2c81 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sat, 12 Jul 2003 19:32:35 +0000 Subject: 2003-07-12 Havoc Pennington * dbus/dbus-object-registry.c: implement unit test, fix bugs discovered in process * dbus/dbus-connection.c: remove handler_table and register_handler(), add DBusObjectRegistry usage * dbus/dbus-objectid.c (dbus_object_id_is_null) (dbus_object_id_set_null): new functions --- dbus/dbus-objectid.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'dbus/dbus-objectid.c') diff --git a/dbus/dbus-objectid.c b/dbus/dbus-objectid.c index 1fb83e44..55ae0d48 100644 --- a/dbus/dbus-objectid.c +++ b/dbus/dbus-objectid.c @@ -177,6 +177,34 @@ dbus_object_id_set_low_bits (DBusObjectID *obj_id, #endif } +/** + * Set the object ID to an invalid value that cannot + * correspond to a valid object. + * + * @param obj_id the object ID + */ +void +dbus_object_id_set_null (DBusObjectID *obj_id) +{ + memset (obj_id, '\0', sizeof (DBusObjectID)); +} + +/** + * Check whether the object ID is set to a null value + * + * @param obj_id the object ID + * @returns #TRUE if null + */ +dbus_bool_t +dbus_object_id_is_null (const DBusObjectID *obj_id) +{ +#ifdef DBUS_HAVE_INT64 + return VALUE (obj_id) == 0; +#else + return HIGH_BITS (obj_id) == 0 && LOW_BITS (obj_id) == 0; +#endif +} + #ifdef DBUS_HAVE_INT64 /** * An object ID contains 64 bits of data. This function -- cgit