亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? main.c

?? STEVIE文本文件編緝器的C 語言源程序
?? C
字號:
/* $Header: /nw2/tony/src/stevie/src/RCS/main.c,v 1.12 89/08/02 19:53:27 tony Exp $
 *
 * The main routine and routines to deal with the input buffer.
 */

#include "stevie.h"

int Rows;		/* Number of Rows and Columns */
int Columns;		/* in the current window. */

char *Realscreen = NULL;	/* What's currently on the screen, a single */
				/* array of size Rows*Columns. */
char *Nextscreen = NULL;	/* What's to be put on the screen. */

char *Filename = NULL;	/* Current file name */

LPTR *Filemem;		/* Pointer to the first line of the file */

LPTR *Filetop;		/* Line 'above' the start of the file */

LPTR *Fileend;		/* Pointer to the end of the file in Filemem. */
			/* (It points to the byte AFTER the last byte.) */

LPTR *Topchar;		/* Pointer to the byte in Filemem which is */
			/* in the upper left corner of the screen. */

LPTR *Botchar;		/* Pointer to the byte in Filemem which is */
			/* just off the bottom of the screen. */

LPTR *Curschar;		/* Pointer to byte in Filemem at which the */
			/* cursor is currently placed. */

int Cursrow, Curscol;	/* Current position of cursor */

int Cursvcol;		/* Current virtual column, the column number of */
			/* the file's actual line, as opposed to the */
			/* column number we're at on the screen.  This */
			/* makes a difference on lines that span more */
			/* than one screen line. */

int Curswant = 0;	/* The column we'd like to be at. This is used */
			/* try to stay in the same column through up/down */
			/* cursor motions. */

bool_t set_want_col;	/* If set, then update Curswant the next time */
			/* through cursupdate() to the current virtual */
			/* column. */

int State = NORMAL;	/* This is the current state of the command */
			/* interpreter. */

int Prenum = 0;		/* The (optional) number before a command. */

LPTR *Insstart;		/* This is where the latest insert/append */
			/* mode started. */

bool_t Changed = 0;	/* Set to 1 if something in the file has been */
			/* changed and not written out. */

char Redobuff[1024];	/* Each command should stuff characters into this */
			/* buffer that will re-execute itself. */

char Insbuff[1024];	/* Each insertion gets stuffed into this buffer. */

int Ninsert = 0;	/* Number of characters in the current insertion. */
char *Insptr = NULL;

bool_t	got_int=FALSE;	/* set to TRUE when an interrupt occurs (if possible) */

bool_t	interactive = FALSE;	/* set TRUE when main() is ready to roll */

char **files;		/* list of input files */
int  numfiles;		/* number of input files */
int  curfile;		/* number of the current file */

static void
usage()
{
	fprintf(stderr, "usage: stevie [file ...]\n");
	fprintf(stderr, "       stevie -t tag\n");
	fprintf(stderr, "       stevie +[num] file\n");
	fprintf(stderr, "       stevie +/pat  file\n");
	exit(1);
}

