X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fdiscard.c;h=a1efa4882aadc9e70297dc167a904c6f898a2f68;hb=7fd676d57355fd26c1127a79d9ba805973928316;hp=fffc0fa81825159f422e95da98b785e052f220f1;hpb=1691e80890e5d8ba258c51c214a3e91880e1db2b;p=mmh diff --git a/sbr/discard.c b/sbr/discard.c index fffc0fa..a1efa48 100644 --- a/sbr/discard.c +++ b/sbr/discard.c @@ -2,56 +2,25 @@ /* * discard.c -- discard output on a file pointer * - * $Id$ + * This code is Copyright (c) 2002, by the authors of nmh. See the + * COPYRIGHT file in the root directory of the nmh distribution for + * complete copyright information. */ #include -#ifdef HAVE_TERMIOS_H -# include -#else -# ifdef HAVE_TERMIO_H -# include -# else -# include -# endif -#endif - -#ifdef SCO_5_STDIO -# define _ptr __ptr -# define _cnt __cnt -# define _base __base -# define _filbuf(fp) ((fp)->__cnt = 0, __filbuf(fp)) -#endif +#include void discard (FILE *io) { -#ifndef HAVE_TERMIOS_H -# ifdef HAVE_TERMIO_H - struct termio tio; -# else - struct sgttyb tio; -# endif -#endif - if (io == NULL) return; -#ifdef HAVE_TERMIOS_H tcflush (fileno(io), TCOFLUSH); -#else -# ifdef HAVE_TERMIO_H - if (ioctl (fileno(io), TCGETA, &tio) != -1) - ioctl (fileno(io), TCSETA, &tio); -# else - if (ioctl (fileno(io), TIOCGETP, (char *) &tio) != -1) - ioctl (fileno(io), TIOCSETP, (char *) &tio); -# endif -#endif -#ifdef _FSTDIO +#if defined(_FSTDIO) || defined(__DragonFly__) fpurge (io); #else # ifdef LINUX_STDIO