⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 discard.c

📁 早期freebsd实现
💻 C
字号:
/* discard.c - discard output on a file pointer */#ifndef	lintstatic char ident[] = "@(#)$Id: discard.c,v 1.7 1993/02/26 21:56:04 jromine Exp $";#endif	/* lint */#include "../h/mh.h"#include <stdio.h>#ifdef POSIX#include <termios.h>#else#ifndef	SYS5#include <sgtty.h>#else	/* SYS5 */#include <sys/types.h>#include <termio.h>#ifndef	NOIOCTLH#include <sys/ioctl.h>#endif	/* NOIOCTLH */#endif	/* SYS5 */#endif	/* POSIX */void	discard (io)FILE   *io;{#ifndef POSIX#ifndef	SYS5    struct sgttyb   sg;#else	/* SYS5 */    struct termio   sg;#endif	/* SYS5 */#endif	/* POSIX */    if (io == NULL)	return;#ifdef POSIX    tcflush (fileno (io), TCOFLUSH);#else#ifndef	SYS5    if (ioctl (fileno (io), TIOCGETP, (char *) &sg) != NOTOK)	(void) ioctl (fileno (io), TIOCSETP, (char *) &sg);#else	/* SYS5 */    if (ioctl (fileno (io), TCGETA, &sg) != NOTOK)	(void) ioctl (fileno (io), TCSETA, &sg);#endif	/* SYS5 */#endif	/* POSIX */#ifdef _FSTDIO    fpurge (io);#else    if (io -> _ptr = io -> _base)	io -> _cnt = 0;#endif}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -