1 /* SPDX-License-Identifier: GPL-2.0-only */
11 * +----------------------------------+
13 * +----------------------------------+
15 * +----------------------------------+
17 * +----------------------------------+
19 * +----------------------------------+
20 * | file_header[count-1] |
21 * +----------------------------------+
23 * +----------------------------------+
25 * +----------------------------------+
27 * +----------------------------------+
28 * | file(count-1) content |
29 * +----------------------------------+
33 #define CBAR_MAGIC "CBAR"
34 #define NAME_LENGTH 32
39 uint32_t version
; /* version of the header. little endian */
40 uint32_t size
; /* total size of archive. little endian */
41 uint32_t count
; /* number of files. little endian */
46 /* file name. null-terminated if shorter than NAME_LENGTH */
47 char name
[NAME_LENGTH
];
48 /* file offset from the root header. little endian */
50 /* file size. little endian */
54 static inline struct dentry
*get_first_dentry(const struct directory
*dir
)
56 return (struct dentry
*)(dir
+ 1);
59 static inline uint32_t get_first_offset(const struct directory
*dir
)
61 return sizeof(struct directory
) + sizeof(struct dentry
) * dir
->count
;