From patchwork Sun Jul 12 08:11:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cheng Renquan X-Patchwork-Id: 35239 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6C8DM4j009372 for ; Sun, 12 Jul 2009 08:13:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752470AbZGLIMd (ORCPT ); Sun, 12 Jul 2009 04:12:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753393AbZGLIMd (ORCPT ); Sun, 12 Jul 2009 04:12:33 -0400 Received: from hera.kernel.org ([140.211.167.34]:53914 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753048AbZGLIM3 (ORCPT ); Sun, 12 Jul 2009 04:12:29 -0400 Received: from hera.kernel.org (IDENT:U2FsdGVkX19oRnSVo6GGk394Rtht5QgpicOX7o8mlv0@localhost [127.0.0.1]) by hera.kernel.org (8.14.2/8.14.2) with ESMTP id n6C8BowB019687 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 12 Jul 2009 08:11:51 GMT Received: (from crq@localhost) by hera.kernel.org (8.14.2/8.13.1/Submit) id n6C8Bof9019686; Sun, 12 Jul 2009 16:11:50 +0800 From: Cheng Renquan To: linux-kbuild@vger.kernel.org, Sam Ravnborg Cc: Andrew Morton , linux-kernel@vger.kernel.org, crquan@gmail.com Subject: [PATCH 3/6] menuconfig improvements Date: Sun, 12 Jul 2009 16:11:45 +0800 Message-Id: <1247386308-19628-4-git-send-email-crq@kernel.org> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1247386308-19628-3-git-send-email-crq@kernel.org> References: <1247386308-19628-1-git-send-email-crq@kernel.org> <1247386308-19628-2-git-send-email-crq@kernel.org> <1247386308-19628-3-git-send-email-crq@kernel.org> X-Virus-Scanned: ClamAV 0.93.3/9555/Sat Jul 11 08:31:19 2009 on hera.kernel.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00, UNPARSEABLE_RELAY autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on hera.kernel.org X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (hera.kernel.org [127.0.0.1]); Sun, 12 Jul 2009 08:11:51 +0000 (UTC) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org From: Cheng Renquan The removed functions are moved into menu.c for sharing with gconfig & xconfig & config. Signed-off-by: Cheng Renquan --- scripts/kconfig/mconf.c | 78 ++--------------------------------------------- 1 files changed, 3 insertions(+), 75 deletions(-) diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 3bcacb4..4567b5e 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -199,8 +199,6 @@ inputbox_instructions_string[] = N_( setmod_text[] = N_( "This feature depends on another which has been configured as a module.\n" "As a result, this feature will be built as a module."), -nohelp_text[] = N_( - "There is no help available for this kernel option.\n"), load_config_text[] = N_( "Enter the name of the configuration file you wish to load. " "Accept the name shown to restore the configuration you " @@ -284,66 +282,6 @@ static void show_textbox(const char *title, const char *text, int r, int c); static void show_helptext(const char *title, const char *text); static void show_help(struct menu *menu); -static void get_prompt_str(struct gstr *r, struct property *prop) -{ - int i, j; - struct menu *submenu[8], *menu; - - str_printf(r, _("Prompt: %s\n"), _(prop->text)); - str_printf(r, _(" Defined at %s:%d\n"), prop->menu->file->name, - prop->menu->lineno); - if (!expr_is_yes(prop->visible.expr)) { - str_append(r, _(" Depends on: ")); - expr_gstr_print(prop->visible.expr, r); - str_append(r, "\n"); - } - menu = prop->menu->parent; - for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) - submenu[i++] = menu; - if (i > 0) { - str_printf(r, _(" Location:\n")); - for (j = 4; --i >= 0; j += 2) { - menu = submenu[i]; - str_printf(r, "%*c-> %s", j, ' ', _(menu_get_prompt(menu))); - if (menu->sym) { - str_printf(r, " (%s [=%s])", menu->sym->name ? - menu->sym->name : _(""), - sym_get_string_value(menu->sym)); - } - str_append(r, "\n"); - } - } -} - -static void get_symbol_str(struct gstr *r, struct symbol *sym) -{ - bool hit; - struct property *prop; - - if (sym && sym->name) - str_printf(r, "Symbol: %s [=%s]\n", sym->name, - sym_get_string_value(sym)); - for_all_prompts(sym, prop) - get_prompt_str(r, prop); - hit = false; - for_all_properties(sym, prop, P_SELECT) { - if (!hit) { - str_append(r, " Selects: "); - hit = true; - } else - str_printf(r, " && "); - expr_gstr_print(prop->expr, r); - } - if (hit) - str_append(r, "\n"); - if (sym->rev_dep.expr) { - str_append(r, _(" Selected by: ")); - expr_gstr_print(sym->rev_dep.expr, r); - str_append(r, "\n"); - } - str_append(r, "\n\n"); -} - static struct gstr get_relations_str(struct symbol **sym_arr) { struct symbol *sym; @@ -699,19 +637,9 @@ static void show_helptext(const char *title, const char *text) static void show_help(struct menu *menu) { struct gstr help = str_new(); - struct symbol *sym = menu->sym; - - if (menu_has_help(menu)) - { - if (sym->name) { - str_printf(&help, "CONFIG_%s:\n\n", sym->name); - str_append(&help, _(menu_get_help(menu))); - str_append(&help, "\n"); - } - } else { - str_append(&help, nohelp_text); - } - get_symbol_str(&help, sym); + + menu_get_ext_help(menu, &help); + show_helptext(_(menu_get_prompt(menu)), str_get(&help)); str_free(&help); }