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

Last change on this file since 1264 was 1264, checked in by Bruno Cornec, 17 years ago
  • mr_exit used instead of exit
  • mr_rs_clean_conf/mr_rs_cleanup/mr_ar_clean_conf/mr_ar_cleanup added
  • compiltaion warnings suppressed
  • Addition of mr_types (for boolean with typedef)
  • struct mr_rs_conf added
  • help_screen removed (useless)
  • Property svn:eol-style set to native
File size: 3.6 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 * Review for mondorescue (c) 2006 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/* mondoarchive structure storing conf info
18 * each field of the configuration file should have an entry here
19 */
20struct mr_ar_conf {
21 /* ISO image CLI command to use */
22 char *iso_creation_cmd;
23 /* ISO image common creation options */
24 char *iso_creation_options;
25 /* ISO Burning CLI command to use */
26 char *iso_burning_cmd;
27 /* ISO Burning CLI command options */
28 char *iso_burning_options;
29 /* ISO Burning Speed */
30 int iso_burning_speed;
31 /* Default size of media */
32 int media_size;
33 /* Default device of media */
34 char *media_device;
35 /* Is the CD tray manual ? */
36 bool manual_tray;
37 /* Default log level */
38 int log_level;
39 /* default prefix for ISO names */
40 char *prefix;
41 /* External tape blocksize */
42 int external_tape_blocksize;
43 /* Internal tape blocksize */
44 int internal_tape_blocksize;
45 /* Size in MB of the slices for biggiefiles */
46 int slice_size;
47 /* deplist file used */
48 char *deplist_file;
49 /* Write boot floppies ? */
50 bool write_boot_floppy;
51 /* Create mindi CD ? */
52 bool create_mindi_cd;
53 /* Kernel to use */
54 char *kernel;
55 /* Additional modules to support */
56 char *additional_modules;
57 /* Boot loader to use */
58 char *boot_loader;
59 /* Differential backup ? */
60 bool differential;
61 /* Default compression tool */
62 char *compression_tool;
63 /* Default compression level */
64 int compression_level;
65 /* Paths to exclude from backup */
66 char *exclude_paths;
67 /* Paths to include onto the backup */
68 char *include_paths;
69 /* Which mode should be activated by default*/
70 char *ui_mode;
71 /* Activate automatic restore ? */
72 bool automatic_restore;
73 /* Scratch directory */
74 char *scratch_dir;
75 /* Temporary directory main path */
76 char *tmp_dir;
77 /* Images creation dir */
78 char *images_dir;
79};
80
81/* mondorestore structure storing conf info
82 * each field of the configuration file should have an entry here
83 */
84struct mr_rs_conf {
85 /* Default media size */
86 int media_size;
87 /* Default device of media */
88 char *media_device;
89 /* Is the CD tray manual ? */
90 bool manual_tray;
91 /* Default log level */
92 int log_level;
93 /* default prefix for ISO names */
94 char *prefix;
95 /* External tape blocksize */
96 int external_tape_blocksize;
97 /* Internal tape blocksize */
98 int internal_tape_blocksize;
99 /* Size in MB of the slices for biggiefiles */
100 int slice_size;
101 /* Boot loader to use */
102 char *boot_loader;
103 /* Differential backup ? */
104 bool differential;
105 /* Default compression tool */
106 char *compression_tool;
107 /* Which mode should be activated by default*/
108 char *ui_mode;
109 /* Activate automatic restore ? */
110 bool automatic_restore;
111 /* Images creation dir */
112 char *images_dir;
113};
114
115/* functions (public methods) */
116
117/*initialization and closing*/
118extern int mr_conf_open(const char *filename);
119extern void mr_conf_close(void);
120
121/*read integer number after string str in the current file*/
122extern int mr_conf_iread(const char *field_name);
123
124/*read double/float number after string str in the current file*/
125extern double mr_conf_fread(const char *field_name);
126
127/*read boolean after string str in the current file*/
128extern bool mr_conf_bread(const char *field_name);
129
130/*
131 * read string after string str in the current file.
132 * This function allocates the string which has to be freed later on
133*/
134extern char *mr_conf_sread(const char *field_name);
135
136#endif /* MR_CONF_H */
Note: See TracBrowser for help on using the repository browser.