salvage: add repository path helpers

This commit is contained in:
Mario Fetka
2026-05-31 09:26:47 +00:00
parent bedec0d2c0
commit 47709fe935
3 changed files with 169 additions and 0 deletions

View File

@@ -10,6 +10,7 @@
#define NWSALVAGE_DEFAULT_RECYCLE_NAME ".recycle"
#define NWSALVAGE_DEFAULT_METADATA_NAME ".salvage"
#define NWSALVAGE_REPOSITORY_NAME_MAX 64
#define NWSALVAGE_PATH_MAX 4096
struct nwsalvage_config {
int enabled;
@@ -24,5 +25,14 @@ int nwsalvage_config_set_repositories(struct nwsalvage_config *config,
int nwsalvage_config_parse_repositories(struct nwsalvage_config *config,
const char *line);
int nwsalvage_repository_name_valid(const char *name);
int nwsalvage_relative_path_valid(const char *relative_path);
int nwsalvage_build_recycle_path(char *out, size_t out_len,
const struct nwsalvage_config *config,
const char *volume_root,
const char *relative_path);
int nwsalvage_build_metadata_path(char *out, size_t out_len,
const struct nwsalvage_config *config,
const char *volume_root,
const char *relative_path);
#endif