|
102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
|
#include <dttr_iso.h>#include <dttr_path.h>#include <physfs.h>#include <sds.h>#include <errno.h>#include <stdio.h>#include <string.h>#include <direct.h>#include <windows.h>Go to the source code of this file.
Macros | |
| #define | MKDIR(path) |
Enumerations | |
| enum | { ISO_SECTOR_SIZE = 2048 } |
Functions | |
| static void | set_error (const char *message) |
| static void | set_physfs_error (const char *context) |
| const char * | DTTR_ISO_LastError () |
| static bool | is_iso_version_suffix (const char *suffix) |
| static size_t | strip_iso_version_suffix_len (const char *segment, size_t segment_len) |
| static void | trim_trailing_separators (sds path) |
| static bool | sdscat_lower_segment (sds *out, const char *segment, size_t segment_len) |
| bool | DTTR_ISO_CachePathForFile (const char *cache_root, const char *iso_relative_path, char *out_path, size_t out_path_size) |
| static bool | physfs_init () |
| static void | physfs_deinit () |
| bool | DTTR_ISO_Open (DTTR_IsoImage *iso, const char *iso_path) |
| static bool | name_matches_segment (const char *name, const char *segment, size_t segment_len) |
| static bool | find_case_match (const char *parent, const char *segment, size_t segment_len, char *out_name, size_t out_name_size) |
| static bool | resolve_iso_path_case (const char *requested, char *out_path, size_t out_path_size) |
| static bool | create_parent_dirs (const char *path) |
| static bool | file_matches_physfs_file (const char *path, PHYSFS_File *physfs_file, size_t size) |
| static sds | child_iso_path (const char *parent, const char *entry) |
| bool | DTTR_ISO_ExtractFile (DTTR_IsoImage *iso, const char *iso_relative_path, const char *cache_root, char *out_path, size_t out_path_size) |
| static bool | extract_tree_path (DTTR_IsoImage *iso, const char *physfs_path, const char *cache_root) |
| bool | DTTR_ISO_ExtractTree (DTTR_IsoImage *iso, const char *iso_relative_path, const char *cache_root) |
| void | DTTR_ISO_Close (DTTR_IsoImage *iso) |
Variables | |
| static int | physfs_refcount |
| static char | last_error [256] |
| #define MKDIR | ( | path | ) |
Definition at line 14 of file iso.c.
Referenced by create_parent_dirs().
|
static |
Definition at line 395 of file iso.c.
References DTTR_Path_AppendSegment(), and NULL.
Referenced by extract_tree_path().
|
static |
Definition at line 308 of file iso.c.
References DTTR_ISO_MAX_PATH, DTTR_Path_IsSeparator(), and MKDIR.
Referenced by DTTR_ISO_ExtractFile().
| bool DTTR_ISO_CachePathForFile | ( | const char * | cache_root, |
| const char * | iso_relative_path, | ||
| char * | out_path, | ||
| size_t | out_path_size ) |
Definition at line 96 of file iso.c.
References DTTR_Path_AppendSeparator(), DTTR_Path_CopySds(), DTTR_Path_IsRelativeSegment(), DTTR_Path_IsSeparator(), DTTR_Path_SegmentLen(), DTTR_Path_SkipSeparators(), sdscat_lower_segment(), and trim_trailing_separators().
Referenced by dttr_game_data_resolve_read_path(), and DTTR_ISO_ExtractFile().
| void DTTR_ISO_Close | ( | DTTR_IsoImage * | iso | ) |
Definition at line 593 of file iso.c.
References DTTR_IsoImage::iso_path, DTTR_IsoImage::open, and physfs_deinit().
Referenced by resolve_iso_direct().
| bool DTTR_ISO_ExtractFile | ( | DTTR_IsoImage * | iso, |
| const char * | iso_relative_path, | ||
| const char * | cache_root, | ||
| char * | out_path, | ||
| size_t | out_path_size ) |
Definition at line 411 of file iso.c.
References create_parent_dirs(), DTTR_ISO_CachePathForFile(), DTTR_ISO_MAX_PATH, file_matches_physfs_file(), ISO_SECTOR_SIZE, DTTR_IsoImage::open, resolve_iso_path_case(), set_error(), and set_physfs_error().
Referenced by extract_iso_file(), and extract_tree_path().
| bool DTTR_ISO_ExtractTree | ( | DTTR_IsoImage * | iso, |
| const char * | iso_relative_path, | ||
| const char * | cache_root ) |
Definition at line 560 of file iso.c.
References DTTR_ISO_MAX_PATH, extract_tree_path(), DTTR_IsoImage::open, resolve_iso_path_case(), set_error(), and set_physfs_error().
Referenced by extract_iso_game_cache().
| const char * DTTR_ISO_LastError | ( | ) |
Definition at line 44 of file iso.c.
References last_error.
Referenced by extract_iso_file(), extract_iso_game_cache(), and resolve_iso_direct().
| bool DTTR_ISO_Open | ( | DTTR_IsoImage * | iso, |
| const char * | iso_path ) |
Definition at line 185 of file iso.c.
References DTTR_Path_CopyString(), DTTR_IsoImage::iso_path, NULL, DTTR_IsoImage::open, physfs_deinit(), physfs_init(), set_error(), and set_physfs_error().
Referenced by resolve_iso_direct().
|
static |
Definition at line 517 of file iso.c.
References child_iso_path(), DTTR_ISO_ExtractFile(), DTTR_ISO_MAX_PATH, extract_tree_path(), set_error(), and set_physfs_error().
Referenced by DTTR_ISO_ExtractTree(), and extract_tree_path().
|
static |
Definition at line 342 of file iso.c.
References ISO_SECTOR_SIZE, set_physfs_error(), and size.
Referenced by DTTR_ISO_ExtractFile().
|
static |
Definition at line 222 of file iso.c.
References DTTR_Path_CopyString(), and name_matches_segment().
Referenced by resolve_iso_path_case().
|
static |
Definition at line 48 of file iso.c.
Referenced by name_matches_segment(), and strip_iso_version_suffix_len().
|
static |
Definition at line 210 of file iso.c.
References DTTR_Path_AsciiIeqN(), and is_iso_version_suffix().
Referenced by find_case_match().
|
static |
Definition at line 172 of file iso.c.
References physfs_refcount.
Referenced by DTTR_ISO_Close(), and DTTR_ISO_Open().
|
static |
Definition at line 155 of file iso.c.
References physfs_refcount, and set_physfs_error().
Referenced by DTTR_ISO_Open().
|
static |
Definition at line 255 of file iso.c.
References DTTR_ISO_MAX_PATH, DTTR_Path_AppendSegment(), DTTR_Path_CopySds(), DTTR_Path_IsRelativeSegment(), DTTR_Path_SegmentLen(), DTTR_Path_SkipSeparators(), and find_case_match().
Referenced by DTTR_ISO_ExtractFile(), and DTTR_ISO_ExtractTree().
|
static |
Definition at line 81 of file iso.c.
References DTTR_Path_AppendChar(), DTTR_Path_AsciiLower(), and strip_iso_version_suffix_len().
Referenced by DTTR_ISO_CachePathForFile().
|
static |
Definition at line 23 of file iso.c.
References last_error.
Referenced by DTTR_ISO_ExtractFile(), DTTR_ISO_ExtractTree(), DTTR_ISO_Open(), and extract_tree_path().
|
static |
Definition at line 33 of file iso.c.
References last_error.
Referenced by DTTR_ISO_ExtractFile(), DTTR_ISO_ExtractTree(), DTTR_ISO_Open(), extract_tree_path(), file_matches_physfs_file(), and physfs_init().
|
static |
Definition at line 63 of file iso.c.
References is_iso_version_suffix().
Referenced by sdscat_lower_segment().
|
static |
Definition at line 74 of file iso.c.
References DTTR_Path_IsSeparator().
Referenced by DTTR_ISO_CachePathForFile().
|
static |
Definition at line 20 of file iso.c.
Referenced by DTTR_ISO_LastError(), set_error(), and set_physfs_error().
|
static |
Definition at line 19 of file iso.c.
Referenced by physfs_deinit(), and physfs_init().