forked from trusteddomainproject/OpenDMARC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.h
65 lines (56 loc) · 1.49 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
** Copyright (c) 2006-2008 Sendmail, Inc. and its suppliers.
** All rights reserved.
**
** Copyright (c) 2009-2012, The Trusted Domain Project. All rights reserved.
**
** $Id: config.h,v 1.3.34.1 2010/10/27 21:43:09 cm-msk Exp $
*/
#ifndef _CONFIG_H_
#define _CONFIG_H_
#include "build-config.h"
/* system includes */
#include <sys/types.h>
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#endif /* HAVE_STDBOOL_H */
#include <stdio.h>
#ifdef __STDC__
# ifndef __P
# define __P(x) x
# endif /* ! __P */
#else /* __STDC__ */
# ifndef __P
# define __P(x) ()
# endif /* ! __P */
#endif /* __STDC__ */
/* types and things */
#define CONFIG_TYPE_STRING 0
#define CONFIG_TYPE_INTEGER 1
#define CONFIG_TYPE_BOOLEAN 2
#define CONFIG_TYPE_INCLUDE 3
struct config
{
_Bool cfg_bool;
u_int cfg_type;
int cfg_int;
char * cfg_name;
char * cfg_string;
struct config * cfg_next;
};
struct configdef
{
char * cd_name;
u_int cd_type;
u_int cd_req;
};
/* prototypes */
extern char *config_check __P((struct config *, struct configdef *));
extern unsigned int config_dump __P((struct config *, FILE *, const char *));
extern char *config_error __P((void));
extern void config_free __P((struct config *));
extern int config_get __P((struct config *, const char *, void *, size_t));
extern struct config *config_load __P((char *, struct configdef *,
unsigned int *, char *, size_t));
extern _Bool config_validname __P((struct configdef *, const char *));
#endif /* _CONFIG_H_ */