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

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

?? readline.c

?? 微軟的基于HMM的人臉識別原代碼, 非常經典的說
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* GNUPLOT - readline.c */
/*
 * Copyright (C) 1986 - 1993   Thomas Williams, Colin Kelley
 *
 * Permission to use, copy, and distribute this software and its
 * documentation for any purpose with or without fee is hereby granted, 
 * provided that the above copyright notice appear in all copies and 
 * that both that copyright notice and this permission notice appear 
 * in supporting documentation.
 *
 * Permission to modify the software is granted, but not the right to
 * distribute the modified code.  Modifications are to be distributed 
 * as patches to released version.
 *  
 * This software is provided "as is" without express or implied warranty.
 * 
 *
 * AUTHORS
 *
 *   Original Software:
 *     Tom Tkacik
 *
 * HISTORY:
 *   Enhancements:
 *     Gershon Elber and many others.
 *
 *   Ed Breen (Jun 10 08:11:14 EST 1996)
 *     Stripped down: EiC port.
 *     Added standalone capability -- for testing and experimenting:
 *        To make the stand alone version of readline:
 *            gcc -D_STANDALONE -Wall -o readline readline.c
 *     Added a limiter to the history recording mechanism:
 *        The default limit means that only the last 500 lines 
 *        can be recalled. This can be set via the macro _HistLimit.
 *        Note, by setting _HistLimit to 0, effectively turns  off the
 *        limiter; that is,
 *          gcc -D_STANDALONE -D_HistLimit=0 -Wall -o readline readline.c
 *     Added tab recognition -- no, not file completion.
 *     Added show_history.
 *            void EiC_show_history(FILE *fp)
 *               outputs the history list to stream fp.
 *            last_history.
 *              returns a pointer to the last entered string in the history
 *              list. Will return NULL if no entry exists.
 *              Do not attempt to free this space, it is under control
 *              of history.
 *     Added bracket balancing routine:
 *              void backupTo(char to, char from);
 *     Optimized for speedy cursor movements:     
 *     Tested under:
 *        ultrix, solaris, dec alpha, sunos, linux, irix-5.3, irix-6.x. 
 *   Ed Breen (July 17 1999)
 *       Added win95, win98, NT win32 support
 *   Ed Breen (July 16 2000)
 *       Added DJGPP support
 */

/* a small version of GNU's readline */
/* this is not the BASH or GNU EMACS version of READLINE due to Copyleft 
	restrictions */
/* do not need any terminal capabilities except , */


/* NANO-EMACS line editing facility */
/* printable characters print as themselves (insert not overwrite) */
/* ^A moves to the beginning of the line */
/* ^B moves back a single character */
/* ^E moves to the end of the line */
/* ^F moves forward a single character */
/* ^K kills from current position to the end of line */
/* ^P moves back through history */
/* ^N moves forward through history */
/* ^H and DEL delete the previous character */
/* ^D deletes the current character, or EOF if line is empty */
/* ^L/^R redraw line in case it gets trashed */
/* ^U kills the entire line */
/* ^W kills last word */
/* LF and CR return the entire line regardless of the cursor postition */
/* EOF  with an empty line returns (char *)NULL */

/* all other characters are ignored */

#ifndef NO_READLINE

/*#define _POSIX_SOURCE*/
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
  #include <ctype.h>
  #include <signal.h>
  #include <time.h>

#if defined(WIN32) 

#include <conio.h>
#include <io.h>

# define special_getc() msdos_getch()
static char msdos_getch();

#else

#include <unistd.h> 
#include <termios.h>

#define special_getc() ansi_getc()
static int ansi_getc();

/* watch out for SV4 and BSD+4.3 stuff */
#ifndef  VREPRINT
#define  VREPRINT 18
#endif
#ifndef VWERASE
#define VWERASE 23
#endif
#ifndef SIGTSTP
#define SIGTSTP 26
#endif

#endif

#ifndef CLOCKS_PER_SEC
#define CLOCKS_PER_SEC 1000000
#endif


/* stubbs added by Ed Breen */
#define ralloc(x,y,z) realloc(x,y)
#define alloc(x,y)    malloc(x)
#define int_error(text,code)  {fprintf(stderr,"Fatal error..\n");\
				   fprintf(stderr,"%s\n",text);\
				   fprintf(stderr,"...now exiting to system ...\n");\
				   exit(1);}

#if !defined(WIN32)

static struct termios orig_termio, rl_termio;

/* ULTRIX defines VRPRNT instead of VREPRINT */
#if defined(VRPRNT) && !defined(VREPRINT)
#define VREPRINT VRPRNT
#endif

/* define characters to use with our input character handler */
static char term_chars[NCCS];

static int term_set = 0;	/* =1 if rl_termio set */

#endif


