Prepare for 1.4.0 release.
[inoclam.git] / src / config.hxx
blob31f1efe17fa0d7ca5c06605c91bfe0f2cd764adf
1 /*
2 * inoclam - Inotify+ClamAV virus scanner
3 * Copyright (C) 2007, 2008, 2009 Vermont Department of Taxes
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __CONFIG_HXX
20 #define __CONFIG_HXX
22 #include <list>
23 #include <confuse.h>
25 /**
26 * The default configuration file location.
28 #define DEFAULT_CONFIGFILE "/etc/inoclam.conf"
30 /**
31 * The configuration file path.
33 extern char *configfile;
35 class config {
36 private:
37 char *directory;
39 cfg_bool_t file_email_enabled;
40 char *file_email_subject;
42 cfg_bool_t virus_removal_enabled;
43 cfg_bool_t virus_email_enabled;
44 char *virus_email_subject;
46 char *host;
47 int port;
48 char *from;
50 std::list < char *>*to;
51 public:
52 config();
53 ~config();
55 void setDirectory(char *new_dir);
56 char *getDirectory();
58 void setFileEMailEnabled(cfg_bool_t enabled);
59 cfg_bool_t getFileEMailEnabled();
60 void setFileEMailSubject(char *subject);
61 char *getFileEMailSubject();
63 void setVirusRemovalEnabled(cfg_bool_t enabled);
64 cfg_bool_t getVirusRemovalEnabled();
65 void setVirusEMailEnabled(cfg_bool_t enabled);
66 cfg_bool_t getVirusEMailEnabled();
67 void setVirusEMailSubject(char *subject);
68 char *getVirusEMailSubject();
70 char *getHost();
71 void setHost(char *h);
72 int getPort();
73 void setPort(int p);
74 char *getFrom();
75 void setFrom(char *f);
77 std::list < char *>*getTo();
78 void setTo(std::list < char *>*to);
81 /**
82 * Parses an inoclam.conf configuration file.
84 std::list < config::config * >*config_parse();
86 #endif