1 /* $NetBSD: cfg_parser.h,v 1.1.1.2 2013/01/02 18:58:56 tron Exp $ */ 2 3 #ifndef _CFG_PARSER_H_INCLUDED_ 4 #define _CFG_PARSER_H_INCLUDED_ 5 6 /*++ 7 /* NAME 8 /* cfg_parser 3h 9 /* SUMMARY 10 /* configuration parser utilities 11 /* SYNOPSIS 12 /* #include "cfg_parser.h" 13 DESCRIPTION 14 .nf 15 16 /* 17 * Utility library. 18 */ 19 #include <dict.h> 20 21 /* 22 * External interface. 23 */ 24 typedef struct CFG_PARSER { 25 char *name; 26 char *(*get_str) (const struct CFG_PARSER *, const char *, const char *, 27 int, int); 28 int (*get_int) (const struct CFG_PARSER *, const char *, int, int, int); 29 int (*get_bool) (const struct CFG_PARSER *, const char *, int); 30 DICT_OWNER owner; 31 } CFG_PARSER; 32 33 extern CFG_PARSER *cfg_parser_alloc(const char *); 34 extern char *cfg_get_str(const CFG_PARSER *, const char *, const char *, 35 int, int); 36 extern int cfg_get_int(const CFG_PARSER *, const char *, int, int, int); 37 extern int cfg_get_bool(const CFG_PARSER *, const char *, int); 38 extern CFG_PARSER *cfg_parser_free(CFG_PARSER *); 39 40 #define cfg_get_owner(cfg) ((cfg)->owner) 41 42 /* LICENSE 43 /* .ad 44 /* .fi 45 /* The Secure Mailer license must be distributed with this software. 46 /* AUTHOR(S) 47 /* Wietse Venema 48 /* IBM T.J. Watson Research 49 /* P.O. Box 704 50 /* Yorktown Heights, NY 10598, USA 51 /* 52 /* Liviu Daia 53 /* Institute of Mathematics of the Romanian Academy 54 /* P.O. BOX 1-764 55 /* RO-014700 Bucharest, ROMANIA 56 /*--*/ 57 58 #endif 59