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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? batch.c

?? DOS源碼
?? C
?? 第 1 頁 / 共 5 頁
字號(hào):
	    }

	    if(forptr->sflg)			/* Search for the next file  */
		i = ms_x_next(&forptr->search); /* file on the disk if	     */
	    else				/* FOR_SFLG otherwise get first */
		i = ms_x_first(fp, ATTR_RO, &forptr->search);

	    if(i < 0) { 			/* If the search failed      */
		forptr->sflg = NO;		/* then update the FOR	     */
		forptr->files += strlen(fp)+1;	/* pointer to the next file  */
		continue;			/* in the search list.	     */
	    }					/* and get the next  entry   */

	    fp = (BYTE *) heap();
	    strip_path(forptr->files, fp);	/* Extract the Path	     */
	    strcat(fp, forptr->search.fname);	/* and then add the matching */
	    forptr->sflg = YES; 		/* filename and update the   */
	    strupr(fp); 			/* variables.		     */
	    break;				/* Force name to uppercase   */
	}

 	s = forptr->cmd;
 	t = line;
 	while (*s && (t - line) < MAX_LINE) {	/* Copy the command 	 */
 	    if(*s == '%' && *(s+1) == forptr->forvar) { /* line looking for  */
 		s += 2; 			/* the imbedded %c and insert*/
 		bp1 = fp;			/* the current substition    */
 		while(*bp1 && (t - line) < MAX_LINE) /* string pointed at by FP   */
 		    copy_char(&t, &bp1);
 		continue;
 	    }
 
 	    copy_char(&t, &s);
 	}
 
 	*t = '\0';	 			/* and terminate the string */
}

/*.pa*/
/*
 *	BATCH FILE CONTROL ROUTINES
 *	===========================
 *
 *	The following routines provide the interface from COMMAND.COM to
 *	a batch file. BATCH_START sets up all the local variables to enable
 *	batch processing while BATCH_END terminates batch processing. BATCH_READ
 *	reads a line of data from the batch file and expands it to contain the
 *	command line variables and variables from the environment.
 */
GLOBAL VOID batch_start(argv0, path, tail)
BYTE	*argv0;			/* Invoking Command	*/ 
BYTE	*path;			/* Complete filename	*/
BYTE	*tail;			/* Command Line Options	*/
{
BYTE *s2;
BYTE	dirbuf[MAX_PATHLEN];
WORD	i;

	if(batchflg)			/* If a batch file is currently */
	    batch_close();		/* close it. So minimum number	*/
					/* of handles are used. 	*/

	s2 = path;			/* Save the original Path	*/
	if((path = d_check(path)) == NULL)  /* Check that the file	*/
	    return;			    /* exists.			*/

	batch_new();			/* new incarnation of batch	*/
	
	forptr = (FCONTROL *) NULL;	/* Disable current FOR control	*/
	for_flag = NO;			/* and Global FOR flag		*/

	/*
	 *	Generate the full path specification for the batch file
	 *	and store in the batch control information. If the user
	 *	has specified the full path use it otherwise determine the
	 *	full path using ms_x_curdir.
	 */
	if (ddrive != -1 && *path != *pathchar) {
	    ms_x_curdir(ddrive+1, dirbuf);
	    sprintf(heap(), "%c:%s%s%s%s", ddrive + 'A',
					 pathchar,
					 dirbuf,
					 (*dirbuf ? pathchar : ""),
					 path);
	}
	else if (ddrive != -1)
	    sprintf(heap(), "%c:%s", ddrive + 'A', path);
	else
	    ms_x_expand(heap(), path);

	for (i=0; i<MAX_PATHLEN; i++)	/* save the batch pathname */
	    batch->batfile[i] = heap()[i];
	batch->batfile[MAX_PATHLEN-1] = 0;

	/*
	 *	Copy the invoking command and the individual elements
	 *	of the command line into a buffer ready for processing
	 */
	batch->batcmd = (BYTE *)heap();	/* Initialize Parameter Buffer	*/
	strcpy(heap(), argv0);		/* Copy the invoking command	*/
	heap_get(strlen(heap())+1);	/* and protect the buffer	*/

	while(*tail) {			/* While there are command line */
	    s2 = (BYTE *)heap();	/* parameters copy them 	*/
	    while(*tail && strchr(batch_sep, *tail))
		tail = skip_char(tail);

	    while(*tail && !strchr(batch_sep, *tail))
		copy_char(&s2, &tail);

	    *s2++ = '\0';
	    heap_get(strlen(heap()) + 1);
	}

	*(WORD *)heap_get(2) = 0;	/* Double NULL is a terminator	 */
					/* for command line params	 */

	if(in_flag & REDIR_ACTIVE)	/* If Input redirection has been */
	    in_flag |= REDIR_BATCH;	/* enabled for this command force*/
					/* it on for the complete command*/

	if(out_flag & REDIR_ACTIVE)	/* If Output redirection has been*/
	    out_flag |= REDIR_BATCH;	/* enabled for this command force*/
					/* it on for the complete command*/


	batchflg++;			/* increment batch flag		*/

	crlfflg  = YES;			/* print CR/LF after this  */
}

