taisei/src/vfs/zipfile_impl.h
Andrei Alexeyev 80b1026d08
Don't redefine standard complex macro; use a new cmplx typedef
This also introduces `float32`, `float64`, and `real` typedefs to be
used in place of `float` and `double` later. `real` is for game code and
other places where we don't particularly care about the precision and
format of the underlying type, and is currently defined to `double`.
`float32` and `float64` should replace `float` and `double` respectively
2019-11-22 05:38:48 +02:00

57 lines
1.3 KiB
C

/*
* This software is licensed under the terms of the MIT License.
* See COPYING for further information.
* ---
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@taisei-project.org>.
*/
#ifndef IGUARD_vfs_zipfile_impl_h
#define IGUARD_vfs_zipfile_impl_h
#include "taisei.h"
#include <zip.h>
#include "private.h"
#include "hashtable.h"
/* zipfile */
typedef struct VFSZipFileTLS {
zip_t *zip;
SDL_RWops *stream;
zip_error_t error;
} VFSZipFileTLS;
typedef struct VFSZipFileData {
VFSNode *source;
ht_str2int_t pathmap;
SDL_TLSID tls_id;
} VFSZipFileData;
typedef struct VFSZipFileIterData {
zip_int64_t idx;
zip_int64_t num;
const char *prefix;
size_t prefix_len;
char *allocated;
} VFSZipFileIterData;
const char* vfs_zipfile_iter_shared(VFSNode *node, VFSZipFileData *zdata, VFSZipFileIterData *idata, VFSZipFileTLS *tls);
void vfs_zipfile_iter_stop(VFSNode *node, void **opaque);
/* zippath */
typedef struct VFSZipPathData {
VFSNode *zipnode;
uint64_t index;
ssize_t size;
VFSInfo info;
bool seekable;
} VFSZipPathData;
void vfs_zippath_init(VFSNode *node, VFSNode *zipnode, zip_int64_t idx);
VFSZipFileTLS* vfs_zipfile_get_tls(VFSNode *node, bool create);
#endif // IGUARD_vfs_zipfile_impl_h