102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
Loading...
Searching...
No Matches
paths.c File Reference
#include <dttr_loader_paths.h>
#include <sds.h>
#include <xxhash.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>

Go to the source code of this file.

Functions

static wchar_t ascii_lower_w (wchar_t ch)
static bool has_suffix_w (const wchar_t *path, const wchar_t *suffix)
bool DTTR_LoaderPath_IsISOW (const wchar_t *path)
size_t DTTR_Loader_GameSubpathCount ()
const wchar_t * DTTR_Loader_GameSubpathAt (size_t index)
const char * DTTR_LoaderISO_GameRoot ()
const char * DTTR_LoaderISO_GameEXEPath ()
const char * DTTR_LoaderISO_GamePkgPath ()
const char * DTTR_LoaderISO_GameDataPath ()
static uint64_t hash_path (const char *path)
static bool path_needs_separator (const char *path)
bool DTTR_LoaderISO_CacheRootForPath (const char *cache_base_dir, const char *iso_path, char *out_path, size_t out_path_size)

Variables

static const wchar_t *const GAME_SUBPATHS []
static const wchar_t ISO_SUFFIX [] = L".iso"
static const char *const ISO_CACHE_PATH = "DetoursToTheRescue\\cache\\iso"
static const char *const ISO_GAME_ROOT = "Setup/102Dalms"
static const char *const ISO_GAME_EXE_PATH = "Setup/102Dalms/pcdogs.exe"
static const char *const ISO_GAME_PKG_PATH = "Setup/102Dalms/pcdogs.pkg"
static const char *const ISO_GAME_DATA_PATH = "Setup/102Dalms/data"

Function Documentation

◆ ascii_lower_w()

wchar_t ascii_lower_w ( wchar_t ch)
static

Definition at line 22 of file paths.c.

Referenced by has_suffix_w().

◆ DTTR_Loader_GameSubpathAt()

const wchar_t * DTTR_Loader_GameSubpathAt ( size_t index)

Definition at line 55 of file paths.c.

References DTTR_Loader_GameSubpathCount(), GAME_SUBPATHS, and NULL.

Referenced by try_dir().

◆ DTTR_Loader_GameSubpathCount()

size_t DTTR_Loader_GameSubpathCount ( )

Definition at line 51 of file paths.c.

References GAME_SUBPATHS.

Referenced by DTTR_Loader_GameSubpathAt(), and try_dir().

◆ DTTR_LoaderISO_CacheRootForPath()

bool DTTR_LoaderISO_CacheRootForPath ( const char * cache_base_dir,
const char * iso_path,
char * out_path,
size_t out_path_size )

Definition at line 94 of file paths.c.

References hash_path(), ISO_CACHE_PATH, and path_needs_separator().

Referenced by resolve_iso_direct().

◆ DTTR_LoaderISO_GameDataPath()

const char * DTTR_LoaderISO_GameDataPath ( )

Definition at line 71 of file paths.c.

References ISO_GAME_DATA_PATH.

Referenced by extract_iso_game_cache().

◆ DTTR_LoaderISO_GameEXEPath()

const char * DTTR_LoaderISO_GameEXEPath ( )

Definition at line 63 of file paths.c.

References ISO_GAME_EXE_PATH.

Referenced by extract_iso_game_cache().

◆ DTTR_LoaderISO_GamePkgPath()

const char * DTTR_LoaderISO_GamePkgPath ( )

Definition at line 67 of file paths.c.

References ISO_GAME_PKG_PATH.

Referenced by extract_iso_game_cache().

◆ DTTR_LoaderISO_GameRoot()

const char * DTTR_LoaderISO_GameRoot ( )

Definition at line 59 of file paths.c.

References ISO_GAME_ROOT.

Referenced by resolve_iso_direct().

◆ DTTR_LoaderPath_IsISOW()

bool DTTR_LoaderPath_IsISOW ( const wchar_t * path)

Definition at line 47 of file paths.c.

References has_suffix_w(), and ISO_SUFFIX.

Referenced by try_browsed_path(), and try_configured_path().

◆ has_suffix_w()

bool has_suffix_w ( const wchar_t * path,
const wchar_t * suffix )
static

Definition at line 30 of file paths.c.

References ascii_lower_w().

Referenced by DTTR_LoaderPath_IsISOW().

◆ hash_path()

uint64_t hash_path ( const char * path)
static

Definition at line 75 of file paths.c.

Referenced by DTTR_LoaderISO_CacheRootForPath().

◆ path_needs_separator()

bool path_needs_separator ( const char * path)
static

Definition at line 89 of file paths.c.

Referenced by DTTR_LoaderISO_CacheRootForPath().

Variable Documentation

◆ GAME_SUBPATHS

const wchar_t* const GAME_SUBPATHS[]
static
Initial value:
= {
L"pcdogs.exe",
L"Setup\\102Dalms\\pcdogs.exe",
}

Definition at line 10 of file paths.c.

Referenced by DTTR_Loader_GameSubpathAt(), and DTTR_Loader_GameSubpathCount().

◆ ISO_CACHE_PATH

const char* const ISO_CACHE_PATH = "DetoursToTheRescue\\cache\\iso"
static

Definition at line 16 of file paths.c.

Referenced by DTTR_LoaderISO_CacheRootForPath().

◆ ISO_GAME_DATA_PATH

const char* const ISO_GAME_DATA_PATH = "Setup/102Dalms/data"
static

Definition at line 20 of file paths.c.

Referenced by DTTR_LoaderISO_GameDataPath().

◆ ISO_GAME_EXE_PATH

const char* const ISO_GAME_EXE_PATH = "Setup/102Dalms/pcdogs.exe"
static

Definition at line 18 of file paths.c.

Referenced by DTTR_LoaderISO_GameEXEPath().

◆ ISO_GAME_PKG_PATH

const char* const ISO_GAME_PKG_PATH = "Setup/102Dalms/pcdogs.pkg"
static

Definition at line 19 of file paths.c.

Referenced by DTTR_LoaderISO_GamePkgPath().

◆ ISO_GAME_ROOT

const char* const ISO_GAME_ROOT = "Setup/102Dalms"
static

Definition at line 17 of file paths.c.

Referenced by DTTR_LoaderISO_GameRoot().

◆ ISO_SUFFIX

const wchar_t ISO_SUFFIX[] = L".iso"
static

Definition at line 15 of file paths.c.

Referenced by DTTR_LoaderPath_IsISOW().