summaryrefslogtreecommitdiff
path: root/packer/rdar.c
diff options
context:
space:
mode:
authorChloe M. <chloe@faracom.org>2026-08-20 09:52:00 +0000
committerChloe M. <chloe@faracom.org>2026-08-20 09:52:00 +0000
commit25259a85de94cd3ec4ca0e4b79cfb25290252911 (patch)
treee86220a58c1aae9c1c0c7b7779af460835acc1c3 /packer/rdar.c
parent8abbda9c2ce05ae41b55be23861603ea2e240d5e (diff)
packer: Store desc size and bump versionmain
Signed-off-by: Chloe M. <chloe@faracom.org>
Diffstat (limited to 'packer/rdar.c')
-rw-r--r--packer/rdar.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/packer/rdar.c b/packer/rdar.c
index ba67c69..1b7c9ce 100644
--- a/packer/rdar.c
+++ b/packer/rdar.c
@@ -48,7 +48,7 @@ struct idata_desc;
* XXX: We encode it as a U16 so that we may bundle it
* with the file data as binary.
*/
-#define RDAR_VERSION VERSION_U16(1, 0) /* v1.0 */
+#define RDAR_VERSION VERSION_U16(1, 1) /* v1.1 */
/* Fallback path if '-o' is not specified */
#define FALLBACK_OUTPUT_PATH "out.rdar"
@@ -87,14 +87,16 @@ struct file_view {
* file along with an offset to which it is located at
* in the offset.
*
- * @magic: Format magic
- * @path: File path
- * @off: File data offset
- * @flags: File flags
- * @length: File length in bytes
+ * @magic: Format magic
+ * @desc_size: Data descriptor size
+ * @path: File path
+ * @off: File data offset
+ * @flags: File flags
+ * @length: File length in bytes
*/
struct data_desc {
char magic[RDAR_MAGIC_LEN];
+ uint16_t desc_size;
char path[RDAR_MAX_PATHLEN];
off_t off;
uint16_t flags;
@@ -241,6 +243,7 @@ idata_from_file(const char *path, bool is_root)
/* Initialize the data descriptor */
data_desc = &idata_desc->data;
memcpy(data_desc->magic, RDAR_MAGIC, RDAR_MAGIC_LEN);
+ data_desc->desc_size = sizeof(struct data_desc);
memcpy(data_desc->path, p, strlen(p));
data_desc->path[path_len] = '\0';
data_desc->flags = 0;