+ if (!f) {
+ perror(varfile);
+ exit(EXIT_FAILURE);
+ }
+
+ int lineno = 0;
+ while (fgets(line, sizeof(line), f)) {
+ char *p = line;
+ lineno++;
+
+ if (strncmp(line, CONFIG_, strlen(CONFIG_)) == 0)
+ p += strlen(CONFIG_);
+
+ const char *sym_name = strtok(p, " =\n");
+ struct symbol *sym = sym_find(sym_name);
+ if (!sym) {
+ fprintf(stderr, "%s:%d: Invalid symbol: %s\n", varfile, lineno, sym_name);
+ exit(EXIT_FAILURE);
+ }
+ if (!(sym->flags & SYMBOL_WRITE)) {
+ fprintf(stderr, "%s:%d: Symbol %s not visible\n", varfile, lineno, sym_name);
+ exit(EXIT_FAILURE);
+ }
+ if (sym->flags & (SYMBOL_CHOICEVAL | SYMBOL_CHOICE)) {
+ fprintf(stderr, "%s:%d: Choice values not yet supported: %s", varfile, lineno, sym_name);
+ exit(EXIT_FAILURE);
+ }
+ struct property *prop;
+ const char *prompt = NULL;
+ for_all_properties(sym, prop, P_PROMPT) {
+ prompt = prop->text;
+ }
+ if (!prompt) {
+ fprintf(stderr, "%s:%d: Warning: Symbol %s is internal (has no prompt)\n", varfile, lineno, sym_name);
+ }
+ }