X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=include%2Fwimlib%2Fobject_id.h;h=baf416cbe221b12654d10bf3e7b42c923ad67dda;hp=21c1b4a71a9865f39e2ce0a92c22ce9da443f094;hb=4fb86d6254e7be4da455fa9da0f1032621bb3c96;hpb=51829aecdac415b417ab5b8ac897014bb780de10 diff --git a/include/wimlib/object_id.h b/include/wimlib/object_id.h index 21c1b4a7..baf416cb 100644 --- a/include/wimlib/object_id.h +++ b/include/wimlib/object_id.h @@ -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_item(inode, TAG_OBJECT_ID, object_id, len); +} #endif /* _WIMLIB_OBJECT_ID_H */