]> wimlib.net Git - wimlib/blobdiff - include/wimlib/object_id.h
tagged_items updates
[wimlib] / include / wimlib / object_id.h
index 21c1b4a71a9865f39e2ce0a92c22ce9da443f094..b3fd8abc6e9764a2aba2b0fb5ce46ece1682cb24 100644 (file)
@@ -1,15 +1,29 @@
 #ifndef _WIMLIB_OBJECT_ID_H
 #define _WIMLIB_OBJECT_ID_H
 
-#include "wimlib/types.h"
+#include "wimlib/tagged_items.h"
 
-extern bool
-inode_has_object_id(const struct wim_inode *inode);
+/* Unconfirmed: are all 64 bytes of the object ID always present?  Since NTFS-3G
+ * permits shorter object IDs, we'll do the same for now.  */
+#define OBJECT_ID_MIN_LENGTH   16
 
-extern const void *
-inode_get_object_id(const struct wim_inode *inode, u32 *len_ret);
+static inline 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);
+}
 
-extern bool
-inode_set_object_id(struct wim_inode *inode, const void *object_id, u32 len);
+static inline bool
+inode_has_object_id(const struct wim_inode *inode)
+{
+       return inode_get_object_id(inode, NULL) != NULL;
+}
+
+static inline bool
+inode_set_object_id(struct wim_inode *inode, const void *object_id, u32 len)
+{
+       return inode_set_tagged_data(inode, TAG_OBJECT_ID, object_id, len);
+}
 
 #endif /* _WIMLIB_OBJECT_ID_H  */