Lephisto/utils/pack/pack.h
2013-02-03 17:35:44 +00:00

18 lines
516 B
C

#pragma once
#include <fcntl.h>
#include <stdint.h>
typedef struct {
int fd; // File descriptor.
uint32_t pos; // position.
uint32_t start, end; // file limits.
} Packfile;
// Packfile manipulation. Automatically allocated and freed (with open and close).
int pack_check(char* filename);
int pack_files(char* outfile, char** infiles, uint32_t nfiles);
int pack_open(Packfile* file, char* packfile, char* filename);
ssize_t pack_read(Packfile* file, void* buf, size_t count);
int pack_close(Packfile* file);