for_all_symbols(i, sym) { sym->flags |= SYMBOL_NEW | SYMBOL_CHANGED; sym->flags &= ~SYMBOL_VALID; switch (sym->type) { case S_INT: case S_HEX: case S_STRING: if (sym->user.val) free(sym->user.val); default: sym->user.val = NULL; sym->user.tri = no; } }  while (fgets(line, sizeof(line), in)) { lineno++; sym = NULL; switch (line[0]) { case '#': if (memcmp(line + 2, "CONFIG_", 7)) continue; p = strchr(line + 9, ' '); if (!p) continue; *p++ = 0; if (strncmp(p, "is not set", 10)) continue; sym = sym_find(line + 9); if (!sym) { fprintf(stderr, "%s:%d: trying to assign nonexistent symbol %s\n", name, lineno, line + 9); break; } switch (sym->type) { case S_BOOLEAN: case S_TRISTATE: sym->user.tri = no; sym->flags &= ~SYMBOL_NEW; break; default: ; } break; case 'C': if (memcmp(line, "CONFIG_", 7)) continue; p = strchr(line + 7, '='); if (!p) continue; *p++ = 0; p2 = strchr(p, '\n'); if (p2) *p2 = 0; sym = sym_find(line + 7); if (!sym) { fprintf(stderr, "%s:%d: trying to assign nonexistent symbol %s\n", name, lineno, line + 7); break; } switch (sym->type) { case S_TRISTATE: if (p[0] == 'm') { sym->user.tri = mod; sym->flags &= ~SYMBOL_NEW; break; } case S_BOOLEAN: if (p[0] == 'y') { sym->user.tri = yes; sym->flags &= ~SYMBOL_NEW; break; } if (p[0] == 'n') { sym->user.tri = no; sym->flags &= ~SYMBOL_NEW; break; } break; case S_STRING: if (*p++ != '"') break; for (p2 = p; (p2 = strpbrk(p2, "\"\\")); p2++) { if (*p2 == '"') { *p2 = 0; break; } memmove(p2, p2 + 1, strlen(p2)); } if (!p2) { fprintf(stderr, "%s:%d: invalid string found\n", name, lineno); exit(1); } case S_INT: case S_HEX: if (sym_string_valid(sym, p)) { sym->user.val = strdup(p); sym->flags &= ~SYMBOL_NEW; } else { fprintf(stderr, "%s:%d: symbol value '%s' invalid for %s\n", name, lineno, p, sym->name); exit(1); } break; default: ; } break; case '\n': break; default: continue; } if (sym && sym_is_choice_value(sym)) { struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym)); switch (sym->user.tri) { case no: break; case mod: if (cs->user.tri == yes) /* warn? */; break; case yes: if (cs->user.tri != no) /* warn? */; cs->user.val = sym; break; } cs->user.tri = E_OR(cs->user.tri, sym->user.tri); cs->flags &= ~SYMBOL_NEW; } } fclose(in);  if (modules_sym) sym_calc_value(modules_sym); 
int conf_read(const char *name){	FILE *in = NULL;	char line[1024];	char *p, *p2;	int lineno = 0;	struct symbol *sym;	struct property *prop;	struct expr *e;	int i;	if (name) {		in = zconf_fopen(name);	} else {		const char **names = conf_confnames;		while ((name = *names++)) {			name = conf_expand_value(name);			in = zconf_fopen(name);			if (in) {				printf(_("#\n"				         "# using defaults found in %s\n"				         "#\n"), name);				break;			}		}	}	if (!in)		return 1;	for_all_symbols(i, sym) {		sym->flags |= SYMBOL_NEW | SYMBOL_CHANGED;		sym->flags &= ~SYMBOL_VALID;		switch (sym->type) {		case S_INT:		case S_HEX:		case S_STRING:			if (sym->user.val)				free(sym->user.val);		default:			sym->user.val = NULL;			sym->user.tri = no;		}	}	while (fgets(line, sizeof(line), in)) {		lineno++;		sym = NULL;		switch (line[0]) {		case '#':			if (memcmp(line + 2, "CONFIG_", 7))				continue;			p = strchr(line + 9, ' ');			if (!p)				continue;			*p++ = 0;			if (strncmp(p, "is not set", 10))				continue;			sym = sym_find(line + 9);			if (!sym) {				fprintf(stderr, "%s:%d: trying to assign nonexistent symbol %s\n", name, lineno, line + 9);				break;			}			switch (sym->type) {			case S_BOOLEAN:			case S_TRISTATE:				sym->user.tri = no;				sym->flags &= ~SYMBOL_NEW;				break;			default:				;			}			break;		case 'C':			if (memcmp(line, "CONFIG_", 7))				continue;			p = strchr(line + 7, '=');			if (!p)				continue;			*p++ = 0;			p2 = strchr(p, '\n');			if (p2)				*p2 = 0;			sym = sym_find(line + 7);			if (!sym) {				fprintf(stderr, "%s:%d: trying to assign nonexistent symbol %s\n", name, lineno, line + 7);				break;			}			switch (sym->type) {			case S_TRISTATE:				if (p[0] == 'm') {					sym->user.tri = mod;					sym->flags &= ~SYMBOL_NEW;					break;				}			case S_BOOLEAN:				if (p[0] == 'y') {					sym->user.tri = yes;					sym->flags &= ~SYMBOL_NEW;					break;				}				if (p[0] == 'n') {					sym->user.tri = no;					sym->flags &= ~SYMBOL_NEW;					break;				}				break;			case S_STRING:				if (*p++ != '"')					break;				for (p2 = p; (p2 = strpbrk(p2, "\"\\")); p2++) {					if (*p2 == '"') {						*p2 = 0;						break;					}					memmove(p2, p2 + 1, strlen(p2));				}				if (!p2) {					fprintf(stderr, "%s:%d: invalid string found\n", name, lineno);					exit(1);				}			case S_INT:			case S_HEX:				if (sym_string_valid(sym, p)) {					sym->user.val = strdup(p);					sym->flags &= ~SYMBOL_NEW;				} else {					fprintf(stderr, "%s:%d: symbol value '%s' invalid for %s\n", name, lineno, p, sym->name);					exit(1);				}				break;			default:				;			}			break;		case '\n':			break;		default:			continue;		}		if (sym && sym_is_choice_value(sym)) {			struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym));			switch (sym->user.tri) {			case no:				break;			case mod:				if (cs->user.tri == yes)					/* warn? */;				break;			case yes:				if (cs->user.tri != no)					/* warn? */;				cs->user.val = sym;				break;			}			cs->user.tri = E_OR(cs->user.tri, sym->user.tri);			cs->flags &= ~SYMBOL_NEW;		}	}	fclose(in);	if (modules_sym)		sym_calc_value(modules_sym);	for_all_symbols(i, sym) {		sym_calc_value(sym);		if (sym_has_value(sym) && !sym_is_choice_value(sym)) {			if (sym->visible == no)				sym->flags |= SYMBOL_NEW;			switch (sym->type) {			case S_STRING:			case S_INT:			case S_HEX:				if (!sym_string_within_range(sym, sym->user.val))					sym->flags |= SYMBOL_NEW;			default:				break;			}		}		if (!sym_is_choice(sym))			continue;		prop = sym_get_choice_prop(sym);		for (e = prop->expr; e; e = e->left.expr)			if (e->right.sym->visible != no)				sym->flags |= e->right.sym->flags & SYMBOL_NEW;	}	sym_change_count = 1;	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/90389160efc2864501ced6e662f9419eb7a3e6c8/confdata.c/clean/scripts/kconfig/confdata.c