typedef __u8 stream_format_t;
// Legacy envelope is leading uint32_t size
-#define JOURNAL_FORMAT_LEGACY 0
+enum StreamFormat {
+ JOURNAL_FORMAT_LEGACY = 0,
+ JOURNAL_FORMAT_RESILIENT = 1,
+ // Insert new formats here, before COUNT
+ JOURNAL_FORMAT_COUNT
+};
+
+// Highest journal format version that we support
+#define JOURNAL_FORMAT_MAX (JOURNAL_FORMAT_COUNT - 1)
+
+// Legacy envelope is leading uint32_t size
#define JOURNAL_ENVELOPE_LEGACY (sizeof(uint32_t))
// Resilient envelope is leading uint64_t sentinel, uint32_t size, trailing uint64_t start_ptr
-#define JOURNAL_FORMAT_RESILIENT 1
#define JOURNAL_ENVELOPE_RESILIENT (sizeof(uint32_t) + sizeof(uint64_t) + sizeof(uint64_t))
-// Most recent format which we may try to read
-#define JOURNAL_FORMAT_MAX 1
-
/**
* Represents a collection of entries serialized in a byte stream.
*