head 1.5; access; symbols LMTP2NNTP_1_4_1:1.5 LMTP2NNTP_1_4_0:1.5 LMTP2NNTP_1_3_0:1.5 LMTP2NNTP_1_3b2:1.5 LMTP2NNTP_1_3b1:1.5 LMTP2NNTP_1_3a3:1.5 LMTP2NNTP_1_3a2:1.5 LMTP2NNTP_1_3a1:1.5 LMTP2NNTP_1_2_0:1.5 LMTP2NNTP_1_2b4:1.5 LMTP2NNTP_1_2b3:1.3 LMTP2NNTP_1_2b2:1.3 LMTP2NNTP_1_2b1:1.3 LMTP2NNTP_1_2a8:1.3 LMTP2NNTP_1_2a7:1.3 LMTP2NNTP_1_2a6:1.2 LMTP2NNTP_1_2a5:1.2 LMTP2NNTP_1_2a4:1.2 LMTP2NNTP_1_2a3:1.2; locks; strict; comment @ * @; 1.5 date 2003.02.12.16.16.29; author rse; state Exp; branches; next 1.4; 1.4 date 2003.02.12.16.15.13; author rse; state Exp; branches; next 1.3; 1.3 date 2003.01.30.19.42.13; author rse; state Exp; branches; next 1.2; 1.2 date 2002.02.27.09.34.41; author thl; state Exp; branches; next 1.1; 1.1 date 2002.02.14.10.51.50; author thl; state Exp; branches; next ; desc @@ 1.5 log @finish DMalloc support @ 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_exwrap.c: lib_ex wrappers */ #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #if defined(HAVE_DMALLOC_H) && defined(WITH_DMALLOC) #include "dmalloc.h" #endif /* own headers */ #include "lmtp2nntp_global.h" char *strdupex(const char *str) { char *rc; if (str == NULL) throw(0,0,0); if ((rc = strdup(str)) == NULL) throw(0,0,0); return rc; } char *str_dupex(const char *s, str_size_t n) { char *rc; if (s == NULL || n == 0) throw(0,0,0); if ((rc = str_dup(s, n)) == NULL) throw(0,0,0); return rc; } void *mallocex(size_t size) { void *rc; if (size == 0) throw(0,0,0); if ((rc = malloc(size)) == NULL) throw(0,0,0); return rc; } void *reallocex(void *ptr, size_t size) { void *rc; if (ptr == NULL || size == 0) throw(0,0,0); if ((rc = realloc(ptr, size)) == NULL) throw(0,0,0); return rc; } void freeex(void *ptr) { if (ptr == NULL) throw(0,0,0); free(ptr); return; } @ 1.4 log @throw exceptions also for invalid arguments in allocation wrapper functions @ text @d31 6 @ 1.3 log @Apply the standard OSSP copyright header, document ASCII art and fix URL to lmtp2nntp homepage. @ text @d39 2 d50 2 d61 2 d72 2 @ 1.2 log @changed semantic of --headerrule to "keep the colon" @ text @a0 1 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/. @ 1.1 log @add some wrapper code for lib_ex @ text @d43 9 @