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

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

?? batch.c

?? 一個dos操作系統DRDOS的源碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
		case '\r':			/* carriage return */
		    if(*batch_ptr() != '\n')	/*  skip line feed */
			batch->offset--;	/* if present	   */
		    break;

		case '"':			/* Support Quoted strings   */
		    quote = !quote;		/* in batch files.	    */
		    goto save_it;

		case PIPE_CHAR: 		/* Handle Piped Output	    */
		    if(goto_flg || quote)	/* Ignore this character if */
			goto save_it;		/* we are searching for a   */
						/* Label or Quote.	    */
		    line[i] = '\0';
		    c = *deblank(line);		/* normal case we just      */
		    if ((c !='\0') && (c != ':') && following_command()) {
			c = '\r';		/* simulate a CR and set    */
			pipe_out = YES;		/* Pipe Output flag.	    */
		    } else if (c == ':') {	/* if it's a label */
		    	for(;(c != '\r') && (c != 0x1A); c = *batch_ptr())
			    if (c == 0x1A)	/* eat rest of the line     */
				batch->eof = YES;
			if(*batch_ptr() != '\n')/*  skip line feed */
			    batch->offset--;	/* if present	   */
			c = '\r';
		    } else {			/* if it's a syntax error    */
			swallow_line(line);	/* discard the rest of line  */
			i = 0;			/* start again with new line */
		    }
		    break;

		case '%':	/* The following code checks to see if the   */
				/* string starting at line[env_start-1] is   */
				/* define in the environment if it is then   */
				/* its definition replaces it in the input   */
				/* line. Otherwise no change is made.	     */
		    if(env_start) {
			env_start--;
			line[i] = '\0'; 		/* Terminate Input   */
			strcpy(env_str, line+env_start);/* Copy the String   */
			strupr(env_str);		/* and force string  */
			bp = (BYTE *)heap();		/* into Uppercase    */
			i = env_start;
			env_start = NULL;

			strcat(env_str,"=");
			if (env_scan(env_str,bp)) {
			    if (novell_extension(env_str,bp)) break;
			}
			
			while(*bp && i < MAX_LINE-1)
			    line[i++] = *bp++;
			break;
		    }
		    
		    c = *batch_ptr();
		    if (c == '\r') {
			batch->offset--;	/* rewind to point to '\r'   */
		    	break;			/* then break to normal code */
		    }
		    if (c < '0' || c > '9') {	/* if not a parameter	     */
			if(c != '%')		/* or a '%' character	     */
			    env_start = i+1;	/* save its start address in */
			goto save_it;		/* the string and wait for   */
		    }				/* the terminating '%'	     */
		    
		    n = c - '0' + batch->batshift;     /* get parameter # 0-9 and   */
						/* add in SHIFT offset	     */
		    s = batch->batcmd;
		    while(n-- && strlen(s))	/* skip all other parameters */
			s += strlen(s)+1;	/*   before the one we want  */

		    if((strlen(s) + i) >= MAX_LINE) /* Break if Greater than MAX_LINE*/
			break;
		    strcpy (line + i, s);	/* get the substitution */
		    i += strlen (s);		/* add in its size */
		    break;

		case 0x1a:
	    end_of_file:
		    batch->eof = YES;		/* We have come to the end  */
		    c = '\r';			/* of the batch file so set */
		    break;			/* flag and mark end of line*/

		 default:
	    save_it:
		    if (i < MAX_LINE)
			line[i++] = c;
		    if (dbcs_lead(c)) {
			if ((c = *batch_ptr()) >= ' ' && i < MAX_LINE)
			    line[i++] = c;
		    }
		}
	} while (c != '\r');			/* repeat until CR	   */

	line[i] = '\0'; 			/* Terminate the line and  */

	if(batch->eof)
	    return;

#if 0	/* not DOS compatible */
	if(*batch_ptr() == 0x1A)		/* Check if the next this  */
	    batch->eof = YES;			/* the end of the file if  */
	else					/* YES then set the flag   */
	    batch->offset--;			/* force the character to  */
#endif						/* be re-read next time    */
	return; 				/* return to the caller    */
}

