您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ sym_has_value函数代码示例

51自学网 2021-06-03 08:36:21
  C++
这篇教程C++ sym_has_value函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中sym_has_value函数的典型用法代码示例。如果您正苦于以下问题:C++ sym_has_value函数的具体用法?C++ sym_has_value怎么用?C++ sym_has_value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了sym_has_value函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: check_conf

static void check_conf(struct menu *menu){	struct symbol *sym;	struct menu *child;	if (!menu_is_visible(menu))		return;	sym = menu->sym;	if (!sym)		goto conf_childs;	if (sym_is_choice(sym)) {		if (!sym_has_value(sym)) {			if (!conf_cnt++)				printf("*/n* Restart config.../n*/n");			rootEntry = menu_get_parent_menu(menu);			conf(rootEntry);		}		if (sym_get_tristate_value(sym) != mod)			return;		goto conf_childs;	}	if (!sym_has_value(sym)) {		if (!conf_cnt++)			printf("*/n* Restart config.../n*/n");		rootEntry = menu_get_parent_menu(menu);		conf(rootEntry);	}conf_childs:	for (child = menu->list; child; child = child->next)		check_conf(child);}
开发者ID:mmikulicic,项目名称:acaros,代码行数:35,


示例2: conf_askvalue

static int conf_askvalue(struct symbol *sym, const char *def){    enum symbol_type type = sym_get_type(sym);    if (!sym_has_value(sym))        printf(_("(NEW) "));    line[0] = '/n';    line[1] = 0;    if (!sym_is_changable(sym)) {        printf("%s/n", def);        line[0] = '/n';        line[1] = 0;        return 0;    }    switch (input_mode) {    case ask_new:    case ask_silent:        if (sym_has_value(sym)) {            printf("%s/n", def);            return 0;        }        check_stdin();    case ask_all:        fflush(stdout);        if (NULL == fgets(line, 128, stdin)) {  //BRCM: check ret val to fix compiler warning            printf("fgets failed, exiting/n");            exit(2);        }        if (feof(stdin)) {            printf("/nEOF on std input -- exiting/n");            exit(2);        }        return 1;    default:        break;    }    switch (type) {    case S_INT:    case S_HEX:    case S_STRING:        printf("%s/n", def);        return 1;    default:        ;    }    printf("%s", line);    return 1;}
开发者ID:antonywcl,项目名称:AR-5315u_PLD,代码行数:52,


示例3: conf_askvalue

static int conf_askvalue(struct symbol *sym, const char *def){	enum symbol_type type = sym_get_type(sym);	if (!sym_has_value(sym))		printf(_("(NEW) "));	line[0] = '/n';	line[1] = 0;	if (!sym_is_changable(sym)) {		printf("%s/n", def);		line[0] = '/n';		line[1] = 0;		return 0;	}	switch (input_mode) {	case oldconfig:	case silentoldconfig:		if (sym_has_value(sym)) {			printf("%s/n", def);			return 0;		}		check_stdin();		/* fall through */	case oldaskconfig:		fflush(stdout);		xfgets(line, 128, stdin);		if (!tty_stdio)			printf("/n");		return 1;	default:		break;	}	switch (type) {	case S_INT:	case S_HEX:	case S_STRING:		printf("%s/n", def);		return 1;	default:		;	}	printf("%s", line);	return 1;}
开发者ID:JS-Wang,项目名称:linux-testing,代码行数:48,


示例4: check_conf

static void check_conf(struct menu *menu){	struct symbol *sym;	struct menu *child;	if (!menu_is_visible(menu))		return;	sym = menu->sym;	if (sym && !sym_has_value(sym)) {		if (sym_is_changable(sym) ||		    (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) {			if (input_mode == dont_ask ||			    input_mode == dont_ask_dont_tell) {				if (input_mode == dont_ask &&				    sym->name && !sym_is_choice_value(sym)) {					fprintf(stderr,"CONFIG_%s/n",sym->name);					++return_value;				}			} else {			if (!conf_cnt++)				printf(_("*/n* Restart config.../n*/n"));			rootEntry = menu_get_parent_menu(menu);			conf(rootEntry);		}	}	}	for (child = menu->list; child; child = child->next)		check_conf(child);}
开发者ID:3null,项目名称:fastsocket,代码行数:31,


示例5: check_conf

static void check_conf(struct menu *menu){	struct symbol *sym;	struct menu *child;	if (!menu_is_visible(menu))		return;	sym = menu->sym;	if (sym && !sym_has_value(sym)) {		if (sym_is_changable(sym) ||		    (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) {			if (input_mode == listnewconfig) {				if (sym->name && !sym_is_choice_value(sym)) {					printf("%s%s/n", CONFIG_, sym->name);				}			} else if (input_mode != oldnoconfig) {				if (!conf_cnt++)					printf(_("*/n* Restart config.../n*/n"));				rootEntry = menu_get_parent_menu(menu);				conf(rootEntry);			}		}	}	for (child = menu->list; child; child = child->next)		check_conf(child);}
开发者ID:LGaljo,项目名称:android_kernel_samsung_s3ve3g,代码行数:28,


示例6: conf_askvalue

static int conf_askvalue(struct symbol *sym, const char *def){	char *ret;	enum symbol_type type = sym_get_type(sym);	if (!sym_has_value(sym))		printf("(NEW) ");	line[0] = '/n';	line[1] = 0;	if (!sym_is_changable(sym)) {		printf("%s/n", def);		line[0] = '/n';		line[1] = 0;		return 0;	}	switch (input_mode) {	case ask_new:	case ask_silent:		if (sym_has_value(sym)) {			printf("%s/n", def);			return 0;		}		check_stdin();	case ask_all:		fflush(stdout);		ret = fgets(line, 128, stdin);		(void)ret;		return 1;	default:		break;	}	switch (type) {	case S_INT:	case S_HEX:	case S_STRING:		printf("%s/n", def);		return 1;	default:		;	}	printf("%s", line);	return 1;}
开发者ID:32bitmicro,项目名称:xvisor,代码行数:47,


示例7: check_conf

static void check_conf(struct menu *menu){	struct symbol *sym;	struct menu *child;	if (!menu_is_visible(menu))		return;	sym = menu->sym;	if (sym && !sym_has_value(sym)) {		if (sym_is_changable(sym) ||		    (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) {			if (!conf_cnt++)				printf(_("*/n* Restart config.../n*/n"));			rootEntry = menu_get_parent_menu(menu);			conf(rootEntry);		}	}	for (child = menu->list; child; child = child->next)		check_conf(child);}
开发者ID:0x6e3078,项目名称:toybox,代码行数:22,


示例8: check_conf

static void check_conf(struct menu *menu){	struct symbol *sym;	struct menu *child;	if (!menu_is_visible(menu))		return;	sym = menu->sym;	if (sym && !sym_has_value(sym)) {		if (sym_is_changable(sym) ||		    (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) {			if (input_mode == listnewconfig) {				if (sym->name) {					const char *str;					if (sym->type == S_STRING) {						str = sym_get_string_value(sym);						str = sym_escape_string_value(str);						printf("%s%s=%s/n", CONFIG_, sym->name, str);						free((void *)str);					} else {						str = sym_get_string_value(sym);						printf("%s%s=%s/n", CONFIG_, sym->name, str);					}				}			} else {				if (!conf_cnt++)					printf("*/n* Restart config.../n*/n");				rootEntry = menu_get_parent_menu(menu);				conf(rootEntry);			}		}	}	for (child = menu->list; child; child = child->next)		check_conf(child);}
开发者ID:krzk,项目名称:linux,代码行数:38,


示例9: conf_choice

static int conf_choice(struct menu *menu){    struct symbol *sym, *def_sym;    struct menu *child;    // int type; backported future linux patch to 2.6.30 to fix gcc4.6 compiler warning    bool is_new;    sym = menu->sym;    // type = sym_get_type(sym); see backported comment above    is_new = !sym_has_value(sym);    if (sym_is_changable(sym)) {        conf_sym(menu);        sym_calc_value(sym);        switch (sym_get_tristate_value(sym)) {        case no:            return 1;        case mod:            return 0;        case yes:            break;        }    } else {        switch (sym_get_tristate_value(sym)) {        case no:            return 1;        case mod:            printf("%*s%s/n", indent - 1, "", _(menu_get_prompt(menu)));            return 0;        case yes:            break;        }    }    while (1) {        int cnt, def;        printf("%*s%s/n", indent - 1, "", _(menu_get_prompt(menu)));        def_sym = sym_get_choice_value(sym);        cnt = def = 0;        line[0] = 0;        for (child = menu->list; child; child = child->next) {            if (!menu_is_visible(child))                continue;            if (!child->sym) {                printf("%*c %s/n", indent, '*', _(menu_get_prompt(child)));                continue;            }            cnt++;            if (child->sym == def_sym) {                def = cnt;                printf("%*c", indent, '>');            } else                printf("%*c", indent, ' ');            printf(" %d. %s", cnt, _(menu_get_prompt(child)));            if (child->sym->name)                printf(" (%s)", child->sym->name);            if (!sym_has_value(child->sym))                printf(_(" (NEW)"));            printf("/n");        }        printf(_("%*schoice"), indent - 1, "");        if (cnt == 1) {            printf("[1]: 1/n");            goto conf_childs;        }        printf("[1-%d", cnt);        if (menu_has_help(menu))            printf("?");        printf("]: ");        switch (input_mode) {        case ask_new:        case ask_silent:            if (!is_new) {                cnt = def;                printf("%d/n", cnt);                break;            }            check_stdin();        case ask_all:            fflush(stdout);            if (NULL == fgets(line, 128, stdin)) { //BRCM: check ret val to fix compiler warning                printf("fgets failed, exiting/n");                exit(2);            }            strip(line);            if (line[0] == '?') {                printf("/n%s/n", get_help(menu));                continue;            }            if (!line[0])                cnt = def;            else if (isdigit(line[0]))                cnt = atoi(line);            else                continue;            break;        default:            break;        }//.........这里部分代码省略.........
开发者ID:antonywcl,项目名称:AR-5315u_PLD,代码行数:101,


示例10: conf_choice

static int conf_choice(struct menu *menu){	struct symbol *sym, *def_sym;	struct menu *child;	bool is_new;	sym = menu->sym;	is_new = !sym_has_value(sym);	if (sym_is_changable(sym)) {		conf_sym(menu);		sym_calc_value(sym);		switch (sym_get_tristate_value(sym)) {		case no:			return 1;		case mod:			return 0;		case yes:			break;		}	} else {		switch (sym_get_tristate_value(sym)) {		case no:			return 1;		case mod:			printf("%*s%s/n", indent - 1, "", _(menu_get_prompt(menu)));			return 0;		case yes:			break;		}	}	while (1) {		int cnt, def;		printf("%*s%s/n", indent - 1, "", _(menu_get_prompt(menu)));		def_sym = sym_get_choice_value(sym);		cnt = def = 0;		line[0] = 0;		for (child = menu->list; child; child = child->next) {			if (!menu_is_visible(child))				continue;			if (!child->sym) {				printf("%*c %s/n", indent, '*', _(menu_get_prompt(child)));				continue;			}			cnt++;			if (child->sym == def_sym) {				def = cnt;				printf("%*c", indent, '>');			} else				printf("%*c", indent, ' ');			printf(" %d. %s", cnt, _(menu_get_prompt(child)));			if (child->sym->name)				printf(" (%s)", child->sym->name);			if (!sym_has_value(child->sym))				printf(_(" (NEW)"));			printf("/n");		}		printf(_("%*schoice"), indent - 1, "");		if (cnt == 1) {			printf("[1]: 1/n");			goto conf_childs;		}		printf("[1-%d", cnt);		if (menu_has_help(menu))			printf("?");		printf("]: ");		switch (input_mode) {		case oldconfig:		case silentoldconfig:			if (!is_new) {				cnt = def;				printf("%d/n", cnt);				break;			}			check_stdin();			/* fall through */		case oldaskconfig:			fflush(stdout);			xfgets(line, 128, stdin);			strip(line);			if (line[0] == '?') {				print_help(menu);				continue;			}			if (!line[0])				cnt = def;			else if (isdigit(line[0]))				cnt = atoi(line);			else				continue;			break;		default:			break;		}	conf_childs:		for (child = menu->list; child; child = child->next) {			if (!child->sym || !menu_is_visible(child))				continue;//.........这里部分代码省略.........
开发者ID:LGaljo,项目名称:android_kernel_samsung_s3ve3g,代码行数:101,


示例11: conf_askvalue

static void conf_askvalue(struct symbol *sym, const char *def){	enum symbol_type type = sym_get_type(sym);	tristate val;	if (!sym_has_value(sym))		printf("(NEW) ");	line[0] = '/n';	line[1] = 0;	if (!sym_is_changable(sym)) {		printf("%s/n", def);		line[0] = '/n';		line[1] = 0;		return;	}	switch (input_mode) {	case set_no:	case set_mod:	case set_yes:	case set_random:		if (sym_has_value(sym)) {			printf("%s/n", def);			return;		}		break;	case ask_new:	case ask_silent:		if (sym_has_value(sym)) {			printf("%s/n", def);			return;		}		check_stdin();	case ask_all:		fflush(stdout);		fgets(line, 128, stdin);		return;	case set_default:		printf("%s/n", def);		return;	default:		break;	}	switch (type) {	case S_INT:	case S_HEX:	case S_STRING:		printf("%s/n", def);		return;	default:		;	}	switch (input_mode) {	case set_yes:		if (sym_tristate_within_range(sym, yes)) {			line[0] = 'y';			line[1] = '/n';			line[2] = 0;			break;		}	case set_mod:		if (type == S_TRISTATE) {			if (sym_tristate_within_range(sym, mod)) {				line[0] = 'm';				line[1] = '/n';				line[2] = 0;				break;			}		} else {			if (sym_tristate_within_range(sym, yes)) {				line[0] = 'y';				line[1] = '/n';				line[2] = 0;				break;			}		}	case set_no:		if (sym_tristate_within_range(sym, no)) {			line[0] = 'n';			line[1] = '/n';			line[2] = 0;			break;		}	case set_random:		do {			val = (tristate)(random() % 3);		} while (!sym_tristate_within_range(sym, val));		switch (val) {		case no: line[0] = 'n'; break;		case mod: line[0] = 'm'; break;		case yes: line[0] = 'y'; break;		}		line[1] = '/n';		line[2] = 0;		break;	default:		break;//.........这里部分代码省略.........
开发者ID:0x6e3078,项目名称:toybox,代码行数:101,


示例12: conf_choice

static int conf_choice(struct menu *menu){	struct symbol *sym, *def_sym;	struct menu *child;	int type;	bool is_new;	sym = menu->sym;	type = sym_get_type(sym);	is_new = !sym_has_value(sym);	if (sym_is_changable(sym)) {		conf_sym(menu);		sym_calc_value(sym);		switch (sym_get_tristate_value(sym)) {		case no:			return 1;		case mod:			return 0;		case yes:			break;		}	} else {		switch (sym_get_tristate_value(sym)) {		case no:			return 1;		case mod:			printf("%*s%s/n", indent - 1, "", menu_get_prompt(menu));			return 0;		case yes:			break;		}	}	while (1) {		int cnt, def;		printf("%*s%s/n", indent - 1, "", menu_get_prompt(menu));		def_sym = sym_get_choice_value(sym);		cnt = def = 0;		line[0] = 0;		for (child = menu->list; child; child = child->next) {			if (!menu_is_visible(child))				continue;			if (!child->sym) {				printf("%*c %s/n", indent, '*', menu_get_prompt(child));				continue;			}			cnt++;			if (child->sym == def_sym) {				def = cnt;				printf("%*c", indent, '>');			} else				printf("%*c", indent, ' ');			printf(" %d. %s", cnt, menu_get_prompt(child));			if (child->sym->name)				printf(" (%s)", child->sym->name);			if (!sym_has_value(child->sym))				printf(" (NEW)");			printf("/n");		}		printf("%*schoice", indent - 1, "");		if (cnt == 1) {			printf("[1]: 1/n");			goto conf_childs;		}		printf("[1-%d", cnt);		if (sym->help)			printf("?");		printf("]: ");		switch (input_mode) {		case ask_new:		case ask_silent:			if (!is_new) {				cnt = def;				printf("%d/n", cnt);				break;			}			check_stdin();		case ask_all:			fflush(stdout);			fgets(line, 128, stdin);			strip(line);			if (line[0] == '?') {				printf("/n%s/n", menu->sym->help ?					menu->sym->help : nohelp_text);				continue;			}			if (!line[0])				cnt = def;			else if (isdigit(line[0]))				cnt = atoi(line);			else				continue;			break;		case set_random:			def = (random() % cnt) + 1;		case set_default:		case set_yes:		case set_mod:		case set_no://.........这里部分代码省略.........
开发者ID:0x6e3078,项目名称:toybox,代码行数:101,


示例13: build_conf

//.........这里部分代码省略.........				item_make("[%c]", val == no ? ' ' : '*');				break;			case S_TRISTATE:				switch (val) {				case yes: ch = '*'; break;				case mod: ch = 'M'; break;				default:  ch = ' '; break;				}				item_make("<%c>", ch);				break;			}			item_set_tag('t');			item_set_data(menu);		} else {			item_make("   ");			item_set_tag(def_menu ? 't' : ':');			item_set_data(menu);		}		item_add_str("%*c%s", indent + 1, ' ', _(menu_get_prompt(menu)));		if (val == yes) {			if (def_menu) {				item_add_str(" (%s)", _(menu_get_prompt(def_menu)));				item_add_str("  --->");				if (def_menu->list) {					indent += 2;					build_conf(def_menu);					indent -= 2;				}			}			return;		}	} else {		if (menu == current_menu) {			item_make("---%*c%s", indent + 1, ' ', _(menu_get_prompt(menu)));			item_set_tag(':');			item_set_data(menu);			goto conf_childs;		}		child_count++;		val = sym_get_tristate_value(sym);		if (sym_is_choice_value(sym) && val == yes) {			item_make("   ");			item_set_tag(':');			item_set_data(menu);		} else {			switch (type) {			case S_BOOLEAN:				if (sym_is_changable(sym))					item_make("[%c]", val == no ? ' ' : '*');				else					item_make("-%c-", val == no ? ' ' : '*');				item_set_tag('t');				item_set_data(menu);				break;			case S_TRISTATE:				switch (val) {				case yes: ch = '*'; break;				case mod: ch = 'M'; break;				default:  ch = ' '; break;				}				if (sym_is_changable(sym)) {					if (sym->rev_dep.tri == mod)						item_make("{%c}", ch);					else						item_make("<%c>", ch);				} else					item_make("-%c-", ch);				item_set_tag('t');				item_set_data(menu);				break;			default:				tmp = 2 + strlen(sym_get_string_value(sym)); /* () = 2 */				item_make("(%s)", sym_get_string_value(sym));				tmp = indent - tmp + 4;				if (tmp < 0)					tmp = 0;				item_add_str("%*c%s%s", tmp, ' ', _(menu_get_prompt(menu)),					     (sym_has_value(sym) || !sym_is_changable(sym)) ?					     "" : _(" (NEW)"));				item_set_tag('s');				item_set_data(menu);				goto conf_childs;			}		}		item_add_str("%*c%s%s", indent + 1, ' ', _(menu_get_prompt(menu)),			  (sym_has_value(sym) || !sym_is_changable(sym)) ?			  "" : _(" (NEW)"));		if (menu->prompt->type == P_MENU) {			item_add_str("  --->");			return;		}	}conf_childs:	indent += doint;	for (child = menu->list; child; child = child->next)		build_conf(child);	indent -= doint;}
开发者ID:16rd,项目名称:rt-n56u,代码行数:101,


示例14: conf_choice

static int conf_choice(struct menu *menu){	struct symbol *sym, *def_sym;	struct menu *cmenu, *def_menu;	const char *help;	int type, len;	bool is_new;	sym = menu->sym;	type = sym_get_type(sym);	is_new = !sym_has_value(sym);	if (sym_is_changable(sym)) {		conf_sym(menu);		sym_calc_value(sym);		switch (sym_get_tristate_value(sym)) {		case no:			return 1;		case mod:			return 0;		case yes:			break;		}	} else {		sym->def = sym->curr;		if (S_TRI(sym->curr) == mod) {			printf("%*s%s/n", indent - 1, "", menu_get_prompt(menu));			return 0;		}	}	while (1) {		printf("%*s%s ", indent - 1, "", menu_get_prompt(menu));		def_sym = sym_get_choice_value(sym);		def_menu = NULL;		for (cmenu = menu->list; cmenu; cmenu = cmenu->next) {			if (!menu_is_visible(cmenu))				continue;			printo(menu_get_prompt(cmenu));			if (cmenu->sym == def_sym)				def_menu = cmenu;		}		printo(NULL);		if (def_menu)			printf("[%s] ", menu_get_prompt(def_menu));		else {			printf("/n");			return 1;		}		switch (input_mode) {		case ask_new:		case ask_silent:		case ask_all:			if (is_new)				sym->flags |= SYMBOL_NEW;			conf_askvalue(sym, menu_get_prompt(def_menu));			strip(line);			break;		default:			line[0] = 0;			printf("/n");		}		if (line[0] == '?' && !line[1]) {			help = nohelp_text;			if (menu->sym->help)				help = menu->sym->help;			printf("/n%s/n", help);			continue;		}		if (line[0]) {			len = strlen(line);			line[len] = 0;			def_menu = NULL;			for (cmenu = menu->list; cmenu; cmenu = cmenu->next) {				if (!cmenu->sym || !menu_is_visible(cmenu))					continue;				if (!strncasecmp(line, menu_get_prompt(cmenu), len)) {					def_menu = cmenu;					break;				}			}		}		if (def_menu) {			sym_set_choice_value(sym, def_menu->sym);			if (def_menu->list) {				indent += 2;				conf(def_menu->list);				indent -= 2;			}			return 1;		}	}}
开发者ID:mmikulicic,项目名称:acaros,代码行数:93,


示例15: conf_askvalue

static void conf_askvalue(struct symbol *sym, const char *def){	enum symbol_type type = sym_get_type(sym);	tristate val;	if (!sym_has_value(sym))		printf("(NEW) ");	line[0] = '/n';	line[1] = 0;	switch (input_mode) {	case ask_new:	case ask_silent:		if (sym_has_value(sym)) {			printf("%s/n", def);			return;		}		if (!valid_stdin && input_mode == ask_silent) {			printf("aborted!/n/n");			printf("Console input/output is redirected. ");			printf("Run 'make oldconfig' to update configuration./n/n");			exit(1);		}	case ask_all:		fflush(stdout);		fgets(line, 128, stdin);		return;	case set_default:		printf("%s/n", def);		return;	default:		break;	}	switch (type) {	case S_INT:	case S_HEX:	case S_STRING:		printf("%s/n", def);		return;	default:		;	}	switch (input_mode) {	case set_yes:		if (sym_tristate_within_range(sym, yes)) {			line[0] = 'y';			line[1] = '/n';			line[2] = 0;			break;		}	case set_mod:		if (type == S_TRISTATE) {			if (sym_tristate_within_range(sym, mod)) {				line[0] = 'm';				line[1] = '/n';				line[2] = 0;				break;			}		} else {			if (sym_tristate_within_range(sym, yes)) {				line[0] = 'y';				line[1] = '/n';				line[2] = 0;				break;			}		}	case set_no:		if (sym_tristate_within_range(sym, no)) {			line[0] = 'n';			line[1] = '/n';			line[2] = 0;			break;		}	case set_random:		do {			val = (tristate)(random() % 3);		} while (!sym_tristate_within_range(sym, val));		switch (val) {		case no: line[0] = 'n'; break;		case mod: line[0] = 'm'; break;		case yes: line[0] = 'y'; break;		}		line[1] = '/n';		line[2] = 0;		break;	default:		break;	}	printf("%s", line);}
开发者ID:mmikulicic,项目名称:acaros,代码行数:92,


示例16: build_conf

//.........这里部分代码省略.........		child_count++;		for (child = menu->list; child; child = child->next) {			if (menu_is_visible(child) && child->sym == def_sym)				def_menu = child;		}		val = sym_get_tristate_value(sym);		if (sym_is_changable(sym)) {			cprint_tag("t%p", menu);			switch (type) {			case S_BOOLEAN:				cprint_name("[%c]", val == no ? ' ' : '*');				break;			case S_TRISTATE:				switch (val) {				case yes: ch = '*'; break;				case mod: ch = 'M'; break;				default:  ch = ' '; break;				}				cprint_name("<%c>", ch);				break;			}		} else {			cprint_tag("%c%p", def_menu ? 't' : ':', menu);			cprint_name("   ");		}		cprint_name("%*c%s", indent + 1, ' ', menu_get_prompt(menu));		if (val == yes) {			if (def_menu) {				cprint_name(" (%s)", menu_get_prompt(def_menu));				cprint_name("  --->");				if (def_menu->list) {					indent += 2;					build_conf(def_menu);					indent -= 2;				}			}			return;		}	} else {		if (menu == current_menu) {			cprint_tag(":%p", menu);			cprint_name("---%*c%s", indent + 1, ' ', menu_get_prompt(menu));			goto conf_childs;		}		child_count++;		val = sym_get_tristate_value(sym);		if (sym_is_choice_value(sym) && val == yes) {			cprint_tag(":%p", menu);			cprint_name("   ");		} else {			switch (type) {			case S_BOOLEAN:				cprint_tag("t%p", menu);				if (sym_is_changable(sym))					cprint_name("[%c]", val == no ? ' ' : '*');				else					cprint_name("---");				break;			case S_TRISTATE:				cprint_tag("t%p", menu);				switch (val) {				case yes: ch = '*'; break;				case mod: ch = 'M'; break;				default:  ch = ' '; break;				}				if (sym_is_changable(sym))					cprint_name("<%c>", ch);				else					cprint_name("---");				break;			default:				cprint_tag("s%p", menu);				tmp = cprint_name("(%s)", sym_get_string_value(sym));				tmp = indent - tmp + 4;				if (tmp < 0)					tmp = 0;				cprint_name("%*c%s%s", tmp, ' ', menu_get_prompt(menu),					(sym_has_value(sym) || !sym_is_changable(sym)) ?					"" : " (NEW)");				goto conf_childs;			}		}		cprint_name("%*c%s%s", indent + 1, ' ', menu_get_prompt(menu),			(sym_has_value(sym) || !sym_is_changable(sym)) ?			"" : " (NEW)");		if (menu->prompt->type == P_MENU) {			cprint_name("  --->");			return;		}	}conf_childs:	indent += doint;	for (child = menu->list; child; child = child->next)		build_conf(child);	indent -= doint;}
开发者ID:0919061,项目名称:PX4NuttX,代码行数:101,



注:本文中的sym_has_value函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ sym_is_changable函数代码示例
C++ sym_get_type函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。