salvage: add initial config helper
This commit is contained in:
28
include/nwsalvage.h
Normal file
28
include/nwsalvage.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#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
|
||||
|
||||
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);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user