MLOCAL BOOLEAN following_command()
/* return true if we have a possible command on the rest of the line */
{
LONG	old_offset;
BOOLEAN	res = FALSE;
BYTE	*s;

	old_offset = batch->offset;		/* save batch offset */
	while (TRUE) {
	    s = batch_ptr();			/* look ahead at batch file */
	    if (*s == '\r' || *s == 0x1a || (!dbcs_lead(*s) && *s == PIPE_CHAR))
		break;
	    if (!is_blank(s)) {
	        res = TRUE;			/* possible command if we   */
		break;				/* hit non whitespace char  */
	    }
	    if (dbcs_lead(*s)) {
		s = batch_ptr();
		if (*s == '\r' || *s == 0x1a)
		    break;
	    }
	}
	batch->offset = old_offset;		/* restore batch offset */
	return res;
}

MLOCAL VOID swallow_line(s)
BYTE	*s;
/* there is a syntax error on this line - swallow it and say so */
{
BYTE	c;

	prompt();				/* possibly echo the prompt */
	if (echoflg)				/* echo to screen if wanted */
	    printf("%s%c",s,PIPE_CHAR);
	
	do {
	    c = *batch_ptr();
	    if (c ==  0x1a) {
		c = '\r';			/* pretend to be end of line*/
		batch->eof = YES;		/* We have come to the end  */
		break;				/* flag and mark end of line*/
	    }
	    if (echoflg)			/* echo to screen if wanted */
		putc(c);
	} while (c != '\r');
	if (echoflg)
	    putc('\n');

	if (*batch_ptr() != '\n')		/*  skip line feed */
		   batch->offset--;		/* if present	   */

	eprintf(MSG_SYNTAX);			/* report syntax error	*/
}

/*
 *	In order to improve performance of the batch file processing
 *	the Batch file is read in blocks of BATCH_BUF characters.
 *	and the routine BATCH_CHAR then returns a pointer to a character
 *	from the buffer (filling the buffer if required).
 */
MLOCAL BYTE *batch_ptr()
{
	BYTE FAR *buf;
	UWORD bufsize;
	UWORD i;
	
	if(batch->eof)
	    return(batch_eof);
	    
	if (batch->offset < batch_off ||
		batch->offset >= (batch_off + (LONG) (batch_cnt - 1))) {

	    batch_off = batch->offset;
	    ms_x_lseek (batch->stream, batch->offset, 0);
	    batch_cnt = far_read(batch->stream, gp_far_buff, sizeof(batch_buf));
	    if(batch_cnt <= 0) {
		batch->eof = YES;
		return(batch_eof);
	    }
	    for (i=0; i<sizeof(batch_buf); i++) batch_buf[i] = gp_far_buff[i];
	}
	return(&batch_buf[(UWORD) (batch->offset++ - batch_off)]);
}


/*.pa*/
/*
 *	BATCH FILE COMMANDS
 *	===================
 *
 *	The following commands are used almost entirely in BATCH files and
 *	have little or no meaning outside that environment.
 */
GLOBAL VOID CDECL cmd_shift ()
{
	batch->batshift++;		/* Increment the Shift Offset	*/
}


MLOCAL WORD label_ignore_char(s)
BYTE	*s;
{
	if (*s == '=') return(1);
	if (*s == ';') return(1);
	if (*s == ',') return(1);
	if (*s == ' ') return(1);
	return(0);
}

/*
 *	Extract the first a valid characters from the label and then
 *	zero terminate the resulting string.
 */
MLOCAL BYTE * make_label(label)
BYTE *label;  
{
REG BYTE *bp;
UWORD i;

	label = deblank(label);		/* remove leading white space */
	while (label_ignore_char(label))
	    label = skip_char(label);
	
	bp = label;
	
	while (is_filechar(bp))		/* skip over valid chars      */
	    bp = skip_char(bp);

	*bp = '\0';			/* make label zero terminated */
	return label;
}

GLOBAL VOID CDECL cmd_goto (label)		  /* goto label in batch file */
REG BYTE    *label;
{
UWORD	i;
BYTE	*bp, s[MAX_LINE+2]; 		/* Allocate buffer for Batch Input  */
	
	if (!batchflg)			/* if not in batch mode 	    */
	    return;			/* this command is ignored	    */

	if(*label == ':')		/* Ignore any leading ':'	    */
	    label++;
	
	label = make_label(label);	/* Convert to Label Format	    */

	batch->offset = 0L;		/* rewind the batch file	    */
	batch->eof = NO;		/* So it cannot be EOF		    */

	if(!batch_open())		/* Check the Batch file is open     */
	    return;			/* and stop if the function fails.  */

	while(!batch->eof) {		/* while not end of file read next  */
	    batch_read(s, YES); 	/* line and return the next command  */
	    bp = deblank(s);
	    if((*bp == ':') && !strnicmp(make_label(bp+1),label, 8))
		return;
	}

	batch_end();			/* Stop any further batch file	   */
	crlfflg = YES;			/* processing and print the error  */
	eprintf(MSG_LABEL, label);
}