GLOBAL VOID batch_endall()		/* This terminates BATCH	*/
{					/* processing by closing ALL	*/
	while(batchflg) {		/* active batch files		*/
	    batch_end();
	}
}

GLOBAL VOID batch_end()			/* This function is called for	*/
{					/* both NORMAL and ABNORMAL	*/
	if(batchflg == 0)		/* termination of batch file	*/
	    return;			/* processing			*/

	boot_key_scan_code = 0;

	batch_close();			/* Close the Batch file 	*/
	for_end();			/* Terminate Any FOR command	*/
	batch_old();			/* Restore the previous batch 	*/
					/*  control structures to heap	*/
	if(--batchflg == 0) {
	    *batch_seg_ptr = 0;
	    echoflg = echoflg_save2;	/* Restore the original ECHO	*/
	    crlfflg = YES;		/* flag and set CR/LF flag when */
	}				/* returning to the keyboard.	*/
}


MLOCAL BOOLEAN batch_open()
{
WORD	h, i;
BYTE	*name;

	if(batch->eof) {		/* If the End of the batch file */
	    batch_end();		/* was discovered last time then*/
	    return FALSE;		/* End Batch file input and exit*/
	}
	
	if(batch->stream != CLOSED)
	    return batch->stream;

	name = heap();

	for (i=0; i<MAX_PATHLEN; i++)
	    name[i] = batch->batfile[i];
	while ((h = ms_x_open(name, OPEN_READ)) < 0) {
	    err_flag = TRUE;
	    eprintf(MSG_BATMISS, name);	/* prompt for batch file    */
	    heap_get(strlen(name)+1);
	    cmd_pause("");
	    heap_set(name);
	}
	err_flag = FALSE;
	batch->stream = h;
	return TRUE;
}

GLOBAL VOID batch_close()
{
	if(batchflg != 0 && 
	       batch->stream != CLOSED) {	/* Check if the batch file  */
	    batch_cnt = 0;			/* currently open if YES    */
	    ms_x_close(batch->stream);		/* then flush the internal  */
	    batch->stream = CLOSED;		/* buffer and close file.   */
	}
}

#if defined(DOSPLUS)

GLOBAL VOID inherit_batch_file(bc)
BCONTROL FAR *bc;
{
	WORD	i;
	BYTE	FAR *p_heap;
	BYTE	*l_heap;

	/* inherit any parent batch file first */
	if (bc->bcontrol) inherit_batch_file(bc->bcontrol);

	/* create a new batch structure */
	batch_new();

	batch->offset = bc->offset;	/* continue at same offset */
	for (i=0;i<4;i++) batch->ret_offset[i] = bc->ret_offset[i];
	batch->batshift = bc->batshift;

	for (i=0; i<MAX_PATHLEN; i++)	/* get the batch pathname */
	    batch->batfile[i] = bc->batfile[i];
	batch->batfile[MAX_PATHLEN-1] = 0;
	
	/* get command line */

	p_heap = MK_FP(*parent_psp+16,bc->batcmd);
	l_heap = heap();		

	while (1) {
	     while(*p_heap) *l_heap++ = *p_heap++;
	     *l_heap++ = *p_heap++;
	     if (*p_heap == 0) {
	         *l_heap = 0;
		 break;
	     }
	}
	heap_get(l_heap-heap());

	batchflg++;
}


GLOBAL VOID inherit_parent_state()
{
	UWORD	FAR *p;
	BCONTROL FAR *bc;
	UWORD	root_psp;
	
	root_psp = *parent_psp;
	while(1) {
	    p = MK_FP(root_psp-1,8);
	    if (p[0] == 0x4F43 && p[1] == 0x4D4D &&
	        p[2] == 0x4E41 && p[3] == 0x0044) break;
	
	    p = MK_FP(root_psp,0x16);
	    root_psp = *p;
	}	              

	
	p = MK_FP(root_psp+16,batch_seg_ptr);
#if 0
	printf("batch_seg_ptr = %04X:%04X\n",p);
	printf("parent batch_seg_ptr = %04X\n",*p); 
#endif
	if (*p == 0 || *p == 0xFFFF) return;
	
	bc = MK_FP(*p,0);

	inherit_batch_file(bc);	

	*p = 0;

	p = MK_FP(root_psp+16,&echoflg);
	echoflg = *p;
}
#endif

