verify.c

来自「teco编辑器源码」· C语言 代码 · 共 45 行

C
45
字号
#include <ctype.h>
#include <stdio.h>
#include <string.h>

verify()
{
#include "teco.h"

	int tmp;				/* First  scratch */
	int wrk;				/* Second scratch */

	number=abs(number);			/* Take magnitude */
	tmp=bufptx;				/* Save temporary */
	wrk=number;				/* Save   counter */
	while (1) {				/* Position back  */
		if (!tmp) goto type;		/* Scan back line */
		if (toascii(buffer[--tmp]) == 13) {
			if (! --wrk) {
				if (toascii(buffer[tmp+1]) == 10){
					tmp++;
				}
				goto type;
			}
		}
	}
type:	wrk=bufptx;				/* Save  context  */
	while (1) {				/* Position front */
		if (wrk > bufptr) {		/* Type out stuff */
			while (++tmp < wrk) {
				echo(buffer[tmp]);
			}
			return;		/* all done  type */
		}
		if (toascii(buffer[++wrk]) == 13) {
			if (toascii(buffer[tmp]) == 10) ++wrk;
			if (! --number) {
				while (tmp++ < wrk) {
					echo(buffer[tmp]);
				}
				return;
			}
		}
	}
}

⌨️ 快捷键说明

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