GLOBAL VOID CDECL cmd_gosub (label)	  /* gosub label in batch file */
REG BYTE    *label;
{
UWORD	i;
BYTE	*bp, s[MAX_LINE+2]; 		/* Allocate buffer for Batch Input  */
	
	if (!batchflg)			/* if not in batch mode 	    */
	    return;			/* this command is ignored	    */

	if (batch->ret_offset[3] != 0L) {
		batch_end();
		crlfflg = YES;
		eprintf(MSG_GOSUB);
		return;
	}

	if(*label == ':')		/* Ignore any leading ':'	    */
	    label++;
	
	label = make_label(label);	/* Convert to Label Format	    */

	i = 0;
	while (batch->ret_offset[i] != 0L) i++;
	batch->ret_offset[i] = batch->offset;
	
	batch->offset = 0L;		/* rewind the batch file	    */
	batch->eof = NO;		/* So it cannot be EOF		    */

	if(!batch_open())		/* Check the Batch file is open     */
	    return;			/* and stop if the function fails.  */

	while(!batch->eof) {		/* while not end of file read next  */
	    batch_read(s, YES); 	/* line and return the next command  */
	    bp = deblank(s);
	    if((*bp == ':') && !strnicmp(make_label(bp+1),label, 8))
		return;
	}

	batch_end();			/* Stop any further batch file	   */
	crlfflg = YES;			/* processing and print the error  */
	eprintf(MSG_LABEL, label);
}

GLOBAL	VOID CDECL cmd_return()
{
	UWORD i;
	
	if (!batchflg) return;
	if (batch->ret_offset[0] == 0L) {
		batch_end();
		crlfflg = YES;
		eprintf(MSG_RETURN);
		return;
	}
	i = 0;
	while ((batch->ret_offset[i] != 0L)&&(i<4)) i++;
	batch->offset = batch->ret_offset[i-1];
	batch->ret_offset[i-1] = 0L;
}

#if SWITCH_ENABLED
GLOBAL	VOID CDECL cmd_switch(list)
REG BYTE	*list;
{
	BYTE	*list_start;
	BYTE	*label;
	WORD	i,j;
	BYTE	c;

	if (!batchflg) return;
	list_start = list;

switch_retry:
	list = list_start;
	i = psp_poke(STDIN,1);

#if defined(CDOSTMP)
	c =(BYTE) bdos(C_RAWIO, 0xFD);	/* Get a character from console */

	if ((c==0) ||(dbcs_lead(c)))
	    bdos(C_RAWIO, 0xFD);	/* skip second byte in DBCS pair */
#else
	c = (BYTE) msdos(MS_C_RAWIN, 0);/* Get a character from console */
	if ((c==0) || (dbcs_lead(c)))
	    msdos(MS_C_RAWIN, 0);	/* skip second byte in DBCS pair */
#endif
	psp_poke(STDIN,i);
	
	if (c==0x03) int_break();	/* check for CTRL-C */	
	if (c==0x0d) c = '1';		/* return gives default of 1 */
	
	i = (WORD) (c - '1');
	if (i<0 || i>8) goto switch_retry;	/* ignore invalid keys */

	j = 0;	
	while (j<i) {
		while (*list != ',' && *list != 0) list++;
		if (*list == 0) goto switch_retry;
		j++;
		list++;
		list = deblank(list);
	}
	label = list;
	while (*list != ',' && *list != 0) list++;
	*list = 0;
	cmd_gosub(label);
}
#endif


/*.pa*/
/*
 *	The IF command supports the following syntax:-
 *
 *	IF [NOT] string1 == string2 COMMAND
 *	IF [NOT] ERRORLEVEL n COMMAND
 *	IF [NOT] EXIST filename COMMAND
/*RG-02-
 *	IF [NOT] USERID n COMMAND
 *	IF [NOT] LOGINNAME string COMMAND
 *	IF [NOT] GROUPNAME string COMMAND
 *	IF [NOT] KEY ["string"] char COMMAND
 *
 */
