-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.h
33 lines (25 loc) · 1007 Bytes
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (c) 2010-2023 David Caldwell <[email protected]> -*- c++ -*-
// Licenced under the GPL 3.0 or any later version. See LICENSE file for details.
#ifndef __MASTER_CONFIG_H__
#define __MASTER_CONFIG_H__
#include <string>
#include <map>
#include <vector>
#include <list>
using namespace std;
struct master_config {
map<string,string> settings;
map<string,vector<string> > can_run_as;
map<string,vector<string> > manages;
};
struct daemon_config {
map<string,string> config;
map<string,string> env;
};
typedef map<string, vector<string> >::iterator config_it;
typedef vector<string>::iterator config_list_it;
struct master_config parse_master_config(string path);
struct daemon_config parse_daemon_config(string path);
list<string> validate_keys(map<string,string> cfg, const string &file, const vector<string> &valid_keys);
void validate_keys_pedantically(map<string,string> cfg, const string &file, const vector<string> &valid_keys);
#endif /* __MASTER_CONFIG_H__ */