head 1.12; access; symbols LMTP2NNTP_1_4_1:1.12 LMTP2NNTP_1_4_0:1.12 LMTP2NNTP_1_3_0:1.12 LMTP2NNTP_1_3b2:1.12 LMTP2NNTP_1_3b1:1.12 LMTP2NNTP_1_3a3:1.12 LMTP2NNTP_1_3a2:1.12 LMTP2NNTP_1_3a1:1.12 LMTP2NNTP_1_2_0:1.12 LMTP2NNTP_1_2b4:1.12 LMTP2NNTP_1_2b3:1.12 LMTP2NNTP_1_2b2:1.12 LMTP2NNTP_1_2b1:1.11 LMTP2NNTP_1_2a8:1.11 LMTP2NNTP_1_2a7:1.11 LMTP2NNTP_1_2a6:1.8 LMTP2NNTP_1_2a5:1.8 LMTP2NNTP_1_2a4:1.8 LMTP2NNTP_1_2a3:1.8; locks; strict; comment @ * @; 1.12 date 2003.02.11.11.41.11; author thl; state Exp; branches; next 1.11; 1.11 date 2003.01.30.19.42.13; author rse; state Exp; branches; next 1.10; 1.10 date 2003.01.30.19.27.29; author rse; state Exp; branches; next 1.9; 1.9 date 2003.01.30.15.19.55; author thl; state Exp; branches; next 1.8; 1.8 date 2002.02.14.10.47.20; author thl; state Exp; branches; next 1.7; 1.7 date 2002.01.24.16.25.54; author thl; state Exp; branches; next 1.6; 1.6 date 2002.01.24.12.04.46; author thl; state Exp; branches; next 1.5; 1.5 date 2002.01.22.16.09.47; author thl; state Exp; branches; next 1.4; 1.4 date 2002.01.21.16.21.16; author thl; state Exp; branches; next 1.3; 1.3 date 2002.01.17.17.01.55; author thl; state Exp; branches; next 1.2; 1.2 date 2002.01.14.12.23.21; author thl; state Exp; branches; next 1.1; 1.1 date 2002.01.09.13.54.25; author thl; state Exp; branches; next ; desc @@ 1.12 log @controlled exit when configuration throws exception @ text @/* ** OSSP lmtp2nntp - Mail to News Gateway ** Copyright (c) 2002-2003 Ralf S. Engelschall ** Copyright (c) 2002-2003 The OSSP Project ** Copyright (c) 2002-2003 Cable & Wireless Germany ** ** 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/tool/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 . ** ** lmtp2nntp_config.h: config handling */ #ifndef __LMTP2NNTP_CONFIG_H__ #define __LMTP2NNTP_CONFIG_H__ #include "lmtp2nntp_global.h" #include "lmtp2nntp_common.h" typedef enum { CONFIG_OK, CONFIG_OK_DRY, /* dry run short circuit i.e. --testfile or --version */ CONFIG_ERR_TRY, /* caught an exception from a underlying codeblock */ CONFIG_ERR_LOG /* cannot initialize logging */ } lmtp2nntp_config_rc_t; lmtp2nntp_config_rc_t config_context(lmtp2nntp_t *); #endif /* __LMTP2NNTP_CONFIG_H__ */ @ 1.11 log @Apply the standard OSSP copyright header, document ASCII art and fix URL to lmtp2nntp homepage. @ text @d38 1 @ 1.10 log @Implement the decision from yesterday evening and finally rename fixme.h to lmtp2nntp_common.h because there is little chance this this stuff ever can be moved into more local source contexts. @ text @d2 4 a5 2 ** Copyright (c) 2001-2002 The OSSP Project ** Copyright (c) 2001-2002 Cable & Wireless Deutschland d9 1 a9 1 ** It can be found at http://www.ossp.org/pkg/lmtp2nntp/. d42 1 d44 1 @ 1.9 log @remove all exit(3) but those within daemonizer and signal handler @ text @d31 1 a31 1 #include "fixme.h" @ 1.8 log @add outermost ifndef headers @ text @a31 1 void config_context(lmtp2nntp_t *); d33 7 @ 1.7 log @option works and data can be read by config @ text @d27 3 d33 2 @ 1.6 log @moved config to option, created a new config @ text @a28 2 //#include "val.h" //void config_context(lmtp2nntp_t *); @ 1.5 log @flush @ text @d24 1 a24 1 ** FIXME lmtp2nntp_option.h: LMTP to NNTP configuration parsing d28 4 a31 60 #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_USE, /* invalid usage, bad data 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 lmtp2nntp_option_rc_t (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 *); @ 1.4 log @flush @ text @d72 1 d83 1 a83 1 typedef void (optionloop_cb_t)(optionconfig_t *oc, char *arg, char *cbctx); @ 1.3 log @flush weekly work @ text @d30 3 d34 32 a65 27 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; /**/ val_t *vo; d76 11 a86 3 lmtp2nntp_option_rc_t option_create (lmtp2nntp_option_t **); lmtp2nntp_option_rc_t option_parse (lmtp2nntp_option_t *, int, char **); lmtp2nntp_option_rc_t option_destroy(lmtp2nntp_option_t *); @ 1.2 log @first steps toward popt @ text @d24 1 a24 1 ** lmtp2nntp.c: LMTP to NNTP configuration parsing d28 1 a28 1 void dotconftest(int, char **); //FIXME d31 27 a57 1 int option_childsmax; d59 1 a59 25 char *option_logfile; int option_groupmode; int option_operationmode; char *option_operationmodefakestatus; char *option_operationmodefakedsn; int option_maxmessagesize; char *option_azHeaderValuePairs; size_t option_asHeaderValuePairs; int option_timeout_lmtp_accept; int option_timeout_lmtp_read; int option_timeout_lmtp_write; int option_timeout_nntp_connect; int option_timeout_nntp_read; int option_timeout_nntp_write; char *option_mailfrom; char *option_restrictheader; unsigned int option_levelmask; char *option_pidfile; int option_killflag; uid_t option_uid; int option_daemon; int option_aclc; //struct acl option_acl[MAXACLS]; int option_veryverbose; } lmtp2nntp_config_t; d61 10 @ 1.1 log @configfile example with sections and evaluation of code to parse it @ text @d27 31 a57 1 void dotconftest(void); @