Make sym_change_count static, implement
        void sym_change_count_set(int)
and
        int sym_change_count(void)
 to set or get its value;
sym_change_count is only changed by void sym_change_count_set(int).
the latter can call a callback function, if a fn-pointer is set by
also new function
        void sym_change_count_changed_set(void (*fn)(int))
.

Signed-off-by: Karsten Wiese <[EMAIL PROTECTED]>


--- 2.6.18/scripts/kconfig/conf.c       2006-09-23 20:03:17.000000000 +0200
+++ 2.6.18-kw/scripts/kconfig/conf.c    2006-09-24 14:24:58.000000000 +0200
@@ -600,7 +600,7 @@ int main(int ac, char **av)
                        input_mode = ask_silent;
                        valid_stdin = 1;
                }
-       } else if (sym_change_count) {
+       } else if (sym_change_count()) {
                name = getenv("KCONFIG_NOSILENTUPDATE");
                if (name && *name) {
                        fprintf(stderr, _("\n*** Kernel configuration requires 
explicit update.\n\n"));
diff -pur 2.6.18/scripts/kconfig/confdata.c rt3-kw/scripts/kconfig/confdata.c
--- 2.6.18/scripts/kconfig/confdata.c   2006-09-23 20:03:17.000000000 +0200
+++ 2.6.18-kw/scripts/kconfig/confdata.c        2006-09-23 22:31:30.000000000 
+0200
@@ -100,7 +100,7 @@ int conf_read_simple(const char *name, i
                in = zconf_fopen(name);
                if (in)
                        goto load;
-               sym_change_count++;
+               sym_change_count_set(sym_change_count() + 1);
                if (!sym_defconfig_list)
                        return 1;
 
@@ -308,7 +308,7 @@ int conf_read(const char *name)
        struct expr *e;
        int i, flags;
 
-       sym_change_count = 0;
+       sym_change_count_set(0);
 
        if (conf_read_simple(name, S_DEF_USER))
                return 1;
@@ -360,7 +360,7 @@ int conf_read(const char *name)
                sym->flags &= flags | ~SYMBOL_DEF_USER;
        }
 
-       sym_change_count += conf_warnings || conf_unsaved;
+       sym_change_count_set(sym_change_count() + (conf_warnings || 
conf_unsaved));
 
        return 0;
 }
@@ -428,7 +428,7 @@ int conf_write(const char *name)
                     use_timestamp ? "# " : "",
                     use_timestamp ? ctime(&now) : "");
 
-       if (!sym_change_count)
+       if (!sym_change_count())
                sym_clear_all_valid();
 
        menu = rootmenu.list;
@@ -524,7 +524,7 @@ int conf_write(const char *name)
                 "# configuration written to %s\n"
                 "#\n"), newname);
 
-       sym_change_count = 0;
+       sym_change_count_set(0);
 
        return 0;
 }
diff -pur 2.6.18/scripts/kconfig/lkc_proto.h rt3-kw/scripts/kconfig/lkc_proto.h
--- 2.6.18/scripts/kconfig/lkc_proto.h  2006-09-23 20:03:17.000000000 +0200
+++ 2.6.18-kw/scripts/kconfig/lkc_proto.h       2006-09-24 14:22:19.000000000 
+0200
@@ -16,7 +16,9 @@ P(menu_get_parent_menu,struct menu *,(st
 
 /* symbol.c */
 P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]);
-P(sym_change_count,int,);
+P(sym_change_count,int,(void));
+P(sym_change_count_set,void,(int));
+P(sym_change_count_changed_set,void,(void (*fn)(int)));
 
 P(sym_lookup,struct symbol *,(const char *name, int isconst));
 P(sym_find,struct symbol *,(const char *name));
diff -pur 2.6.18/scripts/kconfig/symbol.c rt3-kw/scripts/kconfig/symbol.c
--- 2.6.18/scripts/kconfig/symbol.c     2006-09-23 20:03:17.000000000 +0200
+++ 2.6.18-kw/scripts/kconfig/symbol.c  2006-09-24 14:23:37.000000000 +0200
@@ -30,7 +30,26 @@ struct symbol symbol_yes = {
        .flags = SYMBOL_VALID,
 };
 
-int sym_change_count;
+static int _sym_change_count;
+
+static void (*sym_change_count_changed)(int count);
+
+void sym_change_count_changed_set(void (*fn)(int))
+{
+       sym_change_count_changed = fn;
+}
+
+void sym_change_count_set(int count)
+{
+       _sym_change_count = count;
+       if (sym_change_count_changed)
+               sym_change_count_changed(_sym_change_count);
+}
+int sym_change_count(void)
+{
+       return _sym_change_count;
+}
+
 struct symbol *sym_defconfig_list;
 struct symbol *modules_sym;
 tristate modules_val;
@@ -379,7 +398,7 @@ void sym_clear_all_valid(void)
 
        for_all_symbols(i, sym)
                sym->flags &= ~SYMBOL_VALID;
-       sym_change_count++;
+       sym_change_count_set(sym_change_count() + 1);
        if (modules_sym)
                sym_calc_value(modules_sym);
 }
diff -pur 2.6.18/scripts/kconfig/zconf.tab.c_shipped 
rt3-kw/scripts/kconfig/zconf.tab.c_shipped
--- 2.6.18/scripts/kconfig/zconf.tab.c_shipped  2006-09-23 20:03:17.000000000 
+0200
+++ 2.6.18-kw/scripts/kconfig/zconf.tab.c_shipped       2006-09-23 
22:28:35.000000000 +0200
@@ -2135,7 +2135,7 @@ void conf_parse(const char *name)
                sym_check_deps(sym);
         }
 
-       sym_change_count = 1;
+       sym_change_count_set(1);
 }
 
 const char *zconf_tokenname(int token)
diff -pur 2.6.18/scripts/kconfig/zconf.y rt3-kw/scripts/kconfig/zconf.y
--- 2.6.18/scripts/kconfig/zconf.y      2006-09-23 20:03:17.000000000 +0200
+++ 2.6.18-kw/scripts/kconfig/zconf.y   2006-09-23 22:25:17.000000000 +0200
@@ -504,7 +504,7 @@ void conf_parse(const char *name)
                sym_check_deps(sym);
         }
 
-       sym_change_count = 1;
+       sym_change_count_set(1);
 }
 
 const char *zconf_tokenname(int token)


        

        
                
___________________________________________________________ 
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: 
http://mail.yahoo.de


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel

Reply via email to