chiark / gitweb /
journal: use a macro to check for file header flags
[elogind.git] / src / journal / journal-file.h
index 7358173e7a912d3efd13924490b584fe3a121fd0..5b1530e7a7ae4119bc6c08140035bc41e6f3448c 100644 (file)
@@ -137,6 +137,12 @@ static inline bool VALID_EPOCH(uint64_t u) {
 #define JOURNAL_HEADER_CONTAINS(h, field) \
         (le64toh((h)->header_size) >= offsetof(Header, field) + sizeof((h)->field))
 
+#define JOURNAL_HEADER_SEALED(h) \
+        (!!(le32toh((h)->compatible_flags) & HEADER_COMPATIBLE_SEALED))
+
+#define JOURNAL_HEADER_COMPRESSED(h) \
+        (!!(le32toh((h)->incompatible_flags) & HEADER_INCOMPATIBLE_COMPRESSED))
+
 int journal_file_move_to_object(JournalFile *f, int type, uint64_t offset, Object **ret);
 
 uint64_t journal_file_entry_n_items(Object *o);