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

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

?? window.c

?? linux 下的超級終端 minicom
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* * window.c	Very portable window routines. *		Currently this code is used in _both_ the BBS *		system and minicom. * *		This file is part of the minicom communications package, *		Copyright 1991-1996 Miquel van Smoorenburg. * *		This program is free software; you can redistribute it and/or *		modify it under the terms of the GNU General Public License *		as published by the Free Software Foundation; either version *		2 of the License, or (at your option) any later version. * * 01.01.98 dickey@clark.net: fix for a history window closing bug * fmg 8/20/97: Added support for Search of History Buffer */#ifdef HAVE_CONFIG_H#include <config.h>#endif#include "rcsid.h"RCSID("$Id: window.c,v 1.3 2003/04/21 23:56:46 al-guest Exp $")#include "port.h"#include "window.h"#include "charmap.h"#include "intl.h"/* Status line code on/off. */#define ST_LINE 1/* fmg 2/20/94 macros - Length of Macros */#ifndef MAC_LEN#define MAC_LEN 257#endif/* Don't want to include all header stuff for three prototypes from sysdep.c */#if __STDC__  int setcbreak(int);  int wxgetch(void);  void getrowcols(int *rows, int *cols);#else  int setcbreak();  int wxgetch();  void getrowcols();#endif#ifndef BBS#include "config.h"#endif#define BUFFERSIZE 2048#define swap(x, y) { int d = (x); (x) = (y); (y) = d; }/* Terminal capabilities */static char *CM, *IS, *RS, *AC, *EA;static char *ME, *SE, *UE, *AE;static char *AS, *MB, *MD, *MR, *SO, *US;static char *CE, *Al, *Dl, *AL, *DL;static char *CS, *SF, *SR, *VB, *BL;static char *VE, *VI, *KS, *KE;static char *CD, *CL, *IC, *DC;static char *BC, *CR, *NL;#if ST_LINEstatic char *TS, *FS, *DS;#endif/* Special characters */static char D_UL;static char D_HOR;static char D_UR;static char D_LL;static char D_VER;static char D_LR;static char S_UL;static char S_HOR;static char S_UR;static char S_LL;static char S_VER;static char S_LR;static char _bufstart[BUFFERSIZE];static char *_bufpos = _bufstart;static char *_buffend;static ELM *gmap;static char curattr = -1;static char curcolor = -1;static int curx = -1;static int cury = -1;static int _intern = 0;static int _curstype = CNORMAL;static int _has_am = 0;static int _mv_standout = 0;static ELM oldc;static int sflag = 0;/* * Smooth is only defined for slow machines running Minicom. * With this defined, Minicom will buffer only per-line * and the output will look much less 'jerky'. (I hope :-) */#ifdef SMOOTHstatic WIN *curwin = NIL_WIN;extern WIN *us;#endifint useattr = 1;int dirflush = 1;extern int LINES, COLS;int usecolor = 0;WIN *stdwin;char *_tptr = CNULL;int screen_ibmpc = 0;int screen_iso = 0;int w_init = 0;#if ST_LINEint use_status = 0; /* Turned on in main() */#elseint use_status = 0;#endif/* Standard vt100 map (ac cpability) */static char *def_ac = "+\273,\253aaffggjjkkllmmnnooqqssttuuvvwwxx";#if DEBUG/* * Debug to stdout */int debug(s, a1, a2, a3, a4)char *s;int a1, a2, a3, a4;{  char lala[80];  snprintf(lala, sizeof(lala), s, a1, a2, a3, a4);  write(2, lala, strlen(lala));  return(0);}#endif/* ===== Low level routines ===== *//* * Flush the screen buffer */void wflush(){  int todo, done;  todo = _bufpos - _bufstart;  _bufpos = _bufstart;  while(todo > 0) {  	done = write(1, _bufpos, todo);  	if (done > 0) {  		todo -= done;  		_bufpos += done;  	}	if (done < 0 && errno != EINTR) break;  }  _bufpos = _bufstart;}/* * Output a raw character to the screen */static int outchar(c)int c;{  *_bufpos++ = c;  if (_bufpos >= _buffend) wflush();#if defined(SMOOTH)  if (curwin == us && (c == '\n' || c == '\r')) wflush();#endif  return(0);}/* * Output a raw string to the screen. */static void outstr(s)char *s;{  tputs(s, 1, outchar);}/* * Turn off all attributes */static void _attroff(){  if (ME != CNULL)  	outstr(ME);  else {  	if (SE != CNULL) outstr(SE);  	if (UE != CNULL) outstr(UE);  }  if (AE != CNULL) outstr(AE);}/* * Turn some attributes on */static void _attron(attr)char attr;{  if (!usecolor || (attr & XA_REVERSE) == 0) {	/* Reverse standout does not look too good.. */	if (attr & XA_BOLD	&& MD != CNULL)  outstr(MD);  	if (attr & XA_STANDOUT   && SO != CNULL)  outstr(SO);	if (attr & XA_UNDERLINE  && US != CNULL)  outstr(US);  }  if (attr & XA_REVERSE	  && MR != CNULL)  outstr(MR);  if (attr & XA_BLINK      && MB != CNULL)  outstr(MB);  if (attr & XA_ALTCHARSET && AS != CNULL)  outstr(AS);}/* * Set the colors */static void _colson(color)char color;{  char buf[12];  sprintf(buf, "\033[%d;%dm", COLFG(color) + 30, COLBG(color) + 40);  outstr(buf);}  /* * Set global attributes, if different. */static void _setattr(attr, color)char attr, color;{  if (!useattr) return;  if (!usecolor) {  	curcolor = color;  	if (attr == curattr) return;  	curattr = attr;  	_attroff();  	_attron(attr);  	return;  }  if (attr == curattr && color == curcolor) return;  _attroff();  _colson(color);  _attron(attr);  curattr = attr;  curcolor = color;}/* * Goto (x, y) in stdwin */static void _gotoxy(x, y)int x, y;{  int oldattr = -1;#if ST_LINE  int tmp;  /* Sanity check. */  if (x >= COLS || y > LINES || (x == curx && y == cury)) return;  if (use_status) {	/* Leaving status line? */	if (cury == LINES && y < cury) {		outstr(FS);		/* Re-set attributes. */		tmp = curattr;		curattr = -1;		_setattr(tmp, curcolor);		outstr(tgoto(CM, x, y));		curx = x; cury = y;		return;	}	/* Writing on status line? */	else if (y == LINES) {		/* From normal screen? */		if (cury < y) {			outstr(tgoto(TS, x, x));			curx = x;			cury = y;			/* Set the right attributes. */			tmp = curattr;			curattr = -1;			_setattr(tmp, curcolor);			return;		}	}  }#else  /* Sanity check. */  if (x >= COLS || y >= LINES || (x == curx && y == cury)) {#  if 0	if (x >= COLS || y >= LINES)		fprintf(stderr, "OOPS: (x, y) == (%d, %d)\n",			COLS, LINES);#  endif	return;  }#endif  if (!_mv_standout && curattr != XA_NORMAL) { 	oldattr = curattr;  	_setattr(XA_NORMAL, curcolor);  }  if (CR != CNULL && y == cury && x == 0)  	outstr(CR);#if 0 /* Hmm, sometimes NL only works in the first column */  else if (NL != CNULL && x == curx && y == cury + 1)	outstr(NL);#else  else if (NL != CNULL && x == 0 && x == curx && y == cury + 1)	outstr(NL);#endif  else if (BC != CNULL && y == cury && x == curx - 1)  	outstr(BC);  else	  	outstr(tgoto(CM, x, y));  curx = x;  cury = y;  if (oldattr != -1) _setattr(oldattr, curcolor);}/* * Write a character in stdwin at x, y with attr & color * 'doit' can be  -1: only write to screen, not to memory *                 0: only write to memory, not to screen *                 1: write to both screen and memory */static void _write(c, doit, x, y,attr, color)int c, doit;int x, y;char attr, color;{  ELM *e;  /* If the terminal has automatic margins, we can't write to the   * last line, last character. After scrolling, this "invisible"   * character is automatically restored.   */  if (_has_am && y >= LINES - 1 && x >= COLS - 1) {  	doit = 0;  	sflag = 1;  	oldc.value = c;  	oldc.attr = attr;  	oldc.color = color;  }#if ST_LINE  if (x < COLS && y <= LINES) {#else  if (x < COLS && y < LINES) {#endif     if (doit != 0) {	static int x0=-1, y0=-1, c0=0;	static char attr0, color0;	if (x!=x0+1 || y!=y0 || attr!=attr0 || color!=color0 || !(c0&128)) {  		_gotoxy(x, y);  		_setattr(attr, color);	}	x0=x; y0=y; attr0=attr; color0=color; c0=c;	(void) outchar((screen_ibmpc || screen_iso || (attr & XA_ALTCHARSET)) ? c : wcharmap[(unsigned char)c]); 	/* a little test at 10.3.1998 / jl */	/* (void) outchar((unsigned char) c); */	curx++;     }     if (doit >= 0) {	e = &gmap[x + y * COLS];	e->value = c;	e->attr = attr;	e->color = color;     }  }}/* * Set cursor type. */static void _cursor(type)int type;{  _curstype = type;  if (type == CNORMAL && VE != CNULL) outstr(VE);  if (type == CNONE && VE != CNULL && VI != CNULL) outstr(VI);}/* ==== High level routines ==== */#if 0/* This code is functional, but not yet used. * It might be one day.... *//* * Resize a window */void wresize(win, lines, cols)WIN *win;int lines, cols;{  int x, y;  ELM *oldmap, *newmap, *e, *n;  if ((newmap = (ELM *)malloc((lines + 1) * cols * sizeof(ELM))) == (ELM *)NULL)	return;  if (win == stdwin)	oldmap = gmap;  else	oldmap = win->map;  for(y = 0; y < lines; y++)	for(x = 0; x < cols; x++) {		n = &newmap[y + x * cols];		if (x < win->xs && y < win->ys) {			e = &oldmap[y + x * COLS];			n->value = e->value;			n->color = e->color;			n->attr = e->attr;		} else {			n->value = ' ';			n->color = win->color;			n->attr = win->attr;		}	}  if (win->sy2 == win->y2) win->sy2 = win->y1 + lines - 1;  win->y2 = win->y1 + lines - 1;  win->ys = lines;  win->xs = cols;  free(oldmap);  if (win == stdwin) {	gmap = newmap;	LINES = lines;	COLS = cols;  } else	win->map = newmap;}#endif/* * Create a new window. *//*ARGSUSED*/WIN *wopen(x1, y1, x2, y2, border, attr, fg, bg, direct, histlines, doclr)int x1, y1, x2, y2;int border;int attr, fg, bg, direct;int histlines;int doclr;{  WIN *w;  ELM *e;  int bytes;  int x, y;  int color;  int offs;  int xattr;#ifdef SMOOTH  curwin = NIL_WIN;#endif  if ((w = (WIN *)malloc(sizeof(WIN))) == (WIN *)0) return(w);    offs = (border != BNONE);  if (!screen_ibmpc && AS) 	xattr = attr | XA_ALTCHARSET;  else	xattr = attr;  if (x1 < offs) x1 = offs;  if (y1 < offs) y1 = offs;#if 0  if (x2 >= COLS - offs) x2 = COLS - offs - 1;  if (y2 >= LINES - offs) y2 = LINES - offs - 1;#endif  if (x1 > x2) swap(x1, x2);  if (y1 > y2) swap(y1, y2);  w->xs = x2 - x1 + 1;  w->ys = y2 - y1 + 1;  w->x1 = x1;  w->x2 = x2;  w->y1 = w->sy1 = y1;  w->y2 = w->sy2 = y2;  w->doscroll = 1;  w->border = border;  w->cursor = CNORMAL;  w->attr = attr;  w->autocr = 1;  w->wrap = 1;  color = w->color = COLATTR(fg, bg);  w->curx = 0;  w->cury = 0;  w->o_curx = curx;  w->o_cury = cury;  w->o_attr = curattr;  w->o_color = curcolor;  w->o_cursor = _curstype;  w->direct = direct;  if (border != BNONE) {  	x1--; x2++;  	y1--; y2++;  }  /* Store whatever we are overlapping */  bytes = (y2 - y1 + 1) * (x2 - x1 + 1) * sizeof(ELM) + 100;  if ((e = (ELM *)malloc(bytes)) == (ELM *)0) {  	free(w);  	return((WIN *)0);  }  w->map = e;  /* How many bytes is one line */  bytes = (x2 - x1 + 1) * sizeof(ELM);  /* Loop */  for(y = y1; y <= y2; y++) {  	memcpy(e, gmap + COLS * y + x1, bytes);  	e += (x2 - x1 + 1);  }  #if HISTORY  /* Do we want history? */  w->histline = w->histlines = 0;  w->histbuf = (ELM *)0;  if (histlines) {	/* Reserve some memory. */	bytes = w->xs * histlines * sizeof(ELM);	if ((w->histbuf = (ELM *)malloc(bytes)) == NULL) {		free(w->map);		free(w);		return((WIN *)0);	}	w->histlines = histlines;	/* Clear the history buf. */	e = w->histbuf;	for(y = 0; y < w->xs * histlines; y++) {		e->value = ' ';		e->attr = attr;		e->color = color;		e++;	}  }#endif  /* And draw the window */  if (border) {	_write(border == BSINGLE ? S_UL : D_UL, w->direct, x1, y1,					xattr, color);	for(x = x1 + 1; x < x2; x++)		_write(border == BSINGLE ? S_HOR : D_HOR, w->direct, x, y1,					xattr, color);	_write(border == BSINGLE ? S_UR : D_UR, w->direct, x2, y1,					xattr, color);	for(y = y1 + 1; y < y2; y++) {		_write(border == BSINGLE ? S_VER : D_VER, w->direct, x1, y,					xattr, color);		for(x = x1 + 1; x < x2; x++)			_write(' ', w->direct, x, y, attr, color);		_write(border == BSINGLE ? S_VER : D_VER, w->direct, x2, y,					xattr, color);	}	_write(border == BSINGLE ? S_LL : D_LL, w->direct, x1, y2,					xattr, color);	for(x = x1 + 1; x < x2; x++)		_write(border == BSINGLE ? S_HOR : D_HOR, w->direct,					x, y2, xattr, color);	_write(border == BSINGLE ? S_LR : D_LR, w->direct, x2, y2,					xattr, color);	if (w->direct) _gotoxy(x1 + 1, y1 + 1);  } else  	if (doclr) winclr(w);  wcursor(w, CNORMAL);	  if (w->direct) wflush();  return(w);}/* * Close a window. */void wclose(win, replace)WIN *win;int replace;{  ELM *e;  int x, y;#ifdef SMOOTH  curwin = NIL_WIN;#endif  if (!win) return;  if (win == stdwin) {  	win_end();  	return;  }  e = win->map;  if (win->border) {  	win->x1--; win->x2++;  	win->y1--; win->y2++;  }  wcursor(win, win->o_cursor);  if (replace) {	for(y = win->y1; y <= win->y2; y++) {		/* temporal way to avoid 'half-character' problem */		/* in multibyte characters such as Japanese -- from here */		ELM *g;		g = gmap + (y * stdwin->xs);		for(x = 0 ; x < win->x1; x++) {			_write(g->value, 1, x, y, g->attr, g->color);			g++;		}		/* to here */  		for(x = win->x1; x <= win->x2; x++) {  			_write(e->value, 1, x, y, e->attr, e->color);  			e++;  		} 	}	_gotoxy(win->o_curx, win->o_cury);	_setattr(win->o_attr, win->o_color);  }  free(win->map);#if HISTORY  if (win->histbuf) free(win->histbuf);#endif  free(win);	/* 1.1.98 dickey@clark.net  */  wflush();}static int oldx, oldy;static int ocursor;/* * Clear screen & restore keyboard modes */void wleave(){  oldx = curx;  oldy = cury;  ocursor = _curstype;  (void) setcbreak(0); /* Normal */  _gotoxy(0, LINES - 1);  _setattr(XA_NORMAL, COLATTR(WHITE, BLACK));  _cursor(CNORMAL);  if (CL != CNULL)	outstr(CL);  else	outstr("\n");#if ST_LINE  if (DS) outstr(DS);#endif  if (KE != CNULL) outstr(KE);  if (RS != CNULL) outstr(RS);  wflush();}void wreturn(){  int x, y;  ELM *e;#ifdef SMOOTH  curwin = NIL_WIN;#endif  curattr = -1;  curcolor = -1;  (void) setcbreak(1); /* Cbreak, no echo */  if (IS != CNULL) outstr(IS); /* Initialization string */  if (EA != CNULL) outstr(EA); /* Graphics init. */  if (KS != CNULL) outstr(KS); /* Keypad mode */    _gotoxy(0, 0);  _cursor(ocursor);  e = gmap;  for(y = 0; y <LINES; y++) {  	for(x = 0; x < COLS; x++) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕视频一区| 国产a久久麻豆| 国产老妇另类xxxxx| av爱爱亚洲一区| 日韩午夜在线观看| 亚洲欧美日韩国产成人精品影院| 日本网站在线观看一区二区三区| 成人涩涩免费视频| 日韩欧美在线综合网| 亚洲欧美激情小说另类| 国产精品白丝jk白祙喷水网站| 欧美在线免费播放| 亚洲婷婷在线视频| 国产成人高清在线| 26uuu亚洲婷婷狠狠天堂| 午夜免费欧美电影| 91精品办公室少妇高潮对白| 久久精品视频网| 日韩1区2区3区| 欧美日韩小视频| 18成人在线观看| 丁香啪啪综合成人亚洲小说 | 国产视频一区二区在线| 视频一区二区中文字幕| 欧美在线观看18| 亚洲精品国产a| 91美女视频网站| 成人免费在线视频观看| 成人动漫视频在线| 国产精品视频yy9299一区| 国产乱色国产精品免费视频| 久久一日本道色综合| 国内精品免费**视频| 久久亚洲精品小早川怜子| 久久99深爱久久99精品| 亚洲精品一区在线观看| 韩国v欧美v日本v亚洲v| 精品精品欲导航| 国产大陆精品国产| 中文字幕欧美日韩一区| 波多野结衣的一区二区三区| 日韩一区有码在线| 欧美影院一区二区| 日本伊人色综合网| 久久综合99re88久久爱| 国产xxx精品视频大全| 中文字幕在线一区二区三区| 91国产视频在线观看| 午夜精品爽啪视频| 日韩欧美的一区| 成人的网站免费观看| 亚洲免费在线观看| 欧美久久婷婷综合色| 久久er99精品| 亚洲婷婷在线视频| 欧美一区二区三区视频| 国产在线精品一区二区夜色| 日本一区二区不卡视频| 欧美综合一区二区| 麻豆精品国产传媒mv男同| 久久久国产午夜精品| 色综合久久久久| 麻豆精品视频在线观看视频| 国产日韩精品一区| 欧美色男人天堂| 国产综合一区二区| 亚洲理论在线观看| 精品国产乱码久久| 色偷偷久久一区二区三区| 日韩电影在线免费| 国产精品电影一区二区| 3d成人动漫网站| a级高清视频欧美日韩| 日日夜夜精品视频天天综合网| 久久久噜噜噜久久中文字幕色伊伊| 91在线视频网址| 精品一区二区三区在线播放| 亚洲精品中文字幕在线观看| 日韩一级免费观看| 色综合色综合色综合| 国产一区美女在线| 亚洲国产综合色| 亚洲欧洲国产日韩| 精品日韩av一区二区| 欧美婷婷六月丁香综合色| 成人av午夜影院| 久久机这里只有精品| 亚洲小少妇裸体bbw| 国产精品久久久久婷婷二区次| 日韩一级在线观看| 日本高清不卡一区| www.综合网.com| 国产麻豆视频一区| 日本视频在线一区| 天天操天天干天天综合网| 中文字幕日韩精品一区| 国产色产综合色产在线视频 | 色老汉av一区二区三区| 国产精品综合在线视频| 日本美女一区二区| 亚瑟在线精品视频| 亚洲一区二区在线免费看| 1024国产精品| 欧美国产日本韩| 国产精品天天看| 日本一区二区高清| 日本一区二区成人| 欧美激情一区三区| 国产精品乱人伦| 中文字幕日韩一区| 亚洲日本丝袜连裤袜办公室| 中文字幕中文字幕中文字幕亚洲无线| 国产丝袜美腿一区二区三区| 久久精品欧美一区二区三区不卡 | 亚洲精品一二三| 亚洲日本青草视频在线怡红院| 国产精品美女视频| 国产精品久久久久久久久久久免费看 | 欧美激情综合五月色丁香| 久久中文字幕电影| 国产欧美一二三区| 中文乱码免费一区二区 | 久久免费午夜影院| 久久久精品综合| 国产精品国产自产拍高清av| 国产精品的网站| 亚洲激情av在线| 日韩在线一区二区三区| 蜜桃av噜噜一区二区三区小说| 麻豆国产精品777777在线| 美美哒免费高清在线观看视频一区二区| 看片网站欧美日韩| 国产盗摄精品一区二区三区在线| 成人av在线影院| 欧美在线一二三四区| 这里是久久伊人| 久久久久久99久久久精品网站| 国产午夜精品福利| 亚洲欧美影音先锋| 首页国产丝袜综合| 国产一区二区三区免费播放 | 666欧美在线视频| 亚洲精品一区二区三区蜜桃下载 | 色猫猫国产区一区二在线视频| 日本韩国一区二区三区| 91麻豆精品国产自产在线 | 欧美大片日本大片免费观看| 久久久久久久久久久电影| 综合久久综合久久| 日韩成人免费电影| 粉嫩一区二区三区性色av| 日本高清不卡aⅴ免费网站| 91.xcao| 国产精品久久综合| 香港成人在线视频| 懂色av噜噜一区二区三区av| 欧美综合久久久| 久久亚洲二区三区| 亚洲一区av在线| 国产麻豆一精品一av一免费 | 国产免费成人在线视频| 亚洲精品中文字幕在线观看| 青青草精品视频| 色综合天天综合狠狠| 日韩区在线观看| 一区二区三区加勒比av| 久久99久久99精品免视看婷婷 | 成人午夜激情在线| 日韩欧美综合在线| 亚洲一区二区欧美日韩| 国产精品18久久久| 日韩亚洲欧美中文三级| 亚洲欧美色图小说| 国产精品亚洲专一区二区三区| 欧美日韩精品欧美日韩精品| 欧美国产日韩一二三区| 麻豆成人av在线| 欧美一区二区国产| 一区二区三区在线视频免费 | 中文字幕一区二区三| 激情五月婷婷综合| 欧美一区日本一区韩国一区| 亚洲精品国久久99热| 国产精品小仙女| 久久女同精品一区二区| 日本不卡一区二区三区高清视频| 9久草视频在线视频精品| 精品国产精品网麻豆系列 | 日韩精品一区二区三区在线播放| 一区二区视频免费在线观看| 成人高清视频在线观看| 久久蜜桃一区二区| 久久国产精品第一页| 在线不卡中文字幕播放| 夜夜爽夜夜爽精品视频| 91尤物视频在线观看| 中文字幕一区二区5566日韩| 不卡的av在线播放| 亚洲欧美日韩小说| 色综合天天性综合|