#if defined(CDOSTMP) || defined(CDOS)
MLOCAL BYTE *if_opt[] = {"exist", "direxist", "errorlevel", "key", "userid", "loginname", "groupname", NULL };
#else
MLOCAL BYTE *if_opt[] = {"exist", "direxist", "errorlevel", NULL };
#endif
/*RG-02-end*/

MLOCAL UWORD if_index(cmd)
BYTE **cmd;
{
UWORD	i, j;

	for(i = 0; if_opt[i]; i++) {		/* Scan Through the option   */
	    j = strlen(if_opt[i]);		/* list and return the index */
						/* of the matching option    */
	    if(strnicmp(*cmd, if_opt[i], j))	/* and update the string     */
	        continue;			/* pointer.		     */
	    *cmd = deblank(*cmd+j);

	    while(*(*cmd) == '=')		/* Remove any "=" string     */
	        (*cmd)++;			/* present in the command    */
	    *cmd = deblank(*cmd);		/* Used by many install files*/
	    break;
	}

	return i;
}

#define	OP_EQ 0
#define OP_NE 1
#define OP_LE 2
#define OP_LT 3
#define OP_GE 4
#define OP_GT 5

MLOCAL	WORD get_operator(op)
BYTE	*op;
{
	if (op[0] == '=') return(OP_EQ);
	if (op[0] == '!' && op[1] == '=') return(OP_NE);
	if (op[0] == '<') {
	    if (op[1] == '>') return(OP_NE);
	    if (op[1] == '=') return(OP_LE);
	    return(OP_LT);
	}
	if (op[0] == '>') {
	    if (op[1] == '=') return(OP_GE);
	    return(OP_GT);
	}
	return(-1);
}