main(argc,argv)
int	argc;
char	*argv[];
{
	char	*initstr, *getenv();	/* init string from the environment */
	char	*tag = NULL;		/* tag from command line */
	char	*pat = NULL;		/* pattern from command line */
	int	line = -1;		/* line number from command line */

	/*
	 * Process the command line arguments.
	 */
	if (argc > 1) {
		switch (argv[1][0]) {
		
		case '-':			/* -t tag */
			if (argv[1][1] != 't')
				usage();

			if (argv[2] == NULL)
				usage();

			Filename = NULL;
			tag = argv[2];
			numfiles = 1;
			break;

		case '+':			/* +n or +/pat */
			if (argv[1][1] == '/') {
				if (argv[2] == NULL)
					usage();
				Filename = strsave(argv[2]);
				pat = &(argv[1][1]);
				numfiles = 1;

			} else if (isdigit(argv[1][1]) || argv[1][1] == NUL) {
				if (argv[2] == NULL)
					usage();
				Filename = strsave(argv[2]);
				numfiles = 1;

				line = (isdigit(argv[1][1])) ?
					atoi(&(argv[1][1])) : 0;
			} else
				usage();

			break;

		default:			/* must be a file name */
			Filename = strsave(argv[1]);
			files = &(argv[1]);
			numfiles = argc - 1;
			break;
		}
	} else {
		Filename = NULL;
		numfiles = 1;
	}
	curfile = 0;

 	if (numfiles > 1)
 		fprintf(stderr, "%d files to edit\n", numfiles);
 
	windinit();

	/*
	 * Allocate LPTR structures for all the various position pointers
	 */
 	if ((Filemem = (LPTR *) malloc(sizeof(LPTR))) == NULL ||
 	    (Filetop = (LPTR *) malloc(sizeof(LPTR))) == NULL ||
 	    (Fileend = (LPTR *) malloc(sizeof(LPTR))) == NULL ||
 	    (Topchar = (LPTR *) malloc(sizeof(LPTR))) == NULL ||
 	    (Botchar = (LPTR *) malloc(sizeof(LPTR))) == NULL ||
 	    (Curschar = (LPTR *) malloc(sizeof(LPTR))) == NULL ||
 	    (Insstart = (LPTR *) malloc(sizeof(LPTR))) == NULL ) {
		fprintf(stderr, "Can't allocate data structures\n");
		windexit(0);
	}

	screenalloc();
	filealloc();		/* Initialize Filemem, Filetop, and Fileend */

	screenclear();

	if ((initstr = getenv("EXINIT")) != NULL) {
		char *lp, buf[128];

		if ((lp = getenv("LINES")) != NULL) {
			sprintf(buf, "%s lines=%s", initstr, lp);
			docmdln(buf);
		} else
			docmdln(initstr);
	}

	if (Filename != NULL) {
		if (readfile(Filename, Filemem, FALSE))
			filemess("[New File]");
	} else if (tag == NULL)
		msg("Empty Buffer");

	setpcmark();

	if (tag) {
		stuffin(":ta ");
		stuffin(tag);
		stuffin("\n");

	} else if (pat) {
		stuffin(pat);
		stuffin("\n");

	} else if (line >= 0) {
		if (line > 0)
			stuffnum(line);
		stuffin("G");
	}

	interactive = TRUE;

	edit();

	windexit(0);

	return 1;		/* shouldn't be reached */
}

#define	RBSIZE	1024
static char getcbuff[RBSIZE];
static char *getcnext = NULL;

void
stuffin(s)
char	*s;
{
	if (s == NULL) {		/* clear the stuff buffer */
		getcnext = NULL;
		return;
	}

	if (getcnext == NULL) {
		strcpy(getcbuff,s);
		getcnext = getcbuff;
	} else
		strcat(getcbuff,s);
}

void
stuffnum(n)
int	n;
{
	char	buf[32];

	sprintf(buf, "%d", n);
	stuffin(buf);
}

int
vgetc()
{
	register int	c;

	/*
	 * inchar() may map special keys by using stuffin(). If it does
	 * so, it returns -1 so we know to loop here to get a real char.
	 */
	do {
		if ( getcnext != NULL ) {
			int nextc = *getcnext++;
			if ( *getcnext == NUL ) {
				*getcbuff = NUL;
				getcnext = NULL;
			}
			return(nextc);
		}
		c = inchar();
	} while (c == -1);

	return c;
}

/*
 * anyinput
 *
 * Return non-zero if input is pending.
 */

bool_t
anyinput()
{
	return (getcnext != NULL);
}

/*
 * do_mlines() - process mode lines for the current file
 *
 * Returns immediately if the "ml" parameter isn't set.
 */
#define	NMLINES	5	/* no. of lines at start/end to check for modelines */

