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

📄 line.c

📁 早期freebsd实现
💻 C
字号:
/*	@(#)line.c	1.1	*//*	This program reads a single line from the standard input	and writes it on the standard output. It is probably most useful	in conjunction with the Bourne shell.*/#define LSIZE 512int EOF;char nl = '\n';main(){	register char c;	char line[LSIZE];	register char *linep, *linend;EOF = 0;linep = line;linend = line + LSIZE;while ((c = readc()) != nl)	{	if (linep == linend)		{		write (1, line, LSIZE);		linep = line;		}	*linep++ = c;	}write (1, line, linep-line);write(1,&nl,1);if (EOF == 1) exit(1);exit (0);}readc(){	char c;if (read (0, &c, 1) != 1) {	EOF = 1;	return(nl);	}else	return (c);}

⌨️ 快捷键说明

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