MLOCAL	LONG	get_decimal(s)
BYTE	*s;
{
	LONG	total = 0;
	
	if (*s == '#') s++;
	
	while (*s>='0' && *s<='9') {
	    total *= 10;
	    total += (LONG) (*s-'0');
	    s++;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日韩欧美电影| 99热99精品| 亚洲va欧美va天堂v国产综合| 依依成人综合视频| 久久精品国产99| av在线播放不卡| 欧美日韩国产高清一区二区三区| 日韩欧美的一区二区| 国产精品乱人伦| 午夜视频一区二区| 国产乱子伦视频一区二区三区| 91免费版在线| 欧美成人性福生活免费看| 中文字幕第一区| 午夜a成v人精品| 国产不卡高清在线观看视频| 欧美午夜寂寞影院| 久久久91精品国产一区二区三区| 亚洲精品国产成人久久av盗摄 | 欧美亚一区二区| 日韩精品一区二区在线| 亚洲三级在线观看| 久久99精品久久久久久久久久久久| 大陆成人av片| 日韩女优电影在线观看| 一区二区三区资源| 国产精品自拍av| 欧美日韩中文国产| 国产精品免费久久久久| 久久精品国产一区二区三 | 丝袜美腿亚洲综合| 99在线精品视频| 精品剧情在线观看| 亚洲大片精品永久免费| 成人激情开心网| 亚洲精品一区二区精华| 亚洲一区二区三区国产| av不卡在线观看| 久久综合九色综合97婷婷女人| 亚洲成av人片在线| 91原创在线视频| 中文字幕欧美日本乱码一线二线 | 精品国产精品网麻豆系列| 一区二区成人在线| 成人激情小说网站| 久久久夜色精品亚洲| 蜜臀久久久久久久| 欧美日韩美少妇| 亚洲精品欧美激情| 91在线精品一区二区| 欧美国产精品中文字幕| 国产麻豆精品95视频| 日韩女优视频免费观看| 丝袜亚洲精品中文字幕一区| 日本电影亚洲天堂一区| 亚洲欧美日韩小说| 99国产精品久久久久| 日本一区二区三区在线不卡| 精品一区二区在线播放| 精品久久人人做人人爰| 奇米精品一区二区三区四区| 欧美视频你懂的| 亚洲二区在线观看| 欧洲精品在线观看| 亚洲精品日日夜夜| 色播五月激情综合网| 亚洲欧洲韩国日本视频| 成人丝袜高跟foot| 国产精品电影院| 成人av网站大全| 椎名由奈av一区二区三区| 成人午夜视频福利| 国产精品久久三| av一二三不卡影片| 亚洲激情自拍偷拍| 日本大香伊一区二区三区| 一区二区三区在线观看网站| 欧洲在线/亚洲| 亚洲国产精品久久久男人的天堂| 欧美性高清videossexo| 日韩精品色哟哟| 日韩免费福利电影在线观看| 免费成人美女在线观看| 欧美成人一级视频| 国产福利一区二区三区| 欧美激情在线一区二区| 91色porny| 亚洲18色成人| 精品国产乱码久久久久久影片| 国产精品亚洲午夜一区二区三区| 中文一区二区在线观看| 99r国产精品| 亚洲成人动漫一区| 欧美一区午夜视频在线观看| 久久超碰97人人做人人爱| 久久精品免视看| 91女厕偷拍女厕偷拍高清| 亚洲自拍偷拍av| 日韩午夜av一区| 国产成人免费视| 亚洲精品菠萝久久久久久久| 欧美精品久久99久久在免费线| 蜜臀va亚洲va欧美va天堂| 国产亚洲精久久久久久| 色综合天天在线| 首页国产欧美日韩丝袜| 欧美精品一区二区三区很污很色的 | 91香蕉视频污在线| 亚洲电影一区二区三区| 欧美大片国产精品| 97久久精品人人做人人爽| 亚洲成精国产精品女| 精品乱人伦一区二区三区| 成人福利视频网站| 亚洲v中文字幕| 久久久91精品国产一区二区三区| 97se亚洲国产综合自在线不卡| 亚洲五月六月丁香激情| 精品久久人人做人人爽| 日本久久一区二区| 免费成人你懂的| 最新成人av在线| 欧美成人猛片aaaaaaa| 99国内精品久久| 欧美aaaaaa午夜精品| 亚洲欧洲国产日韩| 欧美mv和日韩mv的网站| 99国产欧美另类久久久精品| 美女高潮久久久| 一区二区三区在线免费播放| 久久综合九色综合97婷婷女人 | 爽好久久久欧美精品| 中文字幕乱码亚洲精品一区 | 久久国产日韩欧美精品| 亚洲女与黑人做爰| 久久久高清一区二区三区| 欧美少妇一区二区| 成人性色生活片免费看爆迷你毛片| 丝袜美腿成人在线| 国产精品国产三级国产普通话99| 欧美一区二区在线免费播放| 99re亚洲国产精品| 国产精品66部| 日本亚洲视频在线| 一区二区三区四区在线免费观看| 久久婷婷国产综合精品青草| 欧美三片在线视频观看| 99久久精品国产观看| 国产真实乱对白精彩久久| 日韩精品成人一区二区三区| 亚洲欧美偷拍三级| 国产精品无遮挡| 精品捆绑美女sm三区| 欧美电影影音先锋| 欧美在线影院一区二区| 99久久精品国产麻豆演员表| 国产精品亚洲а∨天堂免在线| 日本不卡中文字幕| 亚洲第一综合色| 一区二区三区自拍| 成人免费在线视频观看| 久久久久久久综合日本| 亚洲精品在线网站| 日韩一级免费观看| 9191精品国产综合久久久久久 | 日韩精品一二三四| 性做久久久久久| 亚洲午夜影视影院在线观看| 亚洲欧美在线观看| 国产精品国产精品国产专区不蜜 | 99视频超级精品| 成人va在线观看| 成人高清免费在线播放| 成人国产电影网| 成人动漫一区二区在线| 成人一区二区三区视频在线观看| 国产尤物一区二区| 国产麻豆视频精品| 国产成人在线看| 国产精一区二区三区| 国产精品一级二级三级| 国产乱人伦偷精品视频不卡| 韩国精品久久久| 国产精品综合一区二区三区| 国产精品综合久久| 成人晚上爱看视频| 99久久免费国产| 91成人在线观看喷潮| 欧美日韩午夜精品| 欧美久久婷婷综合色| 欧美一区二区在线不卡| 91精品国产全国免费观看| 日韩视频免费观看高清完整版 | 久久精品国产色蜜蜜麻豆| 美女视频一区在线观看| 久久国产精品露脸对白| 国产电影一区二区三区| 成人免费高清在线| 972aa.com艺术欧美| 在线观看av一区二区|