mirror of
https://github.com/aydencharles/onionHEN.git
synced 2026-10-23 04:12:37 -05:00
Extract host-testable helpers (GitHub commit SHA, account-id base64, registry entity ids, playtime store, cheat flatten names, toolbox path helpers, IPC reply body) and grow the util host suite to ~120 cases. Also phase-split bootstrapper main for clearer launch diagnostics.
40 lines
1.2 KiB
C
40 lines
1.2 KiB
C
#pragma once
|
|
|
|
#include <stddef.h>
|
|
|
|
/* Flat cheat directory only. */
|
|
#define ORION_DATA_ROOT "/data/OrionHEN"
|
|
#define ORION_CHEATS_DIR ORION_DATA_ROOT "/cheats"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* If @p name ends with a known cheat extension (.json/.shn/.mc4/.ShnExt),
|
|
* write the format tag ("json", "shn", "mc4", "ShnExt") to @p ext_out and
|
|
* return 1. Otherwise return 0.
|
|
*/
|
|
int orion_cheat_match_ext(const char *name, char *ext_out, size_t ext_out_size);
|
|
|
|
/**
|
|
* Build flat install name TITLEID_VERSION.ext from GoldHEN/OrionHEN-style
|
|
* filenames (e.g. CUSA05786_01.04_eboot.bin.json → CUSA05786_01.04.json).
|
|
* Returns 0 on success, -1 if the name is not a recognized cheat file.
|
|
*/
|
|
int orion_cheat_build_flat_name(const char *filename, char *out, size_t out_size);
|
|
|
|
/**
|
|
* Sanitize game version for cheat path segments: keep alnum . _ -;
|
|
* replace other characters with '_'. Empty/NULL → empty string.
|
|
*/
|
|
void orion_cheat_normalize_version(const char *version, char *out,
|
|
size_t out_size);
|
|
|
|
/** Walk @p root and copy cheats into ORION_CHEATS_DIR as flat names. */
|
|
int orion_cheat_flatten_install_tree(const char *root);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|