Fix valid_xml_element() and valid_xml_attribute() to use XML spec.
[pwmd.git] / src / rcfile.h
blobd639ddfa7c54f6dee8ced95b23aa8b1e88aacc22
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 struct config_section_s
33 char *name;
34 struct slist_s *params;
37 #ifdef HAVE_MLOCKALL
38 int disable_mlock;
39 #endif
40 char *logfile;
41 char *rcfile;
42 char *homedir;
43 int max_recursion_depth;
44 int disable_list_and_dump;
45 struct slist_s *global_config;
46 int log_syslog;
47 pthread_mutex_t rcfile_mutex;
48 pthread_cond_t rcfile_cond;
49 pthread_t rcfile_tid;
51 struct slist_s *config_parse (const char *filename);
52 void config_clear_keys ();
53 void config_free (struct slist_s *config);
55 char *config_get_value (const char *section, const char *what);
56 long config_get_long (const char *section, const char *what);
57 unsigned long config_get_ulong (const char *section, const char *what);
58 int config_get_boolean (const char *section, const char *what);
59 int config_get_integer (const char *section, const char *what);
60 char *config_get_string (const char *section, const char *what);
61 char **config_get_list (const char *section, const char *what);
62 long long config_get_longlong (const char *section, const char *what);
63 unsigned long long config_get_ulonglong (const char *section,
64 const char *what);
66 int config_set_list_param (struct slist_s **config, const char *section,
67 const char *name, const char *value);
68 char **config_get_list_param (struct slist_s *config, const char *section,
69 const char *what, int *exists);
70 int config_set_int_param (struct slist_s **config, const char *section,
71 const char *name, const char *value);
72 int config_get_int_param (struct slist_s *config, const char *section,
73 const char *name, int *exists);
74 int config_get_bool_param (struct slist_s *config, const char *section,
75 const char *name, int *exists);
76 int config_set_bool_param (struct slist_s **config, const char *section,
77 const char *name, const char *value);
79 #endif