#define MAXBUF	512	/* initial size and increment of input line length */
#define BACKSPACE 0x08	/* ^H */
#define SPACE	' '
#define NEWLINE	'\n'
#define BELL    '\a'
#define TABSTOPS 4       /* number of spaces per tab stop */

struct hist {
	char *line;
	struct hist *prev;
	struct hist *next;
};

static struct hist *history = NULL;      /* no history yet */
static struct hist *EndHist = NULL;      /* end of history list */
static struct hist *cur_entry = NULL;


static char *cur_line;  /* current contents of the line */
static int line_len=0;
static int cur_pos = 0;	/* current position of the cursor */
static int max_pos = 0;	/* maximum character position */
static int HistLineNo = 0;  /* Current Line Number in history list */

static void fix_line  (void)  ;
static void redraw_line  (char *prompt)  ;
static void clear_line  (char *prompt)  ;
static void clear_eoline  (void)  ;
static void copy_line  (char *line)  ;
static void set_termio  (void)  ;
static void reset_termio  (void)  ;
static int ansi_getc  (void)  ;
static void  user_putc  (char ch)  ;
static int user_putsn(char *str, int n)  ;

static void extend_cur_line  (void)  ;
static void backupTo(char to, char from);
static char _BS = BACKSPACE;

#if  defined(WIN32)
#define backspace() _putch(BACKSPACE)
#else
#define backspace()   write(STDIN_FILENO,&_BS,1)
#endif

#define user_puts(x)  user_putsn(x,strlen(x))


void delay(clock_t d)
{
    clock_t et = clock() + d;
    while(et> clock());
}

static void user_putc(char ch)
{
#if defined(WIN32)
	_putch(ch);
#else	
   write(STDIN_FILENO,&ch,1);
#endif

}

static int user_putsn(char *str, int n)
{
	int rv;
#if defined(WIN32)
	for(rv=0;rv<n;rv++)
	    _putch(*str++);
#else
	rv = write(STDIN_FILENO,str,n);
#endif
	return rv;
}

static void extend_cur_line()
{
  char *new_line;

  /* extent input line length */
  new_line=ralloc(cur_line, line_len+MAXBUF, NULL);
  if(!new_line) {
    reset_termio();
    int_error("Can't extend readline length", NO_CARET);
  }
  cur_line=new_line;
  line_len+=MAXBUF;

}

unsigned char * EiC_readline(char *prompt)
{
    
    /* start with a string of MAXBUF chars */
    char * editLine(char *);
    if(line_len!=0) {
		free(cur_line);
		line_len=0;
    }
    
    cur_line=alloc((unsigned long)MAXBUF, "readline");
    line_len=MAXBUF;
    
    /* set the termio so we can do our own input processing */
    set_termio();
    
    /* print the prompt */

    user_puts(prompt);
    cur_line[0] = '\0';
    cur_pos = 0;
    max_pos = 0;
    cur_entry = NULL;
    return editLine(prompt);
}


char * editLine(char *prompt)
{
    /* The line to be edited is stored in cur_line.*/
    /* get characters */
    int cur_char;
    
    for(;;) {
	cur_char = special_getc();
	
	if(isprint(cur_char) || (((unsigned char)cur_char > 0x7f) &&
				 cur_char != EOF) || cur_char == '\t') {
	    int i,inc = 1;
	    if(cur_char == '\t') {
		inc = TABSTOPS;
		cur_char = ' ';
	    }
	    

	    if(max_pos+inc>=line_len) 
		extend_cur_line();

	    for(i=max_pos+inc-1; i-inc>=cur_pos; i--) {
		    cur_line[i] = cur_line[i-inc];
		}
	    max_pos += inc;
	    while(inc--) {
		user_putc(cur_char);
		cur_line[cur_pos++] = cur_char;
	    }
	    if (cur_pos < max_pos)
		fix_line();
	    cur_line[max_pos] = '\0';
	    switch(cur_char) {
	      case ')':backupTo('(',')');break;
	      case ']':backupTo('[',']');break;
	    }
#if defined(VERASE) 
	} else if(cur_char == term_chars[VERASE] ){ /* DEL? */
	    if(cur_pos > 0) {
		int i;
		cur_pos -= 1;
		backspace();
		for(i=cur_pos; i<max_pos; i++)
		    cur_line[i] = cur_line[i+1];
		max_pos -= 1;
		fix_line();
	    }
	} else if(cur_char == term_chars[VEOF] ){ /* ^D? */
	    if(max_pos == 0) {
		copy_line("to exit EiC, enter  :exit\n");
		user_putc(BELL);

		reset_termio();		
		return((char*)NULL);
	    }
	    if((cur_pos < max_pos)&&(cur_char == 004)) { /* ^D */
		int i;
		for(i=cur_pos; i<max_pos; i++)
		    cur_line[i] = cur_line[i+1];
		max_pos -= 1;
		fix_line();
	    }

	} else if(cur_char == term_chars[VKILL] ){ /* ^U? */
	    clear_line(prompt);

	} else if(cur_char == term_chars[VWERASE] ){ /* ^W? */
	    while((cur_pos > 0) &&
		  (cur_line[cur_pos-1] == SPACE)) {
		cur_pos -= 1;
		backspace();
	    }
	    while((cur_pos > 0) &&
		  (cur_line[cur_pos-1] != SPACE)) {
		cur_pos -= 1;
		backspace();
	    }
	    clear_eoline();
	    max_pos = cur_pos;


	} else if(cur_char == term_chars[VREPRINT] ){ /* ^R? */
	    user_putc(NEWLINE); /* go to a fresh line */
	    redraw_line(prompt);


	} else if(cur_char == term_chars[VSUSP]) {
	    reset_termio();
	    kill(0, SIGTSTP);

	    /* process stops here */

	    set_termio();
	    /* print the prompt */
	    redraw_line(prompt);
#endif
	} else {
	    /* do normal editing commands */
	    /* some of these are also done above */
	    int i;
	    switch(cur_char) {
	      case EOF:
		reset_termio();
		return((char *)NULL);
	      case 001:		/* ^A */
		while(cur_pos > 0) {
		    cur_pos -= 1;
		    backspace();
		}
		break;
	      case 002:		/* ^B */
		if(cur_pos > 0) {
		    cur_pos -= 1;
		    backspace();
		}
		break;
	      case 005:		/* ^E */
		while(cur_pos < max_pos) {
		    user_putc(cur_line[cur_pos]);
		    cur_pos += 1;
		}
		break;
	      case 006:		/* ^F */
		if(cur_pos < max_pos) {
		    user_putc(cur_line[cur_pos]);
		    cur_pos += 1;
		}
		break;
	      case 013:		/* ^K */
		clear_eoline();
		max_pos = cur_pos;
		break;
		
	      case 020:		/* ^P */
		if(history != NULL) {
		    if(cur_entry == NULL) {
			cur_entry = history;
			clear_line(prompt);
			copy_line(cur_entry->line);
		    } else if(cur_entry->prev != NULL) {
			cur_entry = cur_entry->prev;
			clear_line(prompt);
			copy_line(cur_entry->line);
		    }else
			user_putc(BELL);
		}else
		    user_putc(BELL);
		break;

	    case 016:		/* ^N */
		if(cur_entry != NULL) {
		    cur_entry = cur_entry->next;
		    clear_line(prompt);
		    if(cur_entry != NULL) 
			copy_line(cur_entry->line);
		    else
			cur_pos = max_pos = 0;
		}else
		    user_putc(BELL);
		break;
	      case 014:		/* ^L */
	      case 022:		/* ^R */
		user_putc(NEWLINE); /* go to a fresh line */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
激情成人午夜视频| 99v久久综合狠狠综合久久| 国产精品一线二线三线| 一本久久a久久精品亚洲| 精品欧美乱码久久久久久| 亚洲人妖av一区二区| 加勒比av一区二区| 欧美丰满一区二区免费视频| 国产精品美女久久久久av爽李琼| 麻豆久久久久久| 精品视频资源站| 亚洲情趣在线观看| 北条麻妃国产九九精品视频| 精品久久久久久无| 午夜国产精品影院在线观看| 日本电影欧美片| 亚洲柠檬福利资源导航| 成人动漫精品一区二区| 久久久精品黄色| 国内精品伊人久久久久av一坑| 91精品在线免费| 日本欧美韩国一区三区| 欧美丰满高潮xxxx喷水动漫| 亚洲成人资源在线| 在线免费av一区| 一区二区三区在线不卡| 日本韩国视频一区二区| 亚洲美女免费视频| 色94色欧美sute亚洲13| 亚洲精品成人悠悠色影视| 色婷婷激情久久| 亚洲最新视频在线播放| 91麻豆精品一区二区三区| 亚洲欧洲另类国产综合| 成人免费va视频| 国产精品久久久久影视| 色婷婷综合视频在线观看| 亚洲精品国产精华液| 欧美天堂一区二区三区| 日韩综合小视频| 日韩午夜激情免费电影| 国产一区二区免费看| 久久九九99视频| av成人动漫在线观看| 一区二区三区在线高清| 欧美精品丝袜久久久中文字幕| 日本亚洲免费观看| 久久久欧美精品sm网站| hitomi一区二区三区精品| 一区二区在线电影| 欧美一级免费大片| 狠狠色丁香婷婷综合| 国产精品免费人成网站| 在线观看精品一区| 日韩av电影免费观看高清完整版在线观看| 91精品欧美综合在线观看最新| 久久 天天综合| 国产精品久久久久久久久免费桃花 | 欧美一级二级三级乱码| 国内精品久久久久影院色| 国产精品日韩精品欧美在线| 在线观看欧美黄色| 国产乱码精品一区二区三区av | 欧洲中文字幕精品| 麻豆极品一区二区三区| 国产精品色一区二区三区| 欧美视频一区二区三区| 久久精品久久精品| 亚洲人精品午夜| 日韩美女主播在线视频一区二区三区| 国产剧情一区二区| 一二三区精品视频| 久久精品免费在线观看| 7799精品视频| 91亚洲永久精品| 精品一区二区久久久| 一区二区三区四区视频精品免费 | 欧美色图片你懂的| 国产高清精品久久久久| 午夜精品免费在线| 国产精品久久久久久久浪潮网站| 日韩一区二区三区视频| 色婷婷av一区二区三区之一色屋| 精品一区二区三区在线播放 | 综合激情网...| 日韩一区二区在线免费观看| 成人黄页在线观看| 久久99最新地址| 亚洲免费在线电影| 国产校园另类小说区| 日韩欧美色电影| 69堂成人精品免费视频| 91黄色免费版| av爱爱亚洲一区| 成人在线视频首页| 国产一区二区不卡在线| 青青草原综合久久大伊人精品优势| 亚洲精品老司机| 成人欧美一区二区三区| 欧美激情资源网| 国产日韩欧美精品综合| 久久影院视频免费| 精品久久久久一区二区国产| 欧美一区二区三区视频在线观看| 欧美主播一区二区三区| 91黄视频在线| 欧美主播一区二区三区美女| 91香蕉视频在线| 99综合影院在线| 色综合天天综合| 色婷婷精品大视频在线蜜桃视频| 99国产麻豆精品| 99久久精品国产一区| 91免费视频观看| 在线免费观看不卡av| 欧美在线免费播放| 欧美性生交片4| 777欧美精品| 精品国精品自拍自在线| 精品精品欲导航| 久久久久久免费毛片精品| 久久精品男人天堂av| 国产精品美女www爽爽爽| 成人欧美一区二区三区小说| 亚洲欧美一区二区三区孕妇| 一区二区三区电影在线播| 午夜欧美在线一二页| 看电视剧不卡顿的网站| 国产福利91精品一区二区三区| 国产69精品久久久久777| 99精品黄色片免费大全| 欧美日韩国产一级二级| 日韩精品自拍偷拍| 国产精品久久久久影院老司| 一级中文字幕一区二区| 免费av成人在线| 99国产精品久久久久久久久久| 99精品视频在线观看| 精品视频1区2区3区| 精品国产91久久久久久久妲己| 国产欧美一区二区精品忘忧草| 自拍av一区二区三区| 奇米精品一区二区三区在线观看 | 国产麻豆精品95视频| 波多野结衣中文字幕一区二区三区| 色综合咪咪久久| 日韩欧美一区在线| 国产精品初高中害羞小美女文| 亚洲成人你懂的| 成人永久免费视频| 欧美一区二区三区在线看| 中文字幕一区二区在线播放| 日韩精品每日更新| 93久久精品日日躁夜夜躁欧美| 欧美一区二区三区啪啪| 亚洲免费成人av| 国产美女主播视频一区| 欧美另类变人与禽xxxxx| 国产亚洲va综合人人澡精品 | 亚洲免费观看高清完整| 极品美女销魂一区二区三区| 色综合久久中文字幕综合网 | 高清国产一区二区| 在线播放91灌醉迷j高跟美女 | 国产精品久久久久久福利一牛影视 | 久久久国产精品不卡| 三级久久三级久久| 99久久精品久久久久久清纯| 精品国产一二三| 天天做天天摸天天爽国产一区| 99久久婷婷国产| 欧美激情在线一区二区三区| 日韩成人伦理电影在线观看| 91久久免费观看| 最新日韩av在线| 成人动漫视频在线| 国产情人综合久久777777| 免费看欧美女人艹b| 欧美日韩黄色一区二区| 亚洲欧美日韩电影| 成人亚洲一区二区一| 久久久天堂av| 麻豆精品一二三| 555www色欧美视频| 午夜视频一区二区三区| 欧美性色欧美a在线播放| 亚洲少妇中出一区| 91小视频在线免费看| 成人欧美一区二区三区| 99热这里都是精品| 国产精品久久久久久户外露出| 成人一级片在线观看| 中文字幕二三区不卡| 高清不卡在线观看av| 中文字幕成人网| 成人一区二区三区在线观看| 国产精品欧美久久久久无广告| 国产精品一卡二卡| 国产女同互慰高潮91漫画| 成人午夜免费视频|