Fix EXPIRE status message.
[pwmd.git] / src / rcfile.h
blob574377e8ffb4901f689c178e56cf791e5f0f7ac0
1 /*
2 Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015,
3 2016, 2017
4 Ben Kibbey <bjk@luxsci.net>
6 This file is part of pwmd.
8 Pwmd is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 2 of the License, or
11 (at your option) any later version.
13 Pwmd is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with Pwmd. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef RCFILE_H
22 #define RCFILE_H
24 #include <pthread.h>
25 #include <sys/types.h>
26 #include "util-slist.h"
28 #define INVALID_PRIORITY "-99"
30 struct config_section_s
32 char *name;
33 struct slist_s *params;
36 #define INVOKING_UID 0
37 #define INVOKING_GID 1
38 #define INVOKING_TLS 2
40 struct invoking_user_s
42 int type;
43 int not;
44 union {
45 uid_t uid;
46 char *id;
48 struct invoking_user_s *next;
51 #ifdef HAVE_MLOCKALL
52 int disable_mlock;
53 #endif
54 char *logfile;
55 char *rcfile;
56 char *homedir;
57 int max_recursion_depth;
58 int disable_list_and_dump;
59 struct slist_s *global_config;
60 int log_syslog;
61 pthread_mutex_t rcfile_mutex;
62 pthread_cond_t rcfile_cond;
63 pthread_t rcfile_tid;
64 struct invoking_user_s *invoking_users;
65 int log_keepopen;
67 void free_invoking_users (struct invoking_user_s *);
68 struct slist_s *config_parse (const char *filename, int reload);
69 void config_free (struct slist_s *config);
71 char *config_get_value (const char *section, const char *what);
72 long config_get_long (const char *section, const char *what);
73 int config_get_boolean (const char *section, const char *what);
74 int config_get_integer (const char *section, const char *what);
75 char *config_get_string (const char *section, const char *what);
76 char **config_get_list (const char *section, const char *what);
77 long long config_get_longlong (const char *section, const char *what);
79 int config_set_list_param (struct slist_s **config, const char *section,
80 const char *name, const char *value);
81 char **config_get_list_param (struct slist_s *config, const char *section,
82 const char *what, int *exists);
83 int config_set_int_param (struct slist_s **config, const char *section,
84 const char *name, const char *value);
85 int config_get_int_param (struct slist_s *config, const char *section,
86 const char *name, int *exists);
87 int config_get_bool_param (struct slist_s *config, const char *section,
88 const char *name, int *exists);
89 int config_set_bool_param (struct slist_s **config, const char *section,
90 const char *name, const char *value);
91 int config_set_long_param (struct slist_s **config, const char *section,
92 const char *name, const char *value);
93 struct slist_s *config_keep_save ();
94 void config_keep_restore (struct slist_s *);
96 #endif