]> wimlib.net Git - wimlib/blob - include/wimlib/object_id.h
wimdir: make documention correctly reflect that IMAGE is optional
[wimlib] / include / wimlib / object_id.h
1 #ifndef _WIMLIB_OBJECT_ID_H
2 #define _WIMLIB_OBJECT_ID_H
3
4 #include "wimlib/tagged_items.h"
5
6 /* Unconfirmed: are all 64 bytes of the object ID always present?  Since NTFS-3G
7  * permits shorter object IDs, we'll do the same for now.  */
8 #define OBJECT_ID_MIN_LENGTH    16
9
10 static inline const void *
11 inode_get_object_id(const struct wim_inode *inode, u32 *len_ret)
12 {
13         return inode_get_tagged_item(inode, TAG_OBJECT_ID, OBJECT_ID_MIN_LENGTH,
14                                      len_ret);
15 }
16
17 static inline bool
18 inode_has_object_id(const struct wim_inode *inode)
19 {
20         return inode_get_object_id(inode, NULL) != NULL;
21 }
22
23 static inline bool
24 inode_set_object_id(struct wim_inode *inode, const void *object_id, u32 len)
25 {
26         return inode_set_tagged_data(inode, TAG_OBJECT_ID, object_id, len);
27 }
28
29 #endif /* _WIMLIB_OBJECT_ID_H  */