12 #define WOWS_ERROR_CORRUPTED_FILE 1
13 #define WOWS_ERROR_BAD_MAGIC 2
14 #define WOWS_ERROR_MISSING_METADATA_ENTRY 3
15 #define WOWS_ERROR_MAX_LEVEL_REACHED 4
16 #define WOWS_ERROR_NON_ZERO_TERMINATED_STRING 5
17 #define WOWS_ERROR_PATH_TOO_LONG 6
18 #define WOWS_ERROR_UNKNOWN 7
19 #define WOWS_ERROR_ID_COLLISION_FILE_DIR 8
20 #define WOWS_ERROR_FILE_OPEN_FAILURE 9
21 #define WOWS_ERROR_DECOMPOSE_PATH 10
22 #define WOWS_ERROR_INVALID_SEARCH_PATTERN 11
23 #define WOWS_ERROR_NOT_A_FILE 12
24 #define WOWS_ERROR_NOT_A_DIR 13
25 #define WOWS_ERROR_NOT_FOUND 14
26 #define WOWS_ERROR_FILE_WRITE 15
27 #define WOWS_ERROR_MAX_FILE 16
33 #define WOWS_NO_DEBUG 0
34 #define WOWS_DEBUG_RAW_RECORD (1 << 0)
35 #define WOWS_DEBUG_FILE_LISTING (1 << 1)
41 #define WOWS_SEARCH_FILE_ONLY 0
42 #define WOWS_SEARCH_DIR_ONLY 1
43 #define WOWS_SEARCH_FILE_PLUS_DIR 2
44 #define WOWS_SEARCH_FULL_PATH 3
Definition: wows-depack.h:56
void * root
Definition: wows-depack.h:58
bool is_le
Definition: wows-depack.h:65
void * current_dir
Definition: wows-depack.h:61
void ** indexes
Definition: wows-depack.h:62
uint32_t index_count
Definition: wows-depack.h:64
void * metadata_map
Definition: wows-depack.h:59
void * file_map
Definition: wows-depack.h:60
uint8_t debug_level
Definition: wows-depack.h:57
char * err_msg
Definition: wows-depack.h:66
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.
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_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.
WOWS_CONTEXT * wows_init_context(uint8_t debug_level)
Initializes a WoWs resource extractor context.
int wows_print_tree(WOWS_CONTEXT *context)
Prints the directory tree of the given WoWs resource parser context in a tree format.
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_extract_file_fp(WOWS_CONTEXT *context, char *file_path, FILE *output)
Extract a given file from the archive (file pointer version).
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).