/* ** Copyright (c) 2001-2002 The OSSP Project ** Copyright (c) 2001-2002 Cable & Wireless Deutschland ** ** This file is part of OSSP lmtp2nntp, an LMTP speaking local ** mailer which forwards mails as Usenet news articles via NNTP. ** It can be found at http://www.ossp.org/pkg/lmtp2nntp/. ** ** This program is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License ** as published by the Free Software Foundation; either version ** 2.0 of the License, or (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this file; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 ** USA, or contact the OSSP project . ** ** FIXME lmtp2nntp_option.h: LMTP to NNTP configuration parsing */ #include "lmtp2nntp_global.h" #include "val.h" struct optionconfig_s; typedef struct optionconfig_s optionconfig_t; typedef struct { int childsmax; int daemonize; int kill; char *pidfile; argz_t acl; char *bind; char *client; argz_t destination; char *groupmode; argz_t headervalue; argz_t include; char *size; int *timeoutlmtpaccept; int *timeoutlmtpread; int *timeoutlmtpwrite; int *timeoutnntpconnect; int *timeoutnntpread; int *timeoutnntpwrite; char *mailfrom; char *nodename; char *operationmode; char *l2spec; char *uid; argz_t restrictheader; argz_t newsgroup; /*FIXME above*/ optionconfig_t *first; optionconfig_t *last; val_t *vo; /* val_t for all options */ int pi; /* popt index to next record */ int pn; /* popt number of available records */ struct popt_option *pt; /* popt table */ } lmtp2nntp_option_t; typedef enum { OPTION_OK, OPTION_ERR_ARG, /* invalid args passed into function */ OPTION_ERR_MEM, /* out of memory */ OPTION_ERR_VAL /* libval failed */ } lmtp2nntp_option_rc_t; typedef enum { OPT_FLAG, OPT_SINGLE, OPT_MULTI } optiontype_t; typedef void (optionloop_cb_t)(optionconfig_t *oc, char *arg, char *cbctx); lmtp2nntp_option_rc_t option_create (lmtp2nntp_option_t **); lmtp2nntp_option_rc_t option_register(lmtp2nntp_option_t *, char *, char, optiontype_t, optionloop_cb_t *, char *, char *, char *); lmtp2nntp_option_rc_t option_parse (lmtp2nntp_option_t *, int, char **); lmtp2nntp_option_rc_t option_destroy (lmtp2nntp_option_t *);