void
do_mlines()
{
	void	chk_mline();
	int	i;
	register LPTR	*p;

	if (!P(P_ML))
		return;

	p = Filemem;
	for (i=0; i < NMLINES ;i++) {
		chk_mline(p->linep->s);
		if ((p = nextline(p)) == NULL)
			break;
	}

	if ((p = prevline(Fileend)) == NULL)
		return;

	for (i=0; i < NMLINES ;i++) {
		chk_mline(p->linep->s);
		if ((p = prevline(p)) == NULL)
			break;
	}
}

/*
 * chk_mline() - check a single line for a mode string
 */
static void
chk_mline(s)
register char	*s;
{
	register char	*cs;		/* local copy of any modeline found */
	register char	*e;

	for (; *s != NUL ;s++) {
		if (strncmp(s, "vi:", 3) == 0 || strncmp(s, "ex:", 3) == 0) {
			cs = strsave(s+3);
			if ((e = strchr(cs, ':')) != NULL) {
				*e = NUL;
				stuffin(mkstr(CTRL('o')));
				docmdln(cs);
			}
			free(cs);
		}
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
综合分类小说区另类春色亚洲小说欧美 | 日韩视频在线一区二区| 91蝌蚪porny| 色综合视频在线观看| 91亚洲国产成人精品一区二区三| av影院午夜一区| 色菇凉天天综合网| 欧美在线观看一二区| 欧美高清www午色夜在线视频| 在线不卡免费av| 欧美成人video| 欧美国产一区二区| 亚洲色图制服诱惑 | 免费人成精品欧美精品| 男人的天堂久久精品| 久久不见久久见免费视频7| 91麻豆视频网站| 色狠狠桃花综合| 欧美老人xxxx18| 久久亚洲二区三区| 国产精品久久三| 亚洲午夜一区二区| 久久精品国产亚洲高清剧情介绍| 国产尤物一区二区| 在线视频亚洲一区| 日韩一二在线观看| 中文字幕亚洲欧美在线不卡| 亚洲成人动漫在线观看| 国产在线精品视频| 色婷婷综合久久久中文字幕| 欧美一区二区三区免费观看视频| 国产日韩欧美不卡| 亚洲成人福利片| 风间由美一区二区三区在线观看| 色94色欧美sute亚洲13| 精品女同一区二区| 亚洲综合久久久| 国产风韵犹存在线视精品| 91福利精品第一导航| 久久人人97超碰com| 亚洲成人动漫在线免费观看| 国产电影一区在线| 337p亚洲精品色噜噜噜| 成人免费小视频| 狠狠色丁香婷综合久久| 欧美三级电影在线看| 国产精品久久久久久久久免费丝袜 | 欧美成人免费网站| 一区二区三区国产精品| 成人av在线播放网址| 日韩午夜在线观看| 一区二区视频在线| 暴力调教一区二区三区| 久久综合狠狠综合久久综合88| 亚洲久草在线视频| 成人福利电影精品一区二区在线观看| 欧美一区二区三区视频在线| 亚洲激情五月婷婷| 99久精品国产| 国产日韩成人精品| 极品少妇xxxx精品少妇| 日韩精品一区二区三区在线观看 | 国产精品国产三级国产有无不卡 | 亚洲一区二区三区激情| 成人精品视频网站| 国产亚洲人成网站| 国产酒店精品激情| 欧美大度的电影原声| 日韩精品欧美成人高清一区二区| 色综合天天综合狠狠| 亚洲视频一区二区在线观看| 成人黄色在线网站| 中文字幕av资源一区| 国产精品系列在线观看| 国产色婷婷亚洲99精品小说| 国产精品一区二区免费不卡| 精品不卡在线视频| 国产精品白丝av| 国产亚洲1区2区3区| 成人激情小说网站| 亚洲欧美日韩综合aⅴ视频| 91麻豆国产福利在线观看| 亚洲人快播电影网| 欧美三级在线播放| 日本va欧美va欧美va精品| 日韩精品一区二区三区swag| 国产一区二区成人久久免费影院 | 欧美一个色资源| 久久国产人妖系列| 日本一区二区视频在线| 成人听书哪个软件好| 亚洲精品成人精品456| 欧美日韩精品专区| 久久精品国产成人一区二区三区| 91精品欧美一区二区三区综合在 | 国产色产综合色产在线视频| 成人高清视频免费观看| 亚洲国产毛片aaaaa无费看| 日韩亚洲欧美中文三级| 成人综合婷婷国产精品久久蜜臀 | 久久久国产精品不卡| 成a人片国产精品| 亚洲国产日韩一级| 久久婷婷成人综合色| 91麻豆6部合集magnet| 日韩福利视频网| 国产性色一区二区| 欧美日韩一级大片网址| 国产一区二三区| 亚洲最大成人综合| 久久综合九色综合久久久精品综合| 成人性生交大片免费看在线播放| 一区二区三区四区在线播放 | 国产麻豆精品一区二区| 亚洲男同性视频| 精品国产91久久久久久久妲己 | 国产精品18久久久久久久网站| 亚洲女同ⅹxx女同tv| 精品国产髙清在线看国产毛片| 一本大道av伊人久久综合| 久久国产尿小便嘘嘘| 亚洲香蕉伊在人在线观| 国产精品美女久久久久久2018| 欧美精品免费视频| 一本大道久久a久久精品综合 | 国产精品每日更新| 日韩一区二区电影在线| 欧美自拍偷拍午夜视频| 成人高清视频在线观看| 国产在线一区二区| 日韩成人免费电影| 亚洲一区二区三区四区五区黄| 国产视频在线观看一区二区三区| 日韩一区二区三区电影| 91麻豆精品国产91久久久资源速度| 99久久精品一区二区| 成人黄色综合网站| 国产大陆a不卡| 国产毛片一区二区| 久久91精品国产91久久小草| 日本中文字幕一区二区有限公司| 一区二区三区.www| 一区二区三区在线看| 亚洲乱码精品一二三四区日韩在线| 日本一区二区三区在线观看| 久久亚洲一级片| 久久蜜桃av一区精品变态类天堂 | proumb性欧美在线观看| 国产激情视频一区二区在线观看| 蜜臀av亚洲一区中文字幕| 美女精品自拍一二三四| 日本不卡不码高清免费观看| 三级欧美在线一区| 日韩电影在线观看网站| 久久精品国产一区二区| 国产综合成人久久大片91| 国产一区二区视频在线播放| 韩日av一区二区| 国产成人精品一区二区三区四区| 激情综合网av| 大桥未久av一区二区三区中文| 成人污视频在线观看| 91国产丝袜在线播放| 91黄色小视频| 91精品国产aⅴ一区二区| 日韩欧美国产综合一区| 日韩美一区二区三区| 国产欧美一区二区三区在线老狼| 欧美激情一区在线观看| 亚洲日穴在线视频| 亚洲成av人片一区二区三区| 蜜桃精品视频在线观看| 国产成人精品亚洲777人妖| gogo大胆日本视频一区| 欧美日本在线播放| 精品乱人伦小说| 综合自拍亚洲综合图不卡区| 婷婷一区二区三区| 国产99精品国产| 欧美三级韩国三级日本三斤| 精品电影一区二区三区| ...av二区三区久久精品| 午夜天堂影视香蕉久久| 激情六月婷婷久久| 99国产精品久久久久| 717成人午夜免费福利电影| 久久婷婷久久一区二区三区| 亚洲制服欧美中文字幕中文字幕| 蜜桃av一区二区| 日本高清不卡在线观看| 精品日产卡一卡二卡麻豆| 中文字幕制服丝袜成人av | 丁香婷婷综合色啪| 欧美色视频一区| 亚洲国产精品成人综合色在线婷婷| 亚洲高清视频的网址| 成人免费高清视频在线观看| 88在线观看91蜜桃国自产| 成人欧美一区二区三区小说| 激情小说亚洲一区|