Back to index

opendkim  2.6.2
config.h
Go to the documentation of this file.
00001 /*
00002 **  Copyright (c) 2006-2008 Sendmail, Inc. and its suppliers.
00003 **     All rights reserved.
00004 **
00005 **  Copyright (c) 2009-2011, The OpenDKIM Project.  All rights reserved.
00006 **
00007 **  $Id: config.h,v 1.3.34.1 2010/10/27 21:43:09 cm-msk Exp $
00008 */
00009 
00010 #ifndef _CONFIG_H_
00011 #define _CONFIG_H_
00012 
00013 #ifndef lint
00014 static char config_h_id[] = "@(#)$Id: config.h,v 1.3.34.1 2010/10/27 21:43:09 cm-msk Exp $";
00015 #endif /* !lint */
00016 
00017 #include "build-config.h"
00018 
00019 /* system includes */
00020 #include <sys/types.h>
00021 #ifdef HAVE_STDBOOL_H
00022 # include <stdbool.h>
00023 #endif /* HAVE_STDBOOL_H */
00024 #include <stdio.h>
00025 
00026 /* types and things */
00027 #define       CONFIG_TYPE_STRING   0
00028 #define       CONFIG_TYPE_INTEGER  1
00029 #define       CONFIG_TYPE_BOOLEAN  2
00030 #define       CONFIG_TYPE_INCLUDE  3
00031 
00032 struct config
00033 {
00034        _Bool         cfg_bool;
00035        u_int         cfg_type;
00036        int           cfg_int;
00037        char *        cfg_name;
00038        char *        cfg_string;
00039        struct config *      cfg_next;
00040 };
00041 
00042 struct configdef
00043 {
00044        char *        cd_name;
00045        u_int         cd_type;
00046        u_int         cd_req;
00047 };
00048 
00049 /* prototypes */
00050 extern char *config_check __P((struct config *, struct configdef *));
00051 extern unsigned int config_dump __P((struct config *, FILE *, const char *));
00052 extern char *config_error __P((void));
00053 extern void config_free __P((struct config *));
00054 extern int config_get __P((struct config *, const char *, void *, size_t));
00055 extern struct config *config_load __P((char *, struct configdef *,
00056                                        unsigned int *, char *, size_t));
00057 extern _Bool config_validname __P((struct configdef *, const char *));
00058 
00059 #endif /* _CONFIG_H_ */