confdata.c (b321429325e4c911c379a5bf4156c9fc9713e425) | confdata.c (bfc10001b11e51b59ac901d17c5f05361bd2351d) |
---|---|
1/* 2 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> 3 * Released under the terms of the GNU GPL v2.0. 4 */ 5 6#include <sys/stat.h> 7#include <ctype.h> 8#include <fcntl.h> --- 86 unchanged lines hidden (view full) --- 95 in = zconf_fopen(name); 96 } else { 97 struct property *prop; 98 99 name = conf_get_configname(); 100 in = zconf_fopen(name); 101 if (in) 102 goto load; | 1/* 2 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> 3 * Released under the terms of the GNU GPL v2.0. 4 */ 5 6#include <sys/stat.h> 7#include <ctype.h> 8#include <fcntl.h> --- 86 unchanged lines hidden (view full) --- 95 in = zconf_fopen(name); 96 } else { 97 struct property *prop; 98 99 name = conf_get_configname(); 100 in = zconf_fopen(name); 101 if (in) 102 goto load; |
103 sym_change_count++; | 103 sym_add_change_count(1); |
104 if (!sym_defconfig_list) 105 return 1; 106 107 for_all_defaults(sym_defconfig_list, prop) { 108 if (expr_calc_value(prop->visible.expr) == no || 109 prop->expr->type != E_SYMBOL) 110 continue; 111 name = conf_expand_value(prop->expr->left.sym->name); --- 195 unchanged lines hidden (view full) --- 307 308int conf_read(const char *name) 309{ 310 struct symbol *sym; 311 struct property *prop; 312 struct expr *e; 313 int i, flags; 314 | 104 if (!sym_defconfig_list) 105 return 1; 106 107 for_all_defaults(sym_defconfig_list, prop) { 108 if (expr_calc_value(prop->visible.expr) == no || 109 prop->expr->type != E_SYMBOL) 110 continue; 111 name = conf_expand_value(prop->expr->left.sym->name); --- 195 unchanged lines hidden (view full) --- 307 308int conf_read(const char *name) 309{ 310 struct symbol *sym; 311 struct property *prop; 312 struct expr *e; 313 int i, flags; 314 |
315 sym_change_count = 0; | 315 sym_set_change_count(0); |
316 317 if (conf_read_simple(name, S_DEF_USER)) 318 return 1; 319 320 for_all_symbols(i, sym) { 321 sym_calc_value(sym); 322 if (sym_is_choice(sym) || (sym->flags & SYMBOL_AUTO)) 323 goto sym_ok; --- 35 unchanged lines hidden (view full) --- 359 prop = sym_get_choice_prop(sym); 360 flags = sym->flags; 361 for (e = prop->expr; e; e = e->left.expr) 362 if (e->right.sym->visible != no) 363 flags &= e->right.sym->flags; 364 sym->flags &= flags | ~SYMBOL_DEF_USER; 365 } 366 | 316 317 if (conf_read_simple(name, S_DEF_USER)) 318 return 1; 319 320 for_all_symbols(i, sym) { 321 sym_calc_value(sym); 322 if (sym_is_choice(sym) || (sym->flags & SYMBOL_AUTO)) 323 goto sym_ok; --- 35 unchanged lines hidden (view full) --- 359 prop = sym_get_choice_prop(sym); 360 flags = sym->flags; 361 for (e = prop->expr; e; e = e->left.expr) 362 if (e->right.sym->visible != no) 363 flags &= e->right.sym->flags; 364 sym->flags &= flags | ~SYMBOL_DEF_USER; 365 } 366 |
367 sym_change_count += conf_warnings || conf_unsaved; | 367 sym_add_change_count(conf_warnings || conf_unsaved); |
368 369 return 0; 370} 371 372int conf_write(const char *name) 373{ 374 FILE *out; 375 struct symbol *sym; --- 147 unchanged lines hidden (view full) --- 523 if (rename(tmpname, newname)) 524 return 1; 525 } 526 527 printf(_("#\n" 528 "# configuration written to %s\n" 529 "#\n"), newname); 530 | 368 369 return 0; 370} 371 372int conf_write(const char *name) 373{ 374 FILE *out; 375 struct symbol *sym; --- 147 unchanged lines hidden (view full) --- 523 if (rename(tmpname, newname)) 524 return 1; 525 } 526 527 printf(_("#\n" 528 "# configuration written to %s\n" 529 "#\n"), newname); 530 |
531 sym_change_count = 0; | 531 sym_set_change_count(0); |
532 533 return 0; 534} 535 536int conf_split_config(void) 537{ 538 char *name, path[128]; 539 char *s, *d, c; --- 221 unchanged lines hidden (view full) --- 761 * and this marks the successful completion of the previous steps. 762 */ 763 if (rename(".tmpconfig", name)) 764 return 1; 765 766 return 0; 767} 768 | 532 533 return 0; 534} 535 536int conf_split_config(void) 537{ 538 char *name, path[128]; 539 char *s, *d, c; --- 221 unchanged lines hidden (view full) --- 761 * and this marks the successful completion of the previous steps. 762 */ 763 if (rename(".tmpconfig", name)) 764 return 1; 765 766 return 0; 767} 768 |
769static int sym_change_count; 770 771void sym_set_change_count(int count) 772{ 773 sym_change_count = count; 774} 775 776void sym_add_change_count(int count) 777{ 778 sym_change_count += count; 779} 780 |
|
769bool conf_get_changed(void) 770{ 771 return sym_change_count; 772} | 781bool conf_get_changed(void) 782{ 783 return sym_change_count; 784} |