summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-objectid.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-07-12 19:32:35 +0000
committerHavoc Pennington <hp@redhat.com>2003-07-12 19:32:35 +0000
commitf1ee877d76000920e6dbec1b59be1ffab39d2c81 (patch)
tree6d4f63ba06ce61fe6fac101d719043c08a4f0e87 /dbus/dbus-objectid.c
parent824d4a5edfe1fa7222ab5cb49928bf78a675b563 (diff)
2003-07-12 Havoc Pennington <hp@pobox.com>
* 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
Diffstat (limited to 'dbus/dbus-objectid.c')
-rw-r--r--dbus/dbus-objectid.c28
1 files changed, 28 insertions, 0 deletions
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