X-Git-Url: https://git.distorted.org.uk/~mdw/fwd/blobdiff_plain/b0805b27d5bd10b44106a3aa3dd9e99d58aeaaf7..9155ea97b695b6eb5fca1ee79f57b334f6c4ef53:/file.c diff --git a/file.c b/file.c index 7c78645..47b4943 100644 --- a/file.c +++ b/file.c @@ -1,80 +1,30 @@ /* -*-c-*- * - * $Id: file.c,v 1.5 2002/02/22 23:43:32 mdw Exp $ - * * File source and target * * (c) 1999 Straylight/Edgeware */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * - * This file is part of the `fw' port forwarder. + * This file is part of the `fwd' port forwarder. * - * `fw' is free software; you can redistribute it and/or modify + * `fwd' 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 of the License, or * (at your option) any later version. - * - * `fw' is distributed in the hope that it will be useful, + * + * `fwd' 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 `fw'; if not, write to the Free Software Foundation, + * along with `fwd'; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: file.c,v $ - * Revision 1.5 2002/02/22 23:43:32 mdw - * Call @xfree@ rather than @free@. - * - * Revision 1.4 2001/02/03 20:30:03 mdw - * Support re-reading config files on SIGHUP. - * - * Revision 1.3 1999/12/22 15:43:47 mdw - * Fix log messages. - * - * Revision 1.2 1999/10/22 22:47:13 mdw - * New (empty) endpoint method required. - * - * Revision 1.1 1999/07/26 23:33:32 mdw - * New sources and targets. - * - */ - -/*----- Header files ------------------------------------------------------*/ - -#include "config.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "conf.h" -#include "endpt.h" -#include "fattr.h" -#include "file.h" -#include "fw.h" -#include "reffd.h" -#include "scan.h" -#include "source.h" -#include "target.h" +#include "fwd.h" /*----- Data structures ---------------------------------------------------*/ @@ -112,7 +62,7 @@ typedef struct fdata { typedef struct fsource { source s; fdata f; -} fsource; +} fsource; /* --- File target block --- */ @@ -198,7 +148,7 @@ static reffd *file_nullref(void) reffd_handler(rnull, file_null, 0); } return (rnull); -} +} /* --- @file_fspec@ --- * * @@ -272,7 +222,7 @@ static void file_fspec(fspec *f, scanner *sc) else if (fd) { f->type = FTYPE_FD; f->u.fd = fd; - token(sc); + token(sc); } else if (type == FTYPE_FD) { if (sc->t == CTOK_WORD) error(sc, "bad file descriptor `%s'", sc->d.buf); @@ -328,7 +278,7 @@ static void file_pfspec(fspec *f, dstr *d) case FTYPE_NULL: dstr_puts(d, "null"); break; - } + } } static void file_desc(fdata *f, dstr *d) @@ -615,7 +565,7 @@ static void ftarget_destroy(target *t) target_ops ftarget_ops = { "file", - ftarget_option, ftarget_read, ftarget_create, ftarget_destroy + ftarget_option, ftarget_read, 0, ftarget_create, ftarget_destroy }; /*----- That's all, folks -------------------------------------------------*/