Make "log_keepopen" a global variable.
[pwmd.git] / src / rcfile.h
blobd0ea851b13793d3fdaa0f44693fee2f804d54181
1 /*
2 Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
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 <sys/types.h>
25 #include "util-slist.h"
27 /* This is a string so ealier versions of glib can be used. */
28 #define DEFAULT_ITERATION_PROGRESS "2000"
30 #define INVALID_PRIORITY "-99"
32 struct config_section_s
34 char *name;
35 struct slist_s *params;
38 #define INVOKING_UID 0
39 #define INVOKING_GID 1
40 #define INVOKING_TLS 2
42 struct invoking_user_s
44 int type;
45 int not;
46 union {
47 uid_t uid;
48 char *id;
50 struct invoking_user_s *next;
53 #ifdef HAVE_MLOCKALL
54 int disable_mlock;
55 #endif
56 char *logfile;
57 char *rcfile;
58 char *homedir;
59 int max_recursion_depth;
60 int disable_list_and_dump;
61 struct slist_s *global_config;
62 int log_syslog;
63 pthread_mutex_t rcfile_mutex;
64 pthread_cond_t rcfile_cond;
65 pthread_t rcfile_tid;
66 struct invoking_user_s *invoking_users;
67 int log_keepopen;
69 void free_invoking_users (struct invoking_user_s *);
70 struct slist_s *config_parse (const char *filename, int reload);
71 void config_clear_keys ();
72 void config_free (struct slist_s *config);
74 char *config_get_value (const char *section, const char *what);
75 long config_get_long (const char *section, const char *what);
76 int config_get_boolean (const char *section, const char *what);
77 int config_get_integer (const char *section, const char *what);
78 char *config_get_string (const char *section, const char *what);
79 char **config_get_list (const char *section, const char *what);
80 unsigned long long config_get_ulonglong (const char *section, const char *what);
82 int config_set_list_param (struct slist_s **config, const char *section,
83 const char *name, const char *value);
84 char **config_get_list_param (struct slist_s *config, const char *section,
85 const char *what, int *exists);
86 int config_set_int_param (struct slist_s **config, const char *section,
87 const char *name, const char *value);
88 int config_get_int_param (struct slist_s *config, const char *section,
89 const char *name, int *exists);
90 int config_get_bool_param (struct slist_s *config, const char *section,
91 const char *name, int *exists);
92 int config_set_bool_param (struct slist_s **config, const char *section,
93 const char *name, const char *value);
94 struct slist_s *config_keep_save ();
95 void config_keep_restore (struct slist_s *);
97 #endif