14#define WOWS_ERROR_CORRUPTED_FILE 1
15#define WOWS_ERROR_BAD_MAGIC 2
16#define WOWS_ERROR_MISSING_METADATA_ENTRY 3
17#define WOWS_ERROR_MAX_LEVEL_REACHED 4
18#define WOWS_ERROR_NON_ZERO_TERMINATED_STRING 5
19#define WOWS_ERROR_PATH_TOO_LONG 6
20#define WOWS_ERROR_UNKNOWN 7
21#define WOWS_ERROR_ID_COLLISION_FILE_DIR 8
22#define WOWS_ERROR_FILE_OPEN_FAILURE 9
23#define WOWS_ERROR_DECOMPOSE_PATH 10
24#define WOWS_ERROR_INVALID_SEARCH_PATTERN 11
25#define WOWS_ERROR_NOT_A_FILE 12
26#define WOWS_ERROR_NOT_A_DIR 13
27#define WOWS_ERROR_NOT_FOUND 14
28#define WOWS_ERROR_FILE_WRITE 15
29#define WOWS_ERROR_MAX_FILE 16
35#define WOWS_NO_DEBUG 0
36#define WOWS_DEBUG_RAW_RECORD (1 << 0)
37#define WOWS_DEBUG_FILE_LISTING (1 << 1)
43#define WOWS_SEARCH_FILE_ONLY 0
44#define WOWS_SEARCH_DIR_ONLY 1
45#define WOWS_SEARCH_FILE_PLUS_DIR 2
46#define WOWS_SEARCH_FULL_PATH 3
Definition wows-depack.h:58
void * root
Definition wows-depack.h:60
bool is_le
Definition wows-depack.h:67
void * current_dir
Definition wows-depack.h:63
void ** indexes
Definition wows-depack.h:64
uint32_t index_count
Definition wows-depack.h:66
void * metadata_map
Definition wows-depack.h:61
void * file_map
Definition wows-depack.h:62
uint8_t debug_level
Definition wows-depack.h:59
char * err_msg
Definition wows-depack.h:68
Stat structure returned by wows_stat_path().
Definition wows-depack.h:163
uint8_t type
Definition wows-depack.h:164
uint32_t size
Definition wows-depack.h:165
int wows_parse_index_dir(const char *index_dir_path, WOWS_CONTEXT *context)
Parses all files in a given directory.
int wows_free_context_no_munmap(WOWS_CONTEXT *context)
Frees a WoW Stats Parser context without unmapping the memory.
int wows_get_latest_idx_dir(char *wows_base_dir, char **idx_dir)
Gets the latest index directory in the specified WoWs installation directory.
int wows_parse_index_buffer(char *contents, size_t length, const char *index_file_path, int fd, WOWS_CONTEXT *context)
Low level, parses a memory buffer directly.
char * wows_error_string(int error_code, WOWS_CONTEXT *context)
Converts an error code into an error message string for the given WoWs resource parser context.
int wows_search(WOWS_CONTEXT *context, char *pattern, int mode, int *result_count, char ***results)
Recursively searches for files in the WOWS archive tree that match a PCRE regular expression pattern.
int wows_readdir(WOWS_CONTEXT *context, char *dir_path, int *entry_count, char ***entries)
Lists the immediate children of a directory in the archive.
int wows_print_flat(WOWS_CONTEXT *context)
Prints the directory tree of the given WoWs resource parser context in a flat format.
int wows_parse_index_file(const char *index_file_path, WOWS_CONTEXT *context)
Parses a single WoWs resource index file.
int wows_print_tree(WOWS_CONTEXT *context)
Prints the directory tree of the given WoWs resource parser context in a tree format.
int wows_extract_file_fp(WOWS_CONTEXT *context, char *file_path, FILE *output)
Extract a given file from the archive (file pointer version).
int wows_stat_path(WOWS_CONTEXT *context, char *path, WOWS_STAT *stat)
Returns the type and size of a path in the archive.
WOWS_CONTEXT * wows_init_context(uint8_t debug_level)
Initializes a WoWs resource extractor context.
int wows_write_pkg(WOWS_CONTEXT *context, char *in_path, char *name, FILE *pkg_fp, FILE *idx_fp)
Writes a package file and its index.
int wows_extract_file(WOWS_CONTEXT *context, char *file_path, char *out_path)
Extract a given file from the archive (output file version).
int wows_free_context(WOWS_CONTEXT *context)
Frees a WoWs resource extractor context.
int wows_extract_dir(WOWS_CONTEXT *context, char *dir_path, char *out_dir_path)
Extract a given directory (recursively) from the archive (output file version).