2 Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015,
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/>.
25 #include <sys/types.h>
26 #include "util-slist.h"
28 #define INVALID_PRIORITY "-99"
30 struct config_section_s
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
48 struct invoking_user_s
*next
;
57 int max_recursion_depth
;
58 int disable_list_and_dump
;
59 struct slist_s
*global_config
;
61 pthread_mutex_t rcfile_mutex
;
62 pthread_cond_t rcfile_cond
;
64 struct invoking_user_s
*invoking_users
;
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 struct slist_s
*config_keep_save ();
92 void config_keep_restore (struct slist_s
*);