GLOBAL VOID batch_new()
/* save current batch file heap contexts to high memory */
{
BYTE   *hp_start;
WORD	hp_size;
UWORD	i;
BCONTROL FAR *bc;
#if defined(CDOSTMP)
UWORD FAR *ptr;
#endif

	if (batchflg != 0)
	    hp_start = batch->heap_start;
	else
	    hp_start = heap();

	hp_size = heap() - hp_start;

	i = (sizeof(BCONTROL) + hp_size + 15)/16;
	mem_alloc(&bc, &i, i, i);	/* allocate new batch structure */
	
	if (i == 0) {			/* if we can't allocate one	*/
	    longjmp(break_env, IA_HEAP);/* then pretend heap has run out*/
	}				/* to force termination.        */

	bc->bcontrol = batch;		/* Link to Previous Structure	*/
	batch = bc;			/* make this current batch struc*/
	batch->eof = NO;		/* Have not found the EOF yet	*/
	batch->offset = 0L;		/* start at beginning of File	*/
	for (i=0;i<4;i++) batch->ret_offset[i] = 0L;
	batch->batshift = 0;		/* No Shift Factor		*/
	batch->stream = CLOSED;		/* Batch file is not open	*/
	batch->fcontrol = forptr;	/* Save current FOR control	*/
	batch->heap_start = hp_start;	/* Save original heap		*/
	batch->heap_size = hp_size;

	for (i=0; i < hp_size; i++) {
	    batch->save_area[i] = hp_start[i];
	}

	heap_set(hp_start);		/* free up heap used by old batch */

#if defined(CDOSTMP)
	ptr = MK_FP(pd->P_PSP, TmpPspEchoFlgPtr);
	*ptr = (UWORD)&echoflg;
	ptr = (UWORD FAR *) &ptr;	/* coerce a FAR * to local data */
	i = FP_SEG(ptr);		/* so we can get local data segment */
	ptr = MK_FP(pd->P_PSP, TmpPspDataSeg);
	*ptr = i;			/* save local data segment */
	ptr = MK_FP(pd->P_PSP, TmpPspBatchSeg);
	*ptr = (UWORD)(((ULONG)batch) >> 16);
#else
	/* Get segment address of batch and put it where novell	*/
	/* can find it.						*/

	*batch_seg_ptr = (UWORD)(((ULONG)batch) >> 16);
#endif
}


MLOCAL VOID batch_old()
/* restore current batch file heap contents from high memory */
{
BCONTROL FAR *bc;
UWORD	i;
#if defined(CDOSTMP)
UWORD FAR *ptr;
#endif

	heap_set(batch->heap_start+batch->heap_size);
	for (i=0; i<batch->heap_size; i++) {
	    batch->heap_start[i] = batch->save_area[i];
	}
	bc = batch;
	forptr = batch->fcontrol;	/* Restore the previous for	*/
	for_flag = (BOOLEAN) forptr;	/*  control structures 		*/
	batch = batch->bcontrol;	/* restore ptr to previous batch */
	mem_free(&bc);			/* free up batch memory */
#if defined(CDOSTMP)
	ptr = MK_FP(pd->P_PSP, TmpPspBatchSeg);
	*ptr = (UWORD)(((ULONG)batch) >> 16);
#endif
}

/*
 *	Read lines repeatedly from the batch file until a line in 
 *	the correct format is read from the batch file or the EOF
 *	has been reached.
 */
MLOCAL VOID batch_read(line, goto_flg)
BYTE	*line;		/* Command Line Buffer		*/
BOOLEAN goto_flg;	/* Goto Command Flag		*/
{
BYTE	*l;		/* we need to deblank line */
	do {
	    batch_line(line, goto_flg);		/* Read the next line from  */
	    l = deblank(line);			/* the batch file and return*/
	    if(*l != ';') {
		if(goto_flg && *l == ':')	/* a line in the correct    */
		    return;			/* format.		    */

		if(!goto_flg && *l != ':')
		    return;
	    }
	} while(!batch->eof);
}

/*
 *	Read one line from the batch file and place the expanded data into
 *	the buffer LINE.
 */
MLOCAL VOID batch_line(line, goto_flg)
BYTE	*line;		/* Command Line Buffer		*/
BOOLEAN goto_flg;	/* Goto Command Flag		*/
{
REG WORD i;
REG BYTE *s;
WORD	n, env_start;
BYTE	c, *bp;
BYTE	env_str[128];
BOOLEAN quote = FALSE;
LONG old_offset;
int j;

	env_start = NULL;		/* Copy the environment into a	 */

#if 0
/* 'eject any line starting with 'rem' */
	old_offset = batch->offset;
	i=0;
	do{
	 switch(c=*batch_ptr()){
	 case  0x1a: 
	            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:
    		if (i < MAX_LINE)
			line[i++] = c;
    		if (dbcs_lead(c)) {
		 if ((c = *batch_ptr()) >= ' ' && i < MAX_LINE)
	    		line[i++] = c;
		}
	 }/*switch*/
	}while(c!='\r');
	
	if (*batch_ptr() != '\n')  batch->offset--;
	 	line[i]=0;
	j=0;
	while(line[j]){
		if (line[j] != ' ')
			break;
		j++;
		}
	if (( strlwr(line[j])   == 'r') &&
    	    ( strlwr(line[j+1]) == 'e') &&
    	    ( strlwr(line[j+2]) == 'm') &&
    	    ( strlwr(line[j+3]) == ' ')){
		if (echoflg)
			printf("%s\n",line);
		line[0]='\0';  
		return;
		}

	batch->offset = old_offset;
	batch->eof    = NO;

#endif
/*rbf-end*/
	
/* process line */
	i = 0;
	do {
 	    switch(c = *batch_ptr()) {
		case '\0':			/* In OS/2 install.bat file  */
#if 0
		    if (i < MAX_LINE)		/* "ECHO \0" displays blank  */
			line[i++] = '\r';	/* line - so we insert a CR  */
		    while (c != '\r') {		/* then swallow rest of line */
			c = *batch_ptr();	/* read next character - if  */
			if (c == 0x1a)		/* it's an EOF mark then use */
			    goto end_of_file;	/* end-of-file code else end */
		    }				/* up falling into '\r' code */
#else
		    c = *batch_ptr();
		    if ((c == '\r') && (i < MAX_LINE))
			line[i++] = '\r';
#endif

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲色图第一区| 懂色av一区二区在线播放| 亚洲精品高清在线观看| 亚洲国产成人自拍| 国产午夜精品一区二区三区四区| 日韩视频国产视频| 欧美大黄免费观看| 精品国产成人在线影院| 欧美一级二级在线观看| 欧美一区二区三区不卡| 精品久久久久久综合日本欧美| 日韩三级电影网址| 2021久久国产精品不只是精品| 日韩欧美一区中文| 2023国产精品| 中文av一区二区| 一区二区三区在线视频观看| 亚洲精品国产视频| 日韩电影在线免费观看| 九色综合狠狠综合久久| 风间由美一区二区三区在线观看| 韩国午夜理伦三级不卡影院| 秋霞av亚洲一区二区三| 日韩—二三区免费观看av| 亚洲欧美偷拍三级| 亚洲欧洲国产日韩| 日韩一区欧美小说| www.亚洲人| 国产精品美女久久久久久| 国产大片一区二区| 欧美一区二区三区精品| 久久久久久久久久久久久女国产乱| 色哦色哦哦色天天综合| 这里只有精品电影| 亚洲午夜精品网| 99精品在线观看视频| 成人免费看视频| 成人综合婷婷国产精品久久免费| 欧美伊人久久大香线蕉综合69| 欧美日韩国产高清一区二区三区| 91免费版在线看| 韩国精品主播一区二区在线观看 | 一区二区三区产品免费精品久久75| 国产女主播视频一区二区| 日本一区二区高清| 中文字幕制服丝袜成人av| 中文字幕亚洲一区二区va在线| 国产精品久久久久久久久搜平片 | 久久99国产精品成人| 亚洲国产成人91porn| 高清不卡在线观看av| 欧美日韩中文字幕精品| 99在线精品免费| 国产精品一区专区| 欧美主播一区二区三区| 成人黄色av电影| 91在线观看下载| 日韩视频一区二区在线观看| 6080yy午夜一二三区久久| 日韩丝袜情趣美女图片| 亚洲国产一二三| 国产精品亚洲专一区二区三区 | 玉米视频成人免费看| 亚洲成在人线免费| 国产麻豆精品95视频| 91蝌蚪国产九色| 91精品国产综合久久久蜜臀图片| 91精品国模一区二区三区| 日韩欧美视频在线| 91精品国产91久久久久久最新毛片| 欧美日韩一级黄| 国产精品美女视频| 亚洲一区在线视频| 亚洲第一综合色| www.日本不卡| 欧美va亚洲va在线观看蝴蝶网| 亚洲麻豆国产自偷在线| 黄色日韩三级电影| 3d动漫精品啪啪| 亚洲另类在线视频| 精品一区二区久久| 欧美夫妻性生活| 一区二区三区在线观看动漫 | 国产精品影视网| 91精品婷婷国产综合久久竹菊| 一区二区在线看| 北条麻妃一区二区三区| xnxx国产精品| 捆绑紧缚一区二区三区视频| 色婷婷国产精品久久包臀| 国产精品欧美久久久久无广告| 国产在线看一区| 久久亚洲二区三区| 成人午夜电影久久影院| 久久久噜噜噜久久人人看| 久久精品国产第一区二区三区| 在线不卡一区二区| 午夜日韩在线观看| 欧美午夜精品久久久| 亚洲自拍偷拍av| 欧亚洲嫩模精品一区三区| 亚洲三级电影全部在线观看高清| 成人av在线资源网| 中文字幕中文字幕一区| 成人一区二区三区视频 | 久久99精品久久久久久| 日韩一区二区在线观看视频| 日韩av成人高清| 欧美一级免费观看| 麻豆成人免费电影| 亚洲精品在线电影| 国产精品一线二线三线精华| 亚洲综合网站在线观看| 日韩视频在线你懂得| 日韩精品一区二| 日韩一级片在线观看| 欧美视频一区二区在线观看| 九九精品一区二区| 国产精品毛片久久久久久| 欧美日韩在线三区| 成人app软件下载大全免费| 午夜久久久影院| 亚洲精品国产第一综合99久久 | 99久久99久久久精品齐齐| 国产精品女同互慰在线看| 成人app在线观看| 亚洲精品乱码久久久久久黑人| 91精品福利视频| 亚洲第一福利一区| 91精品国产综合久久蜜臀| 久久66热re国产| 国产精品国产自产拍高清av| 色综合亚洲欧洲| 丝袜诱惑制服诱惑色一区在线观看 | 国产一区二区电影| 亚洲欧美综合另类在线卡通| 日本道精品一区二区三区| 午夜久久久久久电影| 欧美r级电影在线观看| 国产成人99久久亚洲综合精品| 亚洲美女在线一区| 91精品国产91综合久久蜜臀| 国产中文一区二区三区| 国产精品护士白丝一区av| 欧美性大战xxxxx久久久| 蜜臀av性久久久久av蜜臀妖精| 国产日韩精品视频一区| 欧美在线观看视频在线| 黄网站免费久久| 亚洲综合丝袜美腿| 精品国一区二区三区| 99久免费精品视频在线观看| 日本午夜精品视频在线观看 | 视频一区视频二区中文| 精品国产乱码久久| 日本高清视频一区二区| 激情五月婷婷综合| 亚洲免费观看高清完整版在线| 91精品国产综合久久久久久 | 日韩视频在线永久播放| 91最新地址在线播放| 美女网站一区二区| 椎名由奈av一区二区三区| 欧美大肚乱孕交hd孕妇| 日本乱人伦一区| 国产一区二区中文字幕| 亚洲国产视频直播| 国产精品久久久久久久久动漫| 日韩亚洲欧美在线| 一本色道综合亚洲| 国产成人综合亚洲网站| 天堂va蜜桃一区二区三区| 亚洲欧美综合另类在线卡通| 欧美电影免费观看高清完整版在线 | 国产99久久久久| 日本中文字幕不卡| 亚洲女女做受ⅹxx高潮| 久久久久国产精品免费免费搜索| 91福利视频网站| bt欧美亚洲午夜电影天堂| 精品一区二区三区视频| 亚洲成人av在线电影| 亚洲欧洲一区二区三区| 久久亚洲一级片| 欧美大尺度电影在线| 欧美日韩国产a| 91黄色激情网站| a级精品国产片在线观看| 激情久久久久久久久久久久久久久久| 婷婷国产v国产偷v亚洲高清| 亚洲美女免费视频| 亚洲图片你懂的| 成人免费在线视频| 国产精品丝袜黑色高跟| 久久伊人中文字幕| 精品国产成人系列| 精品久久久久久亚洲综合网| 欧美一区二区三区视频免费播放 | 欧美亚洲一区二区在线| 色婷婷一区二区三区四区|