source: MondoRescue/branches/2.2.9/mondo/src/include/mr_conf.h@ 2208

Last change on this file since 2208 was 2208, checked in by Bruno Cornec, 15 years ago

Addition of useful functions originaly written for stable branch now obsolete

  • 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 * 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 /* Kernel to use */
50 char *kernel;
51 /* Additional modules to support */
52 char *additional_modules;
53 /* Boot loader to use */
54 char *boot_loader;
55 /* Differential backup ? */
56 bool differential;
57 /* Default compression tool */
58 char *compression_tool;
59 /* Default compression level */
60 int compression_level;
61 /* Paths to exclude from backup */
62 char *exclude_paths;
63 /* Paths to include onto the backup */
64 char *include_paths;
65 /* Which mode should be activated by default*/
66 char *ui_mode;
67 /* Activate automatic restore ? */
68 bool automatic_restore;
69 /* Scratch directory */
70 char *scratch_dir;
71 /* Temporary directory main path */
72 char *tmp_dir;
73 /* Images creation dir */
74 char *images_dir;
75};
76
77/* mondorestore structure storing conf info
78 * each field of the configuration file should have an entry here
79 */
80struct mr_rs_conf {
81 /* Default media size */
82 int media_size;
83 /* Default device of media */
84 char *media_device;
85 /* Is the CD tray manual ? */
86 bool manual_tray;
87 /* Default log level */
88 int log_level;
89 /* default prefix for ISO names */
90 char *prefix;
91 /* External tape blocksize */
92 int external_tape_blocksize;
93 /* Internal tape blocksize */
94 int internal_tape_blocksize;
95 /* Boot loader to use */
96 char *boot_loader;
97 /* Differential backup ? */
98 bool differential;
99 /* Default compression tool */
100 char *compression_tool;
101 /* Which mode should be activated by default*/
102 char *ui_mode;
103 /* Activate automatic restore ? */
104 bool automatic_restore;
105 /* Images creation dir */
106 char *images_dir;
107};
108
109/* functions (public methods) */
110
111/*initialization and closing*/
112extern int mr_conf_open(const char *filename);
113extern void mr_conf_close(void);
114
115/*read integer number (under a string format to be freed later on) after string str in the current file*/
116/* use atoi after */
117extern char *mr_conf_iread(const char *field_name);
118
119/*read double/float number (under a string format to be freed later on) after string str in the current file*/
120/* use atof after */
121extern char *mr_conf_fread(const char *field_name);
122
123/*read boolean (under a string format to be freed later on) after string str in the current file*/
124/* use mr_atob after */
125extern char *mr_conf_bread(const char *field_name);
126
127/*
128 * read string after string str in the current file.
129 * This function allocates the string which has to be freed later on
130*/
131extern char *mr_conf_sread(const char *field_name);
132
133#endif /* MR_CONF_H */
Note: See TracBrowser for help on using the repository browser.