Update copyright header.
[pwmd.git] / src / rcfile.h
blobac3e760c732ca4e62d474c5df6403b5ae62b2f95
1 /*
2 Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
3 Ben Kibbey <bjk@luxsci.net>
5 This file is part of pwmd.
7 Pwmd is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 2 of the License, or
10 (at your option) any later version.
12 Pwmd is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with Pwmd. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef RCFILE_H
21 #define RCFILE_H
23 #include <pthread.h>
24 #include "util-slist.h"
26 /* This is a string so ealier versions of glib can be used. */
27 #define DEFAULT_ITERATION_PROGRESS "2000"
29 #define INVALID_PRIORITY "-99"
31 #ifdef HAVE_MLOCKALL
32 int disable_mlock;
33 #endif
34 char *logfile;
35 char *rcfile;
36 char *homedir;
37 int max_recursion_depth;
38 int disable_list_and_dump;
39 struct slist_s *global_config;
40 int log_syslog;
41 pthread_mutex_t rcfile_mutex;
42 pthread_cond_t rcfile_cond;
43 pthread_t rcfile_tid;
45 struct slist_s *config_parse (const char *filename);
46 void config_clear_keys ();
47 void config_free (struct slist_s *config);
49 char *config_get_value (const char *section, const char *what);
50 long config_get_long (const char *section, const char *what);
51 unsigned long config_get_ulong (const char *section, const char *what);
52 int config_get_boolean (const char *section, const char *what);
53 int config_get_integer (const char *section, const char *what);
54 char *config_get_string (const char *section, const char *what);
55 char **config_get_list (const char *section, const char *what);
56 long long config_get_longlong (const char *section, const char *what);
57 unsigned long long config_get_ulonglong (const char *section,
58 const char *what);
60 int config_set_list_param (struct slist_s **config, const char *section,
61 const char *name, const char *value);
62 int config_set_int_param (struct slist_s **config, const char *section,
63 const char *name, const char *value);
64 int config_get_int_param (struct slist_s *config, const char *section,
65 const char *name, int *exists);
66 int config_get_bool_param (struct slist_s *config, const char *section,
67 const char *name, int *exists);
68 int config_set_bool_param (struct slist_s **config, const char *section,
69 const char *name, const char *value);
71 #endif