+
+/* Return %true iff the specified inode has an object ID. */
+bool
+inode_has_object_id(const struct wim_inode *inode)
+{
+ return inode_get_object_id(inode, NULL) != NULL;
+}
+
+/* Retrieve a pointer to the object ID of the specified inode and write its
+ * length to @len_ret. Return NULL if the inode does not have an object ID. */
+const void *
+inode_get_object_id(const struct wim_inode *inode, u32 *len_ret)
+{
+ return inode_get_tagged_item(inode, TAG_OBJECT_ID,
+ OBJECT_ID_MIN_LENGTH, len_ret);
+}
+
+/* Set the inode's object ID to the value specified by @object_id and @len.
+ * Assumes the inode didn't already have an object ID set. Returns %true if
+ * successful, %false if failed (out of memory). */
+bool
+inode_set_object_id(struct wim_inode *inode, const void *object_id, u32 len)
+{
+ void *p;
+
+ p = inode_add_tagged_item(inode, TAG_OBJECT_ID, len);
+ if (!p)
+ return false;
+
+ memcpy(p, object_id, len);
+ return true;
+}