42 lines
840 B
C
42 lines
840 B
C
/*
|
|
* @author xamidev <xamidev@riseup.net>
|
|
* @brief Tape archive (TAR) filesystem definitions
|
|
* @license GPL-3.0-only
|
|
*/
|
|
|
|
#ifndef TAR_H
|
|
#define TAR_H
|
|
|
|
#include <stdint.h>
|
|
#include <limine.h>
|
|
#include <stddef.h>
|
|
|
|
struct tar_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];
|
|
};
|
|
|
|
struct tar_file
|
|
{
|
|
void* address;
|
|
uint64_t size;
|
|
};
|
|
|
|
unsigned int tar_parse(uint64_t address);
|
|
int tar_init_fs(struct limine_file* file);
|
|
struct tar_header* tar_file_lookup(const char* filename);
|
|
void tar_file_read(struct tar_header* header, uint8_t* buf);
|
|
|
|
int tar_open(const char* path, int flags);
|
|
int tar_close(int fd);
|
|
int64_t tar_read(int fd, char* buf, size_t count);
|
|
int64_t tar_write(int fd, char* buf, size_t count);
|
|
|
|
#endif |