2026-02-19 19:31:15 +00:00
|
|
|
#ifndef TAR_H_
|
|
|
|
|
#define TAR_H_
|
|
|
|
|
|
2026-03-10 19:16:22 +00:00
|
|
|
#include <fs/context.h>
|
|
|
|
|
#include <fs/status.h>
|
2026-02-19 19:31:15 +00:00
|
|
|
#include <mango/types.h>
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
struct tar {
|
|
|
|
|
struct tar_bin_header *tar_entries;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct tar_bin_header {
|
|
|
|
|
char filename[100];
|
|
|
|
|
char mode[8];
|
|
|
|
|
char uid[8];
|
|
|
|
|
char gid[8];
|
|
|
|
|
char size[12];
|
|
|
|
|
char mtime[12];
|
|
|
|
|
char chksum[8];
|
|
|
|
|
char typeflag[1];
|
|
|
|
|
} __attribute__((aligned(512)));
|
|
|
|
|
|
|
|
|
|
struct tar_header {
|
|
|
|
|
char filename[100];
|
|
|
|
|
size_t size;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct tar_file {
|
|
|
|
|
struct tar_header f_header;
|
|
|
|
|
const void *f_data;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
extern int tar_init(struct tar *tar, uintptr_t base);
|
|
|
|
|
|
|
|
|
|
extern int tar_open(struct tar *tar, const char *path, struct tar_file *out);
|
|
|
|
|
|
|
|
|
|
extern int tar_file_create_vm_object(
|
|
|
|
|
const struct tar_file *file,
|
|
|
|
|
kern_handle_t *out);
|
|
|
|
|
|
|
|
|
|
extern int tar_header_decode(
|
|
|
|
|
const struct tar_bin_header *in,
|
|
|
|
|
struct tar_header *out);
|
|
|
|
|
|
2026-03-10 19:16:22 +00:00
|
|
|
extern enum fs_status tar_mount(
|
|
|
|
|
struct fs_context *ctx,
|
|
|
|
|
void *arg,
|
|
|
|
|
enum fs_mount_flags flags,
|
|
|
|
|
struct fs_superblock **out);
|
|
|
|
|
|
2026-02-19 19:31:15 +00:00
|
|
|
#endif
|