X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=libs%2Fassfile%2Ftar.h;fp=libs%2Fassfile%2Ftar.h;h=a58e021e6e3aa350743b739a5c57214e3f35276f;hb=dd7ce87b0ad2b8a1b4758bcc9354e993b71c8599;hp=0000000000000000000000000000000000000000;hpb=48ee87d8c32791d17fa7a57076df5d6721d6c05c;p=raydungeon diff --git a/libs/assfile/tar.h b/libs/assfile/tar.h new file mode 100644 index 0000000..a58e021 --- /dev/null +++ b/libs/assfile/tar.h @@ -0,0 +1,38 @@ +/* +assfile - library for accessing assets with an fopen/fread-like interface +Copyright (C) 2018 John Tsiombikas + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this program. If not, see . +*/ +#ifndef TAR_H_ +#define TAR_H_ + +#include + +struct tar_entry { + char *path; + unsigned long offset; + unsigned long size; +}; + +struct tar { + FILE *fp; + struct tar_entry *files; + int num_files; +}; + +int load_tar(struct tar *tar, const char *fname); +void close_tar(struct tar *tar); + +#endif /* TAR_H_ */