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

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

?? histedit.c

?? Android 一些工具
?? C
字號:
/*	$NetBSD: histedit.c,v 1.34 2003/10/27 06:19:29 lukem Exp $	*//*- * Copyright (c) 1993 *	The Regents of the University of California.  All rights reserved. * * This code is derived from software contributed to Berkeley by * Kenneth Almquist. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors *    may be used to endorse or promote products derived from this software *    without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */#include <sys/cdefs.h>#ifndef lint#if 0static char sccsid[] = "@(#)histedit.c	8.2 (Berkeley) 5/4/95";#else__RCSID("$NetBSD: histedit.c,v 1.34 2003/10/27 06:19:29 lukem Exp $");#endif#endif /* not lint */#include <sys/param.h>#include <paths.h>#include <stdio.h>#include <stdlib.h>#include <unistd.h>/* * Editline and history functions (and glue). */#include "shell.h"#include "parser.h"#include "var.h"#include "options.h"#include "main.h"#include "output.h"#include "mystring.h"#include "myhistedit.h"#include "error.h"#ifndef SMALL#include "eval.h"#include "memalloc.h"#define MAXHISTLOOPS	4	/* max recursions through fc */#define DEFEDITOR	"ed"	/* default editor *should* be $EDITOR */History *hist;	/* history cookie */EditLine *el;	/* editline cookie */int displayhist;static FILE *el_in, *el_out;STATIC const char *fc_replace(const char *, char *, char *);#ifdef DEBUGextern FILE *tracefile;#endif/* * Set history and editing status.  Called whenever the status may * have changed (figures out what to do). */voidhistedit(void){	FILE *el_err;#define editing (Eflag || Vflag)	if (iflag) {		if (!hist) {			/*			 * turn history on			 */			INTOFF;			hist = history_init();			INTON;			if (hist != NULL)				sethistsize(histsizeval());			else				out2str("sh: can't initialize history\n");		}		if (editing && !el && isatty(0)) { /* && isatty(2) ??? */			/*			 * turn editing on			 */			char *term, *shname;			INTOFF;			if (el_in == NULL)				el_in = fdopen(0, "r");			if (el_out == NULL)				el_out = fdopen(2, "w");			if (el_in == NULL || el_out == NULL)				goto bad;			el_err = el_out;#if DEBUG			if (tracefile)				el_err = tracefile;#endif			term = lookupvar("TERM");			if (term)				setenv("TERM", term, 1);			else				unsetenv("TERM");			shname = arg0;			if (shname[0] == '-')				shname++;			el = el_init(shname, el_in, el_out, el_err);			if (el != NULL) {				if (hist)					el_set(el, EL_HIST, history, hist);				el_set(el, EL_PROMPT, getprompt);				el_set(el, EL_SIGNAL, 1);			} else {bad:				out2str("sh: can't initialize editing\n");			}			INTON;		} else if (!editing && el) {			INTOFF;			el_end(el);			el = NULL;			INTON;		}		if (el) {			if (Vflag)				el_set(el, EL_EDITOR, "vi");			else if (Eflag)				el_set(el, EL_EDITOR, "emacs");			el_source(el, NULL);		}	} else {		INTOFF;		if (el) {	/* no editing if not interactive */			el_end(el);			el = NULL;		}		if (hist) {			history_end(hist);			hist = NULL;		}		INTON;	}}voidsethistsize(const char *hs){	int histsize;	HistEvent he;	if (hist != NULL) {		if (hs == NULL || *hs == '\0' ||		   (histsize = atoi(hs)) < 0)			histsize = 100;		history(hist, &he, H_SETSIZE, histsize);	}}voidsetterm(const char *term){	if (el != NULL && term != NULL)		if (el_set(el, EL_TERMINAL, term) != 0) {			outfmt(out2, "sh: Can't set terminal type %s\n", term);			outfmt(out2, "sh: Using dumb terminal settings.\n");		}}intinputrc(argc, argv)	int argc;	char **argv;{	if (argc != 2) {		out2str("usage: inputrc file\n");		return 1;	}	if (el != NULL) {		if (el_source(el, argv[1])) {			out2str("inputrc: failed\n");			return 1;		} else			return 0;	} else {		out2str("sh: inputrc ignored, not editing\n");		return 1;	}}/* *  This command is provided since POSIX decided to standardize *  the Korn shell fc command.  Oh well... */inthistcmd(int argc, char **argv){	int ch;	const char *editor = NULL;	HistEvent he;	int lflg = 0, nflg = 0, rflg = 0, sflg = 0;	int i, retval;	const char *firststr, *laststr;	int first, last, direction;	char *pat = NULL, *repl;	/* ksh "fc old=new" crap */	static int active = 0;	struct jmploc jmploc;	struct jmploc *volatile savehandler;	char editfile[MAXPATHLEN + 1];	FILE *efp;#ifdef __GNUC__	/* Avoid longjmp clobbering */	(void) &editor;	(void) &lflg;	(void) &nflg;	(void) &rflg;	(void) &sflg;	(void) &firststr;	(void) &laststr;	(void) &pat;	(void) &repl;	(void) &efp;	(void) &argc;	(void) &argv;#endif	if (hist == NULL)		error("history not active");	if (argc == 1)		error("missing history argument");	optreset = 1; optind = 1; /* initialize getopt */	while (not_fcnumber(argv[optind]) &&	      (ch = getopt(argc, argv, ":e:lnrs")) != -1)		switch ((char)ch) {		case 'e':			editor = optionarg;			break;		case 'l':			lflg = 1;			break;		case 'n':			nflg = 1;			break;		case 'r':			rflg = 1;			break;		case 's':			sflg = 1;			break;		case ':':			error("option -%c expects argument", optopt);			/* NOTREACHED */		case '?':		default:			error("unknown option: -%c", optopt);			/* NOTREACHED */		}	argc -= optind, argv += optind;	/*	 * If executing...	 */	if (lflg == 0 || editor || sflg) {		lflg = 0;	/* ignore */		editfile[0] = '\0';		/*		 * Catch interrupts to reset active counter and		 * cleanup temp files.		 */		if (setjmp(jmploc.loc)) {			active = 0;			if (*editfile)				unlink(editfile);			handler = savehandler;			longjmp(handler->loc, 1);		}		savehandler = handler;		handler = &jmploc;		if (++active > MAXHISTLOOPS) {			active = 0;			displayhist = 0;			error("called recursively too many times");		}		/*		 * Set editor.		 */		if (sflg == 0) {			if (editor == NULL &&			    (editor = bltinlookup("FCEDIT", 1)) == NULL &&			    (editor = bltinlookup("EDITOR", 1)) == NULL)				editor = DEFEDITOR;			if (editor[0] == '-' && editor[1] == '\0') {				sflg = 1;	/* no edit */				editor = NULL;			}		}	}	/*	 * If executing, parse [old=new] now	 */	if (lflg == 0 && argc > 0 &&	     ((repl = strchr(argv[0], '=')) != NULL)) {		pat = argv[0];		*repl++ = '\0';		argc--, argv++;	}	/*	 * determine [first] and [last]	 */	switch (argc) {	case 0:		firststr = lflg ? "-16" : "-1";		laststr = "-1";		break;	case 1:		firststr = argv[0];		laststr = lflg ? "-1" : argv[0];		break;	case 2:		firststr = argv[0];		laststr = argv[1];		break;	default:		error("too many args");		/* NOTREACHED */	}	/*	 * Turn into event numbers.	 */	first = str_to_event(firststr, 0);	last = str_to_event(laststr, 1);	if (rflg) {		i = last;		last = first;		first = i;	}	/*	 * XXX - this should not depend on the event numbers	 * always increasing.  Add sequence numbers or offset	 * to the history element in next (diskbased) release.	 */	direction = first < last ? H_PREV : H_NEXT;	/*	 * If editing, grab a temp file.	 */	if (editor) {		int fd;		INTOFF;		/* easier */		snprintf(editfile, sizeof(editfile), "%s_shXXXXXX", _PATH_TMP);		if ((fd = mkstemp(editfile)) < 0)			error("can't create temporary file %s", editfile);		if ((efp = fdopen(fd, "w")) == NULL) {			close(fd);			error("can't allocate stdio buffer for temp");		}	}	/*	 * Loop through selected history events.  If listing or executing,	 * do it now.  Otherwise, put into temp file and call the editor	 * after.	 *	 * The history interface needs rethinking, as the following	 * convolutions will demonstrate.	 */	history(hist, &he, H_FIRST);	retval = history(hist, &he, H_NEXT_EVENT, first);	for (;retval != -1; retval = history(hist, &he, direction)) {		if (lflg) {			if (!nflg)				out1fmt("%5d ", he.num);			out1str(he.str);		} else {			const char *s = pat ?			   fc_replace(he.str, pat, repl) : he.str;			if (sflg) {				if (displayhist) {					out2str(s);				}				evalstring(strcpy(stalloc(strlen(s) + 1), s), 0);				if (displayhist && hist) {					/*					 *  XXX what about recursive and					 *  relative histnums.					 */					history(hist, &he, H_ENTER, s);				}			} else				fputs(s, efp);		}		/*		 * At end?  (if we were to lose last, we'd sure be		 * messed up).		 */		if (he.num == last)			break;	}	if (editor) {		char *editcmd;		fclose(efp);		editcmd = stalloc(strlen(editor) + strlen(editfile) + 2);		sprintf(editcmd, "%s %s", editor, editfile);		evalstring(editcmd, 0);	/* XXX - should use no JC command */		INTON;		readcmdfile(editfile);	/* XXX - should read back - quick tst */		unlink(editfile);	}	if (lflg == 0 && active > 0)		--active;	if (displayhist)		displayhist = 0;	return 0;}STATIC const char *fc_replace(const char *s, char *p, char *r){	char *dest;	int plen = strlen(p);	STARTSTACKSTR(dest);	while (*s) {		if (*s == *p && strncmp(s, p, plen) == 0) {			while (*r)				STPUTC(*r++, dest);			s += plen;			*p = '\0';	/* so no more matches */		} else			STPUTC(*s++, dest);	}	STACKSTRNUL(dest);	dest = grabstackstr(dest);	return (dest);}intnot_fcnumber(char *s){	if (s == NULL)		return 0;        if (*s == '-')                s++;	return (!is_number(s));}intstr_to_event(const char *str, int last){	HistEvent he;	const char *s = str;	int relative = 0;	int i, retval;	retval = history(hist, &he, H_FIRST);	switch (*s) {	case '-':		relative = 1;		/*FALLTHROUGH*/	case '+':		s++;	}	if (is_number(s)) {		i = atoi(s);		if (relative) {			while (retval != -1 && i--) {				retval = history(hist, &he, H_NEXT);			}			if (retval == -1)				retval = history(hist, &he, H_LAST);		} else {			retval = history(hist, &he, H_NEXT_EVENT, i);			if (retval == -1) {				/*				 * the notion of first and last is				 * backwards to that of the history package				 */				retval = history(hist, &he,						last ? H_FIRST : H_LAST);			}		}		if (retval == -1)			error("history number %s not found (internal error)",			       str);	} else {		/*		 * pattern		 */		retval = history(hist, &he, H_PREV_STR, str);		if (retval == -1)			error("history pattern not found: %s", str);	}	return (he.num);}#elseinthistcmd(int argc, char **argv){	error("not compiled with history support");	/* NOTREACHED */}intinputrc(int argc, char **argv){	error("not compiled with history support");	/* NOTREACHED */}#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
www亚洲一区| 婷婷丁香久久五月婷婷| 偷拍自拍另类欧美| 国产成人午夜精品影院观看视频| 色悠悠亚洲一区二区| 久久蜜桃香蕉精品一区二区三区| 亚洲777理论| 一本一道综合狠狠老| 国产女主播在线一区二区| 丝袜脚交一区二区| 色综合久久久久综合99| 欧美国产一区二区在线观看| 男女男精品视频| 欧美视频你懂的| 一区二区三区欧美亚洲| 99精品欧美一区二区三区综合在线| 精品久久免费看| 久久精品国产999大香线蕉| 欧美日韩高清在线| 亚洲一区二区美女| 欧美曰成人黄网| 成人欧美一区二区三区小说 | 国产精品天美传媒| 国产成人在线看| 久久久久国产精品麻豆ai换脸| 免费高清在线视频一区·| 在线成人av影院| 三级久久三级久久| 日韩三级免费观看| 国产美女一区二区| 国产精品色婷婷| 99re6这里只有精品视频在线观看| 日本一区二区三区四区在线视频 | 色综合久久久久综合| 自拍偷自拍亚洲精品播放| 成人国产精品免费观看视频| 国产精品免费av| 一本色道亚洲精品aⅴ| 亚洲激情av在线| 欧美夫妻性生活| 国产一区视频网站| 欧美高清一级片在线观看| av中文一区二区三区| 亚洲在线一区二区三区| 欧美日韩国产一区二区三区地区| 日韩精品电影在线| 欧美成人在线直播| 成人免费看的视频| 亚洲一区影音先锋| 日韩欧美黄色影院| www.亚洲人| 亚洲成精国产精品女| 精品盗摄一区二区三区| 成人黄色国产精品网站大全在线免费观看 | 97国产精品videossex| 亚洲一区二区成人在线观看| 欧美一区二区三区免费观看视频 | 亚洲亚洲人成综合网络| 美女精品自拍一二三四| 欧美一级日韩一级| 久久99久久99| 日韩理论片网站| 欧美日韩aaa| 国产精品一级片| 亚洲综合成人在线| 亚洲精品在线免费观看视频| 国产成人av一区二区三区在线观看| 国产精品伦理一区二区| 欧美日韩国产免费| 粉嫩aⅴ一区二区三区四区五区| 亚洲免费观看在线视频| 亚洲精品一区在线观看| 日本韩国欧美国产| 国产一区二区三区最好精华液 | 91精品国产综合久久福利软件| 国产乱码精品一区二区三区av | 色哟哟亚洲精品| 加勒比av一区二区| 一区二区三区精品在线观看| 精品国产一区二区三区忘忧草| 色综合欧美在线| 国产很黄免费观看久久| 日韩高清欧美激情| 亚洲日韩欧美一区二区在线| 精品国产一区二区三区久久久蜜月| 91久久香蕉国产日韩欧美9色| 国产精品一区二区在线观看不卡| 亚洲最快最全在线视频| 欧美国产视频在线| 欧美v国产在线一区二区三区| 欧洲一区在线电影| 成年人国产精品| 国产九色精品成人porny| 日本亚洲电影天堂| 亚洲成人av电影| 亚洲综合小说图片| 亚洲视频一二三区| 国产精品久久久久久一区二区三区 | 欧美一区二区三区免费观看视频| 一本大道久久a久久精二百| 国产福利不卡视频| 国产精品18久久久久久vr| 免费成人小视频| 日韩av电影免费观看高清完整版| 亚洲男人的天堂在线aⅴ视频| 亚洲国产精品精华液2区45| 久久九九99视频| 国产免费成人在线视频| 日本一区二区三区在线观看| 日本一区二区免费在线| 国产精品天美传媒| 日韩一区欧美小说| 中文字幕中文乱码欧美一区二区| 日韩视频在线你懂得| 在线欧美小视频| 亚洲一区二区三区视频在线播放 | 91免费看片在线观看| a在线欧美一区| 99视频一区二区| 色综合天天综合网天天看片| 91女厕偷拍女厕偷拍高清| 91欧美一区二区| 欧美日韩性生活| 日韩精品一区国产麻豆| 精品精品国产高清a毛片牛牛| 欧美成人在线直播| 中文字幕精品综合| 亚洲丝袜另类动漫二区| 午夜久久电影网| 久久99国产精品久久99| 国产成人精品一区二| 91视视频在线观看入口直接观看www | 国产精品久久免费看| 日韩一区欧美一区| 午夜国产精品一区| 国内精品写真在线观看| 国产99久久久精品| 色狠狠色狠狠综合| 69久久夜色精品国产69蝌蚪网| 91精品在线麻豆| 久久精品无码一区二区三区| 亚洲三级电影全部在线观看高清| 亚洲电影一区二区三区| 麻豆91在线观看| www.性欧美| 91精品国产综合久久香蕉的特点| 久久精品人人爽人人爽| 依依成人综合视频| 国产一区91精品张津瑜| 色综合久久中文综合久久97| 91麻豆精品国产91久久久久| 亚洲精品在线电影| 亚洲综合一区二区精品导航| 激情久久久久久久久久久久久久久久| 成人a免费在线看| 欧美一区二区精品久久911| 中文字幕在线不卡一区| 蜜桃精品视频在线观看| 色综合色综合色综合| 久久亚洲捆绑美女| 午夜精品一区二区三区免费视频| 成人一区二区三区中文字幕| 欧美日韩亚洲另类| 中文字幕日韩一区二区| 黑人巨大精品欧美黑白配亚洲| 91成人网在线| 成人免费在线播放视频| 捆绑调教一区二区三区| 欧美日韩高清一区| 亚洲黄色在线视频| av不卡一区二区三区| 26uuu色噜噜精品一区| 日韩综合小视频| 欧美日韩在线观看一区二区| 国产精品卡一卡二卡三| 国产伦精品一区二区三区免费迷 | 亚洲激情五月婷婷| 岛国一区二区在线观看| 欧美成人精品高清在线播放| 亚洲精品国产第一综合99久久| 国产成人精品午夜视频免费 | 美腿丝袜一区二区三区| 欧美日韩久久久久久| 亚洲免费av高清| 91丨porny丨蝌蚪视频| 国产精品丝袜久久久久久app| 韩国成人在线视频| www亚洲一区| 国产精品一区免费在线观看| 欧美精品一区二区在线观看| 久久精品国产99| 欧美电影免费观看完整版| 日本午夜一本久久久综合| 欧美日韩亚洲国产综合| 亚洲成av人在线观看| 欧美日韩视频一区二区| 日日骚欧美日韩| 欧美tk—视频vk| 国产精品自拍av| 国产欧美日韩亚州综合|