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

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

?? tkcond.c

?? fsmlabs的real time linux的內核
?? C
字號:
/* * tkcond.c * * Eric Youngdale was the original author of xconfig. * Michael Elizabeth Chastain (mec@shout.net) is the current maintainer. * * This file takes the tokenized statement list and transforms 'if ...' * statements.  For each simple statement, I find all of the 'if' statements * that enclose it, and attach the aggregate conditionals of those 'if' * statements to the cond list of the simple statement. * * 14 January 1999, Michael Elizabeth Chastain, <mec@shout.net> * - Steam-clean this file.  I tested this by generating kconfig.tk for *   every architecture and comparing it character-for-character against *   the output of the old tkparse. * * 07 July 1999, Andrzej M. Krzysztofowicz <ankry@mif.pg.gda.pl> * - kvariables removed; all variables are stored in a single table now * - some elimination of options non-valid for current architecture *   implemented. * - negation (!) eliminated from conditions * * TO DO: * - xconfig is at the end of its life cycle.  Contact <mec@shout.net> if *   you are interested in working on the replacement. */#include <stdio.h>#include <stdlib.h>#include <string.h>#include "tkparse.h"/* * Mark variables which are defined anywhere. */static void mark_variables( struct kconfig * scfg ){    struct kconfig * cfg;    int i;    for ( i = 1; i <= max_varnum; i++ )	vartable[i].defined = 0;    for ( cfg = scfg; cfg != NULL; cfg = cfg->next )    {	if ( cfg->token == token_bool	||   cfg->token == token_choice_item	||   cfg->token == token_define_bool	||   cfg->token == token_define_hex	||   cfg->token == token_define_int	||   cfg->token == token_define_string	||   cfg->token == token_define_tristate	||   cfg->token == token_dep_bool	||   cfg->token == token_dep_mbool	||   cfg->token == token_dep_tristate	||   cfg->token == token_hex	||   cfg->token == token_int	||   cfg->token == token_string	||   cfg->token == token_tristate	||   cfg->token == token_unset )	{	    if ( cfg->nameindex > 0 )	/* paranoid */	    {		vartable[cfg->nameindex].defined = 1;	    }	}    }}static void free_cond( struct condition *cond ){    struct condition *tmp, *tmp1;    for ( tmp = cond; tmp; tmp = tmp1 )    {	tmp1 = tmp->next;	free( (void*)tmp );    }}/* * Remove the bang operator from a condition to avoid priority problems. * "!" has different priorities as "test" command argument and in  * a tk script. */static struct condition * remove_bang( struct condition * condition ){    struct condition * conda, * condb, * prev = NULL;    for ( conda = condition; conda; conda = conda->next )    {	if ( conda->op == op_bang && conda->next &&	   ( condb = conda->next->next ) )	{	    if ( condb->op == op_eq || condb->op == op_neq )	    {		condb->op = (condb->op == op_eq) ? op_neq : op_eq;		conda->op = op_nuked;		if ( prev )		{		    prev->next = conda->next;		}		else		{		    condition = conda->next;		}		conda->next = NULL;		free_cond( conda );		conda = condb;	    }	}	prev = conda;    }    return condition;}/* * Make a new condition chain by joining the current condition stack with * the "&&" operator for glue. */static struct condition * join_condition_stack( struct condition * conditions [],    int depth ){    struct condition * cond_list;    struct condition * cond_last;    int i, is_first = 1;    cond_list = cond_last = NULL;    for ( i = 0; i < depth; i++ )    {	if ( conditions[i]->op == op_false )	{	    struct condition * cnew;	    /* It is always false condition */	    cnew = malloc( sizeof(*cnew) );	    memset( cnew, 0, sizeof(*cnew) );	    cnew->op = op_false;	    cond_list = cond_last = cnew;	    goto join_done;	}    }    for ( i = 0; i < depth; i++ )    {	struct condition * cond;	struct condition * cnew;	int add_paren;	/* omit always true conditions */	if ( conditions[i]->op == op_true )	    continue;	/* if i have another condition, add an '&&' operator */	if ( !is_first )	{	    cnew = malloc( sizeof(*cnew) );	    memset( cnew, 0, sizeof(*cnew) );	    cnew->op = op_and;	    cond_last->next = cnew;	    cond_last = cnew;	}	if ( conditions[i]->op != op_lparen )	{	    /* add a '(' */	    add_paren = 1;	    cnew = malloc( sizeof(*cnew) );	    memset( cnew, 0, sizeof(*cnew) );	    cnew->op = op_lparen;	    if ( cond_last == NULL )		{ cond_list = cond_last = cnew; }	    else		{ cond_last->next = cnew; cond_last = cnew; }	}	else	{	    add_paren = 0;	}	/* duplicate the chain */	for ( cond = conditions [i]; cond != NULL; cond = cond->next )	{	    cnew            = malloc( sizeof(*cnew) );	    cnew->next      = NULL;	    cnew->op        = cond->op;	    cnew->str       = cond->str ? strdup( cond->str ) : NULL;	    cnew->nameindex = cond->nameindex;	    if ( cond_last == NULL )		{ cond_list = cond_last = cnew; }	    else		{ cond_last->next = cnew; cond_last = cnew; }	}	if ( add_paren )	{	    /* add a ')' */	    cnew = malloc( sizeof(*cnew) );	    memset( cnew, 0, sizeof(*cnew) );	    cnew->op = op_rparen;	    cond_last->next = cnew;	    cond_last = cnew;	}	is_first = 0;    }    /*     * Remove duplicate conditions.     */    {	struct condition *cond1, *cond1b, *cond1c, *cond1d, *cond1e, *cond1f;	for ( cond1 = cond_list; cond1 != NULL; cond1 = cond1->next )	{	    if ( cond1->op == op_lparen )	    {		cond1b = cond1 ->next; if ( cond1b == NULL ) break;		cond1c = cond1b->next; if ( cond1c == NULL ) break;		cond1d = cond1c->next; if ( cond1d == NULL ) break;		cond1e = cond1d->next; if ( cond1e == NULL ) break;		cond1f = cond1e->next; if ( cond1f == NULL ) break;		if ( cond1b->op == op_variable		&& ( cond1c->op == op_eq || cond1c->op == op_neq )		&&   cond1d->op == op_constant 		&&   cond1e->op == op_rparen )		{		    struct condition *cond2, *cond2b, *cond2c, *cond2d, *cond2e, *cond2f;		    for ( cond2 = cond1f->next; cond2 != NULL; cond2 = cond2->next )		    {			if ( cond2->op == op_lparen )			{			    cond2b = cond2 ->next; if ( cond2b == NULL ) break;			    cond2c = cond2b->next; if ( cond2c == NULL ) break;			    cond2d = cond2c->next; if ( cond2d == NULL ) break;			    cond2e = cond2d->next; if ( cond2e == NULL ) break;			    cond2f = cond2e->next;			    /* look for match */			    if ( cond2b->op == op_variable			    &&   cond2b->nameindex == cond1b->nameindex			    &&   cond2c->op == cond1c->op			    &&   cond2d->op == op_constant			    &&   strcmp( cond2d->str, cond1d->str ) == 0			    &&   cond2e->op == op_rparen )			    {				/* one of these must be followed by && */				if ( cond1f->op == op_and				|| ( cond2f != NULL && cond2f->op == op_and ) )				{				    /* nuke the first duplicate */				    cond1 ->op = op_nuked;				    cond1b->op = op_nuked;				    cond1c->op = op_nuked;				    cond1d->op = op_nuked;				    cond1e->op = op_nuked;				    if ( cond1f->op == op_and )					cond1f->op = op_nuked;				    else					cond2f->op = op_nuked;				}			    }			}		    }		}	    }	}    }join_done:    return cond_list;}static char * current_arch = NULL;/* * Eliminating conditions with ARCH = <not current>. */static struct condition *eliminate_other_arch( struct condition *list ){    struct condition *cond1a = list, *cond1b = NULL, *cond1c = NULL, *cond1d = NULL;    if ( current_arch == NULL )	current_arch = getenv( "ARCH" );    if ( current_arch == NULL )    {	fprintf( stderr, "error: ARCH undefined\n" );	exit( 1 );    }    if ( cond1a->op == op_variable    && ! strcmp( vartable[cond1a->nameindex].name, "ARCH" ) )    {	cond1b = cond1a->next; if ( cond1b == NULL ) goto done;	cond1c = cond1b->next; if ( cond1c == NULL ) goto done;	cond1d = cond1c->next;	if ( cond1c->op == op_constant && cond1d == NULL )	{	    if ( (cond1b->op == op_eq && strcmp( cond1c->str, current_arch ))	    ||   (cond1b->op == op_neq && ! strcmp( cond1c->str, current_arch )) )	    {		/* This is for another architecture */ 		cond1a->op = op_false;		cond1a->next = NULL;		free_cond( cond1b );		return cond1a;	    }	    else if ( (cond1b->op == op_neq && strcmp( cond1c->str, current_arch ))		 ||   (cond1b->op == op_eq && ! strcmp( cond1c->str, current_arch )) )	    {		/* This is for current architecture */		cond1a->op = op_true;		cond1a->next = NULL;		free_cond( cond1b );		return cond1a;	    }	}	else if ( cond1c->op == op_constant && cond1d->op == op_or )	{	    if ( (cond1b->op == op_eq && strcmp( cond1c->str, current_arch ))	    ||   (cond1b->op == op_neq && ! strcmp( cond1c->str, current_arch )) )	    {		/* This is for another architecture */ 		cond1b = cond1d->next;		cond1d->next = NULL;		free_cond( cond1a );		return eliminate_other_arch( cond1b );	    }	    else if ( (cond1b->op == op_neq && strcmp( cond1c->str, current_arch ))		 || (cond1b->op == op_eq && ! strcmp( cond1c->str, current_arch )) )	    {		/* This is for current architecture */		cond1a->op = op_true;		cond1a->next = NULL;		free_cond( cond1b );		return cond1a;	    }	}	else if ( cond1c->op == op_constant && cond1d->op == op_and )	{	    if ( (cond1b->op == op_eq && strcmp( cond1c->str, current_arch ))	    ||   (cond1b->op == op_neq && ! strcmp( cond1c->str, current_arch )) )	    {		/* This is for another architecture */		int l_par = 0;				for ( cond1c = cond1d->next; cond1c; cond1c = cond1c->next )		{		    if ( cond1c->op == op_lparen )			l_par++;		    else if ( cond1c->op == op_rparen )			l_par--;		    else if ( cond1c->op == op_or && l_par == 0 )		    /* Expression too complex - don't touch */			return cond1a;		    else if ( l_par < 0 )		    {			fprintf( stderr, "incorrect condition: programming error ?\n" );			exit( 1 );		    }		}		cond1a->op = op_false;		cond1a->next = NULL;		free_cond( cond1b );		return cond1a;	    }	    else if ( (cond1b->op == op_neq && strcmp( cond1c->str, current_arch ))		 || (cond1b->op == op_eq && ! strcmp( cond1c->str, current_arch )) )	    {		/* This is for current architecture */		cond1b = cond1d->next;		cond1d->next = NULL;		free_cond( cond1a );		return eliminate_other_arch( cond1b );	    }	}    }    if ( cond1a->op == op_variable && ! vartable[cond1a->nameindex].defined )    {	cond1b = cond1a->next; if ( cond1b == NULL ) goto done;	cond1c = cond1b->next; if ( cond1c == NULL ) goto done;	cond1d = cond1c->next;	if ( cond1c->op == op_constant	&& ( cond1d == NULL || cond1d->op == op_and ) ) /*???*/	{	    if ( cond1b->op == op_eq && strcmp( cond1c->str, "" ) )	    {		cond1a->op = op_false;		cond1a->next = NULL;		free_cond( cond1b );		return cond1a;	    }	}	else if ( cond1c->op == op_constant && cond1d->op == op_or )	{	    if ( cond1b->op == op_eq && strcmp( cond1c->str, "" ) )	    {		cond1b = cond1d->next;		cond1d->next = NULL;		free_cond( cond1a );		return eliminate_other_arch( cond1b );	    }	}    }done:    return list;}/* * This is the main transformation function. */void fix_conditionals( struct kconfig * scfg ){    struct kconfig * cfg;    /*     * Transform op_variable to op_kvariable.     */    mark_variables( scfg );    /*     * Walk the statement list, maintaining a stack of current conditions.     *   token_if      push its condition onto the stack.     *   token_else    invert the condition on the top of the stack.     *   token_endif   pop the stack.     *     * For a simple statement, create a condition chain by joining together     * all of the conditions on the stack.     */    {	struct condition * cond_stack [32];	int depth = 0;	struct kconfig * prev = NULL;	for ( cfg = scfg; cfg != NULL; cfg = cfg->next )	{	    int good = 1;	    switch ( cfg->token )	    {	    default:		break;	    case token_if:		cond_stack [depth++] =		    remove_bang( eliminate_other_arch( cfg->cond ) );		cfg->cond = NULL;		break;	    case token_else:		{		    /*		     * Invert the condition chain.		     *		     * Be careful to transfrom op_or to op_and1, not op_and.		     * I will need this later in the code that removes		     * duplicate conditions.		     */		    struct condition * cond;		    for ( cond  = cond_stack [depth-1];			  cond != NULL;			  cond  = cond->next )		    {			switch( cond->op )			{			default:     break;			case op_and: cond->op = op_or;   break;			case op_or:  cond->op = op_and1; break;			case op_neq: cond->op = op_eq;   break;			case op_eq:  cond->op = op_neq;  break;			case op_true: cond->op = op_false;break;			case op_false:cond->op = op_true; break;			}		    }		}		break;	    case token_fi:		--depth;		break;	    case token_bool:	    case token_choice_item:	    case token_choice_header:	    case token_comment:	    case token_define_bool:	    case token_define_hex:	    case token_define_int:	    case token_define_string:	    case token_define_tristate:	    case token_endmenu:	    case token_hex:	    case token_int:	    case token_mainmenu_option:	    case token_string:	    case token_tristate:	    case token_unset:		cfg->cond = join_condition_stack( cond_stack, depth );		if ( cfg->cond && cfg->cond->op == op_false )		{		    good = 0;		    if ( prev )			prev->next = cfg->next;		    else			scfg = cfg->next;		}		break;	    case token_dep_bool:	    case token_dep_mbool:	    case token_dep_tristate:		/*		 * Same as the other simple statements, plus an additional		 * condition for the dependency.		 */		if ( cfg->cond )		{		    cond_stack [depth] = eliminate_other_arch( cfg->cond );		    cfg->cond = join_condition_stack( cond_stack, depth+1 );		}		else		{		    cfg->cond = join_condition_stack( cond_stack, depth );		}		if ( cfg->cond && cfg->cond->op == op_false )		{		    good = 0;		    if ( prev )			prev->next = cfg->next;		    else			scfg = cfg->next;		}		break;	    }	    if ( good )		prev = cfg;	}    }}#if 0void dump_condition( struct condition *list ){    struct condition *tmp;    for ( tmp = list; tmp; tmp = tmp->next )    {	switch (tmp->op)	{	default:	    break;	case op_variable:	    printf( " %s", vartable[tmp->nameindex].name );	    break;	case op_constant: 	    printf( " %s", tmp->str );	    break;	case op_eq:	    printf( " =" );	    break;	case op_bang:	    printf( " !" );	    break;	case op_neq:	    printf( " !=" );	    break;	case op_and:	case op_and1:	    printf( " -a" );	    break;	case op_or:	    printf( " -o" );	    break;	case op_true:	    printf( " TRUE" );	    break;	case op_false:	    printf( " FALSE" );	    break;	case op_lparen:	    printf( " (" );	    break;	case op_rparen:	    printf( " )" );	    break;	}    }    printf( "\n" );}#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人午夜视频| 色综合久久久久| 蜜臀av一区二区在线免费观看| 一区二区三区中文字幕| 136国产福利精品导航| 国产精品乱码一区二三区小蝌蚪| 亚洲精品在线观| 精品第一国产综合精品aⅴ| 精品人在线二区三区| 日韩欧美www| 日韩欧美在线影院| 精品国内片67194| 国产视频在线观看一区二区三区| 久久久www成人免费毛片麻豆 | 亚洲美女在线一区| 亚洲精品国产无套在线观| 亚洲黄色录像片| 亚洲va韩国va欧美va精品| 日韩精品欧美精品| 久草热8精品视频在线观看| 国产一区 二区| 99视频精品在线| 一本大道久久a久久精二百| 欧美日韩欧美一区二区| 91精品国产免费久久综合| 精品国产乱码久久久久久图片 | 久久久蜜臀国产一区二区| 国产精品自拍三区| 欧美三级电影网| 8x8x8国产精品| 精品伦理精品一区| 国产欧美日韩久久| 亚洲综合精品自拍| 久久成人免费日本黄色| 国产.欧美.日韩| 色婷婷久久一区二区三区麻豆| 欧美日韩日日夜夜| 国产日产欧美一区| 亚洲国产婷婷综合在线精品| 久久精品国产一区二区| 成人福利视频在线看| 欧美三级中文字幕在线观看| 亚洲精品一区二区三区福利| 国产精品久久久久久一区二区三区| 亚洲男帅同性gay1069| 日韩中文字幕一区二区三区| 国产精品亚洲视频| 欧美在线视频全部完| 精品国产乱码久久久久久图片| 亚洲天堂a在线| 精品在线播放午夜| 欧美做爰猛烈大尺度电影无法无天| 日韩一区二区不卡| 国产精品久久毛片av大全日韩| 水蜜桃久久夜色精品一区的特点 | 欧美另类久久久品| 欧美激情一区二区| 日韩精品一二区| 99精品视频一区二区| 日韩欧美中文字幕一区| 一级女性全黄久久生活片免费| 久久99国产精品久久99果冻传媒| 91一区二区三区在线播放| 精品国产网站在线观看| 亚洲一区在线观看免费| 国产 日韩 欧美大片| 欧美美女喷水视频| 亚洲日本va午夜在线电影| 狠狠狠色丁香婷婷综合久久五月| 91国产视频在线观看| 欧美国产日韩精品免费观看| 蜜臀久久久久久久| 欧美午夜片在线观看| 中文字幕不卡一区| 国内精品伊人久久久久av一坑| 欧美日韩一区二区在线视频| 国产精品卡一卡二卡三| 国产精品亚洲а∨天堂免在线| 7777精品伊人久久久大香线蕉 | 欧美性色黄大片手机版| 国产精品麻豆视频| 国产在线乱码一区二区三区| 911精品国产一区二区在线| 一区二区三区四区激情| eeuss鲁片一区二区三区在线观看| 精品国产凹凸成av人网站| 视频在线观看91| 91福利资源站| 亚洲欧美日韩人成在线播放| 成人免费视频免费观看| 国产午夜亚洲精品羞羞网站| 精品中文字幕一区二区| 欧美成人一区二区| 美日韩一区二区| 91精品国产欧美一区二区18| 日韩黄色小视频| 欧美日韩国产成人在线91| 亚洲国产另类av| 欧美性生交片4| 亚洲福利视频一区| 欧美最新大片在线看| 一区二区三区 在线观看视频| 99精品视频在线免费观看| 亚洲日本成人在线观看| 色av一区二区| 亚洲自拍都市欧美小说| 欧美色倩网站大全免费| 亚洲第一成年网| 7777精品伊人久久久大香线蕉经典版下载| 欧美一区二区视频在线观看2022| 午夜欧美在线一二页| 日韩一区二区在线观看视频 | 欧洲精品视频在线观看| 亚洲成av人片在线观看| 欧美日韩国产成人在线91| 日韩av高清在线观看| 日韩欧美国产一二三区| 久久99热99| 国产日韩一级二级三级| 成人av免费在线观看| 亚洲精品视频在线看| 欧美影视一区在线| 青青草成人在线观看| 精品欧美黑人一区二区三区| 国产盗摄一区二区| 亚洲丝袜自拍清纯另类| 欧美三级韩国三级日本三斤| 免费视频最近日韩| 国产日本亚洲高清| 色婷婷久久久久swag精品| 爽好久久久欧美精品| 久久伊99综合婷婷久久伊| a在线播放不卡| 婷婷国产在线综合| 久久综合五月天婷婷伊人| 不卡高清视频专区| 性做久久久久久久免费看| 精品国产乱码久久久久久老虎| 大尺度一区二区| 亚洲国产日日夜夜| 久久亚洲一区二区三区明星换脸 | 欧美肥大bbwbbw高潮| 韩国女主播成人在线观看| 中文字幕日韩欧美一区二区三区| 在线观看不卡一区| 国产呦萝稀缺另类资源| 亚洲美女淫视频| 久久亚洲精精品中文字幕早川悠里| 成人av网站在线观看| 丝袜美腿亚洲一区二区图片| 国产丝袜美腿一区二区三区| 欧美日韩中文字幕精品| 国产剧情av麻豆香蕉精品| 一区二区三区.www| 国产亚洲一区二区三区在线观看| 色欧美日韩亚洲| 国产另类ts人妖一区二区| 亚洲一本大道在线| 国产拍揄自揄精品视频麻豆| 欧美日韩夫妻久久| 成人一区二区在线观看| 蜜臀av一区二区在线免费观看| 亚洲日本一区二区三区| 久久青草国产手机看片福利盒子 | 国产精品区一区二区三| 91精品国产综合久久久蜜臀图片| 成人免费毛片嘿嘿连载视频| 日韩有码一区二区三区| 综合自拍亚洲综合图不卡区| 欧美不卡123| 欧美日韩高清一区二区| 一本一本久久a久久精品综合麻豆| 极品少妇xxxx精品少妇偷拍| 亚洲一区二区精品久久av| 国产精品污网站| 精品国产欧美一区二区| 欧美日韩精品久久久| 91色porny| 成人一级视频在线观看| 国内精品自线一区二区三区视频| 亚洲成a人片综合在线| 亚洲青青青在线视频| 国产日韩欧美麻豆| 欧美白人最猛性xxxxx69交| 欧美裸体一区二区三区| 欧美午夜电影网| 91一区二区在线| 91小视频在线| 国产91清纯白嫩初高中在线观看| 另类人妖一区二区av| 日韩高清不卡一区| 亚洲va欧美va天堂v国产综合| 亚洲美女视频一区| 国产精品福利影院| 国产精品免费aⅴ片在线观看| 久久久精品tv| 国产日本一区二区| 国产欧美综合色| 国产欧美精品区一区二区三区| 精品日本一线二线三线不卡|