4.form.c

来自「unix v7是最后一个广泛发布的研究型UNIX版本」· C语言 代码 · 共 114 行

C
114
字号
#include <stdio.h>##include "def.h"#include "4.def.h"extern int linechars;extern int rdfree(), comfree(), labfree(), contfree();extern int rdstand(), comstand(), labstand(), contstand();extern int (*rline[])();extern int (*comment[])();extern int (*getlabel[])();extern int (*chkcont[])();null(c)char c;	{return;}comprint()	{	int c, blank, first,count;	blank = 1;	first = 1;	count = 0;	while ((c = (*comment[inputform])(0) ) || blankline() )		{		++count;		if (c)			{			(*comment[inputform])(1);		/* move head past comment signifier */			blank = blankline();			/* if (first && !blank)				OUTSTR("#\n");*/			prline("#");			first = 0;			}		else			(*rline[inputform])(null);		}	/* if (!blank) 		OUTSTR("#\n"); */	return(count);	}prcode(linecount,tab)int linecount, tab;	{	int someout;	someout = FALSE;	while (linecount)		{		if ( (*comment[inputform])(0) )			{			linecount -= comprint();			someout = TRUE;			continue;			}		else if (blankline() )			(*rline[inputform])(null);		else if ((*chkcont[inputform])() )			{			TABOVER(tab);			prline("&");			someout  = TRUE;			}		else 			{if (someout) TABOVER(tab);			(*getlabel[inputform])(null);			prline("");			someout=TRUE;			}		--linecount;		}	}charout(c)char c;	{	putc(c,outfd);	}prline(str)char *str;	{	fprintf(outfd,"%s",str);	(*rline[inputform]) (charout);	putc('\n',outfd);	}input2()	{	static int c;	c = inchar();	if (c == '\n')		linechars = 0;	else		++linechars;	return(c);	}unput2(c)int c;	{	unchar(c);	--linechars;	return(c);	}

⌨️ 快捷键说明

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