Files
mars-nwe/include/nwsalvage.h
2026-05-31 11:27:49 +02:00

39 lines
1.6 KiB
C

#ifndef _NWSALVAGE_H_
#define _NWSALVAGE_H_
#include <stddef.h>
#define NWSALVAGE_ENABLE_INI_SECTION 48
#define NWSALVAGE_REPOSITORY_INI_SECTION 49
#define NWSALVAGE_DEFAULT_ENABLED 1
#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;
char recycle_repository[NWSALVAGE_REPOSITORY_NAME_MAX];
char metadata_repository[NWSALVAGE_REPOSITORY_NAME_MAX];
};
int nwsalvage_config_defaults(struct nwsalvage_config *config);
int nwsalvage_config_set_repositories(struct nwsalvage_config *config,
const char *recycle_repository,
const char *metadata_repository);
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