source: MondoRescue/branches/stable/mondo/src/include/mr_conf.h@ 1629

Last change on this file since 1629 was 1594, checked in by Bruno Cornec, 17 years ago

Use of conf file entries (iso_burning_*, media_device, media_size)
and adapatation of the rest of the code to that (including bkpinfo)

  • Property svn:eol-style set to native
File size: 3.9 KB
Line 
1/* mr_conf.h
2 *
3 * $Id$
4 *
5 * based on parse_conf.h (c)2002-2004 Anton Kulchitsky mailto:anton@kulchitsky.org
6 * Reviewed for mondorescue (c) 2006-2007 Bruno Cornec <bruno@mondorescue.org>
7 *
8 * Header file of mr_conf: a very small and simple
9 * library for mondorescue configuration file reading
10 *
11 * Provided under the GPLv2
12 */
13
14#ifndef MR_CONF_H
15#define MR_CONF_H
16
17#include "mr_types.h"
18
19/* mondoarchive structure storing conf info
20 * each field of the configuration file should have an entry here
21 */
22struct mr_ar_conf {
23 /* MINDI: ISO image CLI command to use */
24 char *iso_creation_cmd;
25 /* MINDI: ISO image common creation options */
26 char *iso_creation_opt;
27 /* ISO Burning CLI command to use */
28 char *iso_burning_cmd;
29 /* ISO Burning device to use (optional) */
30 char *iso_burning_dev;
31 /* ISO Burning CLI command options */
32 char *iso_burning_opt;
33 /* ISO Burning Speed */
34 int iso_burning_speed;
35 /* Default size of media */
36 int media_size;
37 /* Default device of media */
38 char *media_device;
39 /* Is the CD tray manual ? */
40 bool manual_tray;
41 /* Default log level */
42 int log_level;
43 /* default prefix for ISO names */
44 char *prefix;
45 /* External tape blocksize */
46 int external_tape_blocksize;
47 /* Internal tape blocksize */
48 int internal_tape_blocksize;
49 /* Size in MB of the slices for biggiefiles */
50 int slice_size;
51 /* deplist file used */
52 char *deplist_file;
53 /* Write boot floppies ? */
54 bool write_boot_floppy;
55 /* Create mindi CD ? */
56 bool create_mindi_cd;
57 /* Kernel to use */
58 char *kernel;
59 /* Additional modules to support */
60 char *additional_modules;
61 /* Boot loader to use */
62 char *boot_loader;
63 /* Differential backup ? */
64 bool differential;
65 /* Default compression tool */
66 char *compression_tool;
67 /* Default compression level */
68 int compression_level;
69 /* Paths to exclude from backup */
70 char *exclude_paths;
71 /* Paths to include onto the backup */
72 char *include_paths;
73 /* Which mode should be activated by default*/
74 char *ui_mode;
75 /* Activate automatic restore ? */
76 bool automatic_restore;
77 /* Scratch directory */
78 char *scratch_dir;
79 /* Temporary directory main path */
80 char *tmp_dir;
81 /* Images creation dir */
82 char *images_dir;
83};
84
85/* mondorestore structure storing conf info
86 * each field of the configuration file should have an entry here
87 */
88struct mr_rs_conf {
89 /* Default media size */
90 int media_size;
91 /* Default device of media */
92 char *media_device;
93 /* Is the CD tray manual ? */
94 bool manual_tray;
95 /* Default log level */
96 int log_level;
97 /* default prefix for ISO names */
98 char *prefix;
99 /* External tape blocksize */
100 int external_tape_blocksize;
101 /* Internal tape blocksize */
102 int internal_tape_blocksize;
103 /* Size in MB of the slices for biggiefiles */
104 int slice_size;
105 /* Boot loader to use */
106 char *boot_loader;
107 /* Differential backup ? */
108 bool differential;
109 /* Default compression tool */
110 char *compression_tool;
111 /* Which mode should be activated by default*/
112 char *ui_mode;
113 /* Activate automatic restore ? */
114 bool automatic_restore;
115 /* Images creation dir */
116 char *images_dir;
117};
118
119/* functions (public methods) */
120
121/*initialization and closing*/
122extern int mr_conf_open(const char *filename);
123extern void mr_conf_close(void);
124
125/*read integer number (under a string format to be freed later on) after string str in the current file*/
126/* use atoi after */
127extern char *mr_conf_iread(const char *field_name);
128
129/*read double/float number (under a string format to be freed later on) after string str in the current file*/
130/* use atof after */
131extern char *mr_conf_fread(const char *field_name);
132
133/*read boolean (under a string format to be freed later on) after string str in the current file*/
134/* use mr_atob after */
135extern char *mr_conf_bread(const char *field_name);
136
137/*
138 * read string after string str in the current file.
139 * This function allocates the string which has to be freed later on
140*/
141extern char *mr_conf_sread(const char *field_name);
142
143#endif /* MR_CONF_H */
Note: See TracBrowser for help on using the repository browser.