blob: 82cf589d0e871ba5dc108c739f9a664a2bda6d7f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
/* $Id: conf.h,v 1.1.1.1 1999/02/02 23:29:39 shmit Exp $ */
#ifndef CONF_H
# define CONF_H
/* Option names. */
#define MANAGER "manager"
#define LOGDIR "logdir"
#define INFOLOG "infolog"
#define ERRORLOG "errorlog"
#define HOSTLIST "hostlist"
#define TIMEOUT "timeout"
#define RETRIES "retries"
#define SPOOLDIR "spooldir"
#define SPOOLSIZE "spoolsize"
#define TAPEDEV "tapedev"
#define TAPESIZE "tapesize"
#define LABELSTR "labelstr"
#define PORTOPT "port"
#define DUMPOPT "dump"
#define TAROPT "tar"
#define SIZEOPT "size"
#define SIZE_RE "size_re"
/* Compression names. */
#define DC_UNCOMP "uncompressed"
#define DC_COMP "compressed"
#define DC_COMP9 "comp-best"
#define DC_COMPFAST "comp-fast"
/* Auth names. */
#define DA_NONE "noauth"
#define DA_RSH "rsh"
typedef enum { STROPT, NUMOPT } opt_t;
typedef enum { UNCOMP, COMP, COMP9, COMPFAST } comp_t;
typedef enum { NOAUTH, RSH } auth_t;
struct _config_t {
char *name;
opt_t type;
char *strvalue;
long numvalue;
};
typedef struct _config_t config_t;
struct _dump_t {
char d_name[BUFFSIZE];
char d_cmdline[MAXPATHLEN];
char d_estline[MAXPATHLEN];
char d_regexp[BUFFSIZE];
};
typedef struct _dump_t dump_t;
struct _disk_t {
char vol[MAXPATHLEN];
const dump_t *type;
comp_t comp;
auth_t auth;
};
typedef struct _disk_t disk_t;
struct _disklist_t {
disk_t disk;
struct _disklist_t *next;
};
typedef struct _disklist_t disklist_t;
const config_t *findopt(const char *name);
int read_config(const char *filen);
const dump_t *find_dumptype(const char *name);
int read_dumptypes(const char *filen);
disklist_t *read_disklist(const char *filen);
#endif
|