From e54e692ba613c2170c66ce36a3791c009680af08 Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Sun, 15 May 2011 23:42:09 -0400 Subject: kconfig: introduce specialized printer Make conf_write_symbol() grammar agnostic to be able to use it from different code path. These path pass a printer callback which will print a symbol's name and its value in different format. conf_write_symbol()'s job become mostly only to prepare a string for the printer. This avoid to have to pass specialized flag to generic functions Signed-off-by: Arnaud Lacombe [mmarek: rebased on top of de12518 (kconfig: autogenerated config_is_xxx macro)] Signed-off-by: Michal Marek --- scripts/kconfig/lkc.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scripts/kconfig/lkc.h') diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index 625ec69ebeee..306c5a59efc2 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h @@ -87,6 +87,11 @@ void sym_set_change_count(int count); void sym_add_change_count(int count); void conf_set_all_new_symbols(enum conf_def_mode mode); +struct conf_printer { + void (*print_symbol)(FILE *, struct symbol *, const char *, void *); + void (*print_comment)(FILE *, const char *, void *); +}; + /* confdata.c and expr.c */ static inline void xfwrite(const void *str, size_t len, size_t count, FILE *out) { -- cgit