2019-01-19 17:26:41 +01:00
|
|
|
#ifndef IMAGE_ENTRY_H
|
|
|
|
#define IMAGE_ENTRY_H
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
typedef struct image_entry_t {
|
|
|
|
struct image_entry_t *next;
|
|
|
|
char *name;
|
|
|
|
mode_t mode;
|
|
|
|
uid_t uid;
|
|
|
|
gid_t gid;
|
|
|
|
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
char *location;
|
|
|
|
uint64_t size;
|
|
|
|
uint32_t id;
|
|
|
|
} file;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
char *target;
|
|
|
|
} symlink;
|
2019-02-04 17:43:24 +01:00
|
|
|
|
|
|
|
struct {
|
|
|
|
dev_t devno;
|
|
|
|
} device;
|
2019-01-19 17:26:41 +01:00
|
|
|
} data;
|
|
|
|
} image_entry_t;
|
|
|
|
|
2019-02-03 12:37:49 +01:00
|
|
|
typedef enum {
|
|
|
|
TOC_FORMAT_PRETTY = 0,
|
|
|
|
TOC_FORMAT_SQFS = 1,
|
|
|
|
TOC_FORMAT_INITRD = 2,
|
2019-02-04 18:47:34 +01:00
|
|
|
TOC_FORMAT_PKG = 3,
|
2019-02-03 12:37:49 +01:00
|
|
|
} TOC_FORMAT;
|
|
|
|
|
2019-01-19 17:26:41 +01:00
|
|
|
void image_entry_free(image_entry_t *ent);
|
|
|
|
|
|
|
|
void image_entry_free_list(image_entry_t *list);
|
|
|
|
|
|
|
|
image_entry_t *image_entry_sort(image_entry_t *list);
|
|
|
|
|
2019-02-03 12:37:49 +01:00
|
|
|
int dump_toc(image_entry_t *list, const char *root, TOC_FORMAT format);
|
|
|
|
|
2019-01-19 17:26:41 +01:00
|
|
|
#endif /* IMAGE_ENTRY_H */
|