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

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

?? device.c

?? 操作系統源代碼
?? C
字號:
/* *	device.c -- cawf(1) output device support functions *//* *	Copyright (c) 1991 Purdue University Research Foundation, *	West Lafayette, Indiana 47907.  All rights reserved. * *	Written by Victor A. Abell <abe@mace.cc.purdue.edu>,  Purdue *	University Computing Center.  Not derived from licensed software; *	derived from awf(1) by Henry Spencer of the University of Toronto. * *	Permission is granted to anyone to use this software for any *	purpose on any computer system, and to alter it and redistribute *	it freely, subject to the following restrictions: * *	1. The author is not responsible for any consequences of use of *	   this software, even if they arise from flaws in it. * *	2. The origin of this software must not be misrepresented, either *	   by explicit claim or by omission.  Credits must appear in the *	   documentation. * *	3. Altered versions must be plainly marked as such, and must not *	   be misrepresented as being the original software.  Credits must *	   appear in the documentation. * *	4. This notice may not be removed or altered. */#include "cawf.h"#include <ctype.h>_PROTOTYPE(static unsigned char *Convstr,(char *s, int *len));_PROTOTYPE(static int Convfont,(char *nm, char *s, char **fn,	unsigned char **fi));#ifndef	UNIX#define	strcasecmp	strcmpi#endif/* * Convstr(s, len) - convert a string */static unsigned char *Convstr(s, len)	char *s;			/* input string */	int *len;			/* length of result */{	int c;				/* character assembly */	unsigned char *cp;		/* temporary character pointer */	char *em;			/* error message */	int i;				/* temporary index */	int l;				/* length */	unsigned char *r;		/* result string *//* * Make space for the result. */	if ((r = (unsigned char *)malloc(strlen((char *)s) + 1)) == NULL) {		(void) fprintf(stderr, "%s: out of string space at %s\n",			Pname, s);		return(NULL);	}/* * Copy the input string to the result, processing '\\' escapes. */	for (cp = r, l = 0; *s;) {		switch (*s) {		case '\\':			s++;			if (*s >= '0' && *s <= '7') {		/*		 * '\xxx' -- octal form		 */				for (c = i = 0; i < 3; i++, s++) {					if (*s < '0' || *s > '7') {						em = "non-octal char";bad_string:						(void) fprintf(stderr,							"%s: %s : %s\n",							Pname, em, (char *)r);						return(NULL);					}					c = (c << 3) + *s - '0';				}				if (c > 0377) {					em = "octal char > 0377";					goto bad_string;				}				*cp++ = c;				l++;			} else if (*s == 'x') {		/*		 * '\xyy' -- hexadecimal form		 */				s++;				for (c = i = 0; i < 2; i++, s++) {#if	defined(__STDC__)					if ( ! isalpha(*s) && ! isdigit(*s))#else					if ( ! isascii(*s) && ! isalpha(*s)					&&   ! isdigit(*s))#endif					{non_hex_char:						em = "non-hex char";						goto bad_string;					}					c = c << 4;					if (*s >= '0' && *s <= '9')						c += *s - '0';					else if ((*s >= 'a' && *s <= 'f')					     ||  (*s >= 'A' && *s <= 'F'))						c += *s + 10 -						     (isupper(*s) ? 'A' : 'a');					else						goto non_hex_char;				}				*cp++ = (unsigned char)c;				l++;			} else if (*s == 'E' || *s == 'e') {		/*		 * '\E' or '\e' -- ESCape		 */				*cp++ = ESC;				l++;				s++;			} else if (*s == '\0') {				em = "no char after \\";				goto bad_string;			} else {		/*		 * escaped character (for some reason)		 */				*cp++ = *s++;				l++;			}			break;	/*	 * Copy a "normal" character.	 */		default:			*cp++ = *s++;			l++;		}	}	*cp = '\0';	*len = l;	return(r);}/* * Convfont(nm, s, fn, fi) - convert a font for a device */static intConvfont(nm, s, fn, fi)	char *nm;			/* output device name */	char *s;			/* font definition string */	char **fn;			/* font name address */	unsigned char **fi;		/* initialization string address */{	char *cp;			/* temporary character pointer */	int len;			/* length *//* * Get the font name, allocate space for it and allocate space for * a font structure. */	if ((cp = strchr(s, '=')) == NULL) {		(void) fprintf(stderr, "%s: bad %s font line format: %s\n",			Pname, nm, s);		return(0);	}	if ((*fn = (char *)malloc(cp - s + 1)) == NULL) {		(void) fprintf(stderr, "%s: no space for %s font name %s\n",			Pname, nm, s);		return(0);	}	(void) strncpy(*fn, s, cp - s);	(*fn)[cp - s] = '\0';/* * Assmble the font initialization string. */	if ((*fi = Convstr(cp + 1, &len)) == NULL)		return(0);	return(len);}/* * Defdev() - define the output device */intDefdev(){	unsigned char *fi = NULL;	/* last font initialization string */	char *fn = NULL;		/* font name */	int fd = 0;			/* found-device flag */	FILE *fs;			/* file stream */	int err = 0;			/* errror count */	int i;				/* temporary index */	int len;			/* length */	char line[MAXLINE];		/* line buffer */	char *p;			/* output device configuration file */	char *s;			/* temporary string pointer *//* * Check for the built-in devices, ANSI, NONE or NORMAL (default). */	Fstr.b = Fstr.i = Fstr.it = Fstr.r = NULL;	Fstr.bl = Fstr.il = Fstr.itl = Fstr.rl = 0;	if (Device == NULL || strcasecmp(Device, "normal") == 0) {		Fontctl = 0;check_font:		if (Devfont) {			(void) fprintf(stderr,				"%s: font %s for device %s illegal\n",				Pname, Devfont, Device ? Device : "NORMAL");			return(1);		}		return(0);	}	Fontctl = 1;	if (strcasecmp(Device, "ansi") == 0) {		Fstr.b = Newstr((unsigned char *)"x[1m");		Fstr.it = Newstr((unsigned char *)"x[4m");		Fstr.r = Newstr((unsigned char *)"x[0m");		Fstr.b[0] = Fstr.it[0] = Fstr.r[0] = ESC;		Fstr.bl = Fstr.itl = Fstr.rl = 4;		goto check_font;	}	if (strcasecmp(Device, "none") == 0)		goto check_font;/* * If a device configuration file path is supplied, use it. */	if (Devconf)		p = Devconf;	else {	/*	 * Use the CAWFLIB environment if it is defined.	 */		if ((p = getenv("CAWFLIB")) == NULL)				p = CAWFLIB;		len = strlen(p) + 1 + strlen(DEVCONFIG) + 1;		if ((s = (char *)malloc(len)) == NULL) {			(void) fprintf(stderr, "%s: no space for %s name\n",				Pname, DEVCONFIG);			return(1);		}		(void) sprintf(s, "%s/%s", p, DEVCONFIG);		p = s;	}/* * Open the configuration file. */#ifdef	UNIX	if ((fs = fopen(p, "r")) == NULL)#else	if ((fs = fopen(p, "rt")) == NULL)#endif	{		(void) fprintf(stderr, "%s: can't open config file: %s\n",			Pname, p);		return(1);	}	*line = ' ';/* * Look for a device definition line -- a line that begins with a name. */	while ( ! feof(fs)) {		if (*line == '\t' || *line == '#' || *line == ' ') {			(void) fgets(line, MAXLINE, fs);			continue;		}		if ((s = strrchr(line, '\n')) != NULL)			*s = '\0';		else			line[MAXLINE-1] = '\0';	/*	 * Match device name.	 */		if (strcmp(Device, line) != 0) {			(void) fgets(line, MAXLINE, fs);			continue;		}		fd = 1;	/*	 * Read the parameter lines for the device.	 */		while (fgets(line, MAXLINE, fs) != NULL) {			if (*line == ' ') {				for (i = 1; line[i] == ' '; i++)					;			} else if (*line == '\t')				i = 1;			else				break;#if	defined(__STDC__)			if ( ! isalpha(line[i])#else			if ( ! isascii(line[i]) || ! isalpha(line[i])#endif			||   line[i+1] != '=')				break;			if ((s = strrchr(line, '\n')) != NULL)				*s = '\0';			else				line[MAXLINE-1] = '\0';			switch (line[i]) {		/*		 * \tb=<bolding_string>		 */			case 'b':				if (Fstr.b != NULL) {				    (void) fprintf(stderr,					"%s: dup bold for %s in %s: %s\n",					Pname, Device, p, line);					(void) free(Fstr.b);					Fstr.b = NULL;				}				if ((Fstr.b = Convstr(&line[i+2], &Fstr.bl))				== NULL)					err++;				break;		/*		 * \ti=<italicization_string>		 */			case 'i':				if (Fstr.it != NULL) {				    (void) fprintf(stderr,					"%s: dup italic for %s in %s: %s\n",					Pname, Device, p, line);					(void) free(Fstr.it);					Fstr.it = NULL;				}				if ((Fstr.it = Convstr(&line[i+2], &Fstr.itl))				== NULL)					err++;				break;		/*		 * \tr=<return_to_Roman_string>		 */			case 'r':				if (Fstr.r != NULL) {				    (void) fprintf(stderr,					"%s: dup roman for %s in %s: %s\n",					Pname, Device, p, line);					(void) free(Fstr.r);					Fstr.r = NULL;				}				if ((Fstr.r = Convstr(&line[i+2], &Fstr.rl))				== NULL)					err++;				break;		/*		 * \tf=<font_name>=<font_initialization_string>		 */			case 'f':				if ( ! Devfont || Fstr.i)					break;				if ((i = Convfont(Device, &line[i+2], &fn, &fi))				< 0)					err++;				else if (fn && strcmp(Devfont, fn) == 0) {					Fstr.i = fi;					Fstr.il = i;					fi = NULL;				}				if (fn) {					(void) free(fn);					fn = NULL;				}				if (fi) {					(void) free((char *)fi);					fi = NULL;				}				break;		/*		 * ????		 */			default:				(void) fprintf(stderr,					"%s: unknown device %s line: %s\n",					Pname, Device, line);				err++;			}		}		break;	}	(void) fclose(fs);	if (err)		return(1);/* * See if the device stanza was located and the font exists. */	if ( ! fd) {		(void) fprintf(stderr, "%s: can't find device %s in %s\n",			Pname, Device, p);		return(1);	}	if (Devfont && ! Fstr.i) {		(void) fprintf(stderr,			"%s: font %s for device %s not found in %s\n",			Pname, Devfont, Device, p);		return(1);	}	return(0);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
综合分类小说区另类春色亚洲小说欧美| 欧美精品一区二区久久久| 国产成人综合亚洲网站| 免费成人在线网站| 日韩主播视频在线| 天堂成人国产精品一区| 亚洲综合色噜噜狠狠| 一级精品视频在线观看宜春院 | 在线不卡中文字幕| 菠萝蜜视频在线观看一区| 99久久er热在这里只有精品15| 国产福利精品导航| 国v精品久久久网| 99久久精品久久久久久清纯| 成人免费毛片片v| 色就色 综合激情| 欧美性猛片xxxx免费看久爱| 欧美日本韩国一区二区三区视频| 欧美午夜精品一区二区蜜桃| 欧美三级日韩三级| 欧美一区二区三区在线观看视频| 欧美sm美女调教| 久久这里只有精品视频网| 国产亚洲成aⅴ人片在线观看| 中文字幕一区二区三区在线播放| 亚洲免费观看高清完整版在线观看熊| 亚洲一区在线观看视频| 青草av.久久免费一区| 国产呦萝稀缺另类资源| 92国产精品观看| 91精品久久久久久久99蜜桃 | 99久久综合99久久综合网站| av电影在线观看完整版一区二区 | 日韩中文字幕麻豆| 久久国产日韩欧美精品| 岛国精品一区二区| 欧美日韩亚洲综合| 国产欧美日产一区| 亚洲大片在线观看| 国产美女娇喘av呻吟久久| 99久久国产综合精品麻豆| 制服丝袜成人动漫| 中文字幕精品一区二区三区精品| 亚洲成人自拍网| 国产成人精品一区二| 在线看国产日韩| 精品国产乱子伦一区| 亚洲人成网站色在线观看| 美腿丝袜亚洲综合| 91影院在线免费观看| 精品成人佐山爱一区二区| 亚洲欧美成人一区二区三区| 精品在线播放免费| 日本久久一区二区| 久久精品网站免费观看| 日韩激情一二三区| 欧洲国内综合视频| 中文字幕一区二区三区不卡| 蜜乳av一区二区| 在线观看一区二区视频| 国产精品视频一二三区| 久久99国产精品久久| 欧美日本在线播放| 亚洲国产综合人成综合网站| bt7086福利一区国产| 日本一区二区三区视频视频| 久久99精品久久久久久久久久久久 | 亚洲福中文字幕伊人影院| 国产不卡视频一区| 久久女同互慰一区二区三区| 免费在线观看精品| 这里只有精品免费| 日韩激情一区二区| 9191久久久久久久久久久| 午夜精品视频在线观看| 欧美日韩亚洲综合一区二区三区 | 亚洲第一久久影院| 91精品福利视频| 亚洲精品综合在线| 91福利在线导航| 亚洲高清在线精品| 5858s免费视频成人| 亚洲一区二区中文在线| 欧洲另类一二三四区| 一区二区不卡在线播放| 欧美日韩夫妻久久| 日本91福利区| 亚洲精品在线电影| 高清不卡一二三区| 国产精品久久毛片av大全日韩| 国产成人免费视频网站| 国产亚洲美州欧州综合国| 国产一区二区伦理| 欧美国产精品一区二区三区| 99久久久精品| 亚洲影视资源网| 欧美高清视频不卡网| 日本不卡在线视频| 久久久久久久电影| 91在线你懂得| 婷婷开心激情综合| 久久一二三国产| 91在线视频免费观看| 亚洲r级在线视频| 欧美本精品男人aⅴ天堂| 国产iv一区二区三区| 亚洲黄色小视频| 欧美大片在线观看| 92精品国产成人观看免费| 亚洲丰满少妇videoshd| 久久久亚洲精品石原莉奈| 99久久婷婷国产综合精品电影| 亚洲国产精品嫩草影院| 2020日本不卡一区二区视频| 色婷婷av一区二区| 蜜臀a∨国产成人精品| 亚洲天堂成人网| 日韩美一区二区三区| 91天堂素人约啪| 麻豆精品视频在线观看视频| 亚洲三级电影网站| 欧美本精品男人aⅴ天堂| 色综合天天狠狠| 紧缚捆绑精品一区二区| 又紧又大又爽精品一区二区| wwwwww.欧美系列| 91国偷自产一区二区三区成为亚洲经典 | 亚洲欧美日本在线| 久久综合九色综合97婷婷| 欧美日韩精品欧美日韩精品一综合| 国产中文一区二区三区| 亚洲成a人v欧美综合天堂下载| 国产欧美日韩综合| 欧美一级艳片视频免费观看| 色屁屁一区二区| 成人av先锋影音| 久久国产精品一区二区| 亚洲va中文字幕| 一区二区日韩电影| 国产精品国产三级国产a| 欧美大白屁股肥臀xxxxxx| 欧美唯美清纯偷拍| 91久久精品一区二区| www.亚洲在线| 国产精品18久久久久久久网站| 午夜婷婷国产麻豆精品| 亚洲综合色区另类av| 中文字幕一区二区5566日韩| 久久久亚洲欧洲日产国码αv| 日韩欧美一区电影| 欧美精品三级日韩久久| 欧美人伦禁忌dvd放荡欲情| 欧美日韩一区二区在线观看视频 | 制服丝袜激情欧洲亚洲| 在线播放国产精品二区一二区四区 | 色综合久久综合| 97久久精品人人做人人爽| 波多野结衣欧美| 成人av在线电影| www.亚洲激情.com| 成人小视频免费观看| 成人一二三区视频| 成人午夜免费视频| 91蝌蚪porny九色| 色av成人天堂桃色av| 欧美综合欧美视频| 日韩午夜激情电影| 2020国产精品自拍| 国产精品不卡在线| 一个色综合av| 日本伊人精品一区二区三区观看方式| 日韩福利电影在线观看| 久久99精品久久久| eeuss国产一区二区三区| 欧洲精品在线观看| 日韩无一区二区| 久久精品夜色噜噜亚洲a∨| 136国产福利精品导航| 亚洲一卡二卡三卡四卡无卡久久| 日韩在线a电影| 国产成人在线电影| 欧美特级限制片免费在线观看| 欧美日韩高清在线播放| 精品日韩一区二区三区 | 99久久精品一区二区| 欧美性大战xxxxx久久久| 欧美一区二区三区免费观看视频 | 色噜噜狠狠成人中文综合| 欧美日韩一区二区不卡| 久久综合九色综合久久久精品综合| 国产精品女人毛片| 蜜臀久久99精品久久久久久9| 懂色av中文一区二区三区| 欧美日韩视频一区二区| 日本一区二区三区在线不卡| 亚洲大片在线观看| 成人在线综合网| 日韩女优制服丝袜电影| 亚洲色图视频免费播放| 久久国产剧场电影|