#define ALIGN_8(l) ALIGN_TO(l, sizeof(size_t))
static const char* const object_compressed_table[_OBJECT_COMPRESSED_MAX] = {
- [OBJECT_COMPRESSED_XZ] = "XZ",
- [OBJECT_COMPRESSED_LZ4] = "LZ4",
+ [OBJECT_COMPRESSED_XZ] = "XZ",
+ [OBJECT_COMPRESSED_LZ4] = "LZ4",
+ /* If we add too many more entries here, it's going to grow quite large (and be mostly sparse), since
+ * the array key is actually a bitmask, not a plain enum */
};
DEFINE_STRING_TABLE_LOOKUP(object_compressed, int);
/* Object flags */
enum {
- OBJECT_COMPRESSED_XZ = 1 << 0,
- OBJECT_COMPRESSED_LZ4 = 1 << 1,
- _OBJECT_COMPRESSED_MAX
+ OBJECT_COMPRESSED_XZ = 1 << 0,
+ OBJECT_COMPRESSED_LZ4 = 1 << 1,
+ OBJECT_COMPRESSION_MASK = (OBJECT_COMPRESSED_XZ | OBJECT_COMPRESSED_LZ4),
+ _OBJECT_COMPRESSED_MAX = OBJECT_COMPRESSION_MASK,
};
-#define OBJECT_COMPRESSION_MASK (OBJECT_COMPRESSED_XZ | OBJECT_COMPRESSED_LZ4)
struct ObjectHeader {
uint8_t type;
/* Header flags */
enum {
- HEADER_INCOMPATIBLE_COMPRESSED_XZ = 1 << 0,
- HEADER_INCOMPATIBLE_COMPRESSED_LZ4 = 1 << 1,
+ HEADER_INCOMPATIBLE_COMPRESSED_XZ = 1 << 0,
+ HEADER_INCOMPATIBLE_COMPRESSED_LZ4 = 1 << 1,
};
#define HEADER_INCOMPATIBLE_ANY (HEADER_INCOMPATIBLE_COMPRESSED_XZ|HEADER_INCOMPATIBLE_COMPRESSED_LZ4)
#endif
enum {
- HEADER_COMPATIBLE_SEALED = 1
+ HEADER_COMPATIBLE_SEALED = 1 << 0,
};
#define HEADER_COMPATIBLE_ANY HEADER_COMPATIBLE_SEALED