mconf.c (0df8e97085946dd79c06720678a845778b6d6bf8) | mconf.c (6c07fd84977b605b6a4ceb03b38e6325974f06d6) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> 4 * 5 * Introduced single menu mode (show all sub-menus in one large tree). 6 * 2002-11-06 Petr Baudis <pasky@ucw.cz> 7 * 8 * i18n, 2005, Arnaldo Carvalho de Melo <acme@conectiva.com.br> --- 7 unchanged lines hidden (view full) --- 16#include <stdlib.h> 17#include <string.h> 18#include <strings.h> 19#include <signal.h> 20#include <unistd.h> 21 22#include "lkc.h" 23#include "lxdialog/dialog.h" | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> 4 * 5 * Introduced single menu mode (show all sub-menus in one large tree). 6 * 2002-11-06 Petr Baudis <pasky@ucw.cz> 7 * 8 * i18n, 2005, Arnaldo Carvalho de Melo <acme@conectiva.com.br> --- 7 unchanged lines hidden (view full) --- 16#include <stdlib.h> 17#include <string.h> 18#include <strings.h> 19#include <signal.h> 20#include <unistd.h> 21 22#include "lkc.h" 23#include "lxdialog/dialog.h" |
24#include "mnconf-common.h" |
|
24 25static const char mconf_readme[] = 26"Overview\n" 27"--------\n" 28"This interface lets you select features and parameters for the build.\n" 29"Features can either be built-in, modularized, or ignored. Parameters\n" 30"must be entered in as decimal or hexadecimal numbers or text.\n" 31"\n" --- 249 unchanged lines hidden (view full) --- 281 282static int indent; 283static struct menu *current_menu; 284static int child_count; 285static int single_menu_mode; 286static int show_all_options; 287static int save_and_exit; 288static int silent; | 25 26static const char mconf_readme[] = 27"Overview\n" 28"--------\n" 29"This interface lets you select features and parameters for the build.\n" 30"Features can either be built-in, modularized, or ignored. Parameters\n" 31"must be entered in as decimal or hexadecimal numbers or text.\n" 32"\n" --- 249 unchanged lines hidden (view full) --- 282 283static int indent; 284static struct menu *current_menu; 285static int child_count; 286static int single_menu_mode; 287static int show_all_options; 288static int save_and_exit; 289static int silent; |
289static int jump_key_char; | |
290 291static void conf(struct menu *menu, struct menu *active_menu); 292 293static char filename[PATH_MAX+1]; 294static void set_config_filename(const char *config_filename) 295{ 296 static char menu_backtitle[PATH_MAX+128]; 297 --- 75 unchanged lines hidden (view full) --- 373 374 help.max_width = getmaxx(stdscr) - 10; 375 menu_get_ext_help(menu, &help); 376 377 show_helptext(menu_get_prompt(menu), str_get(&help)); 378 str_free(&help); 379} 380 | 290 291static void conf(struct menu *menu, struct menu *active_menu); 292 293static char filename[PATH_MAX+1]; 294static void set_config_filename(const char *config_filename) 295{ 296 static char menu_backtitle[PATH_MAX+128]; 297 --- 75 unchanged lines hidden (view full) --- 373 374 help.max_width = getmaxx(stdscr) - 10; 375 menu_get_ext_help(menu, &help); 376 377 show_helptext(menu_get_prompt(menu), str_get(&help)); 378 str_free(&help); 379} 380 |
381struct search_data { 382 struct list_head *head; 383 struct menu *target; 384}; 385 386static int next_jump_key(int key) 387{ 388 if (key < '1' || key > '9') 389 return '1'; 390 391 key++; 392 393 if (key > '9') 394 key = '1'; 395 396 return key; 397} 398 399static int handle_search_keys(int key, size_t start, size_t end, void *_data) 400{ 401 struct search_data *data = _data; 402 struct jump_key *pos; 403 int index = 0; 404 405 if (key < '1' || key > '9') 406 return 0; 407 408 list_for_each_entry(pos, data->head, entries) { 409 index = next_jump_key(index); 410 411 if (pos->offset < start) 412 continue; 413 414 if (pos->offset >= end) 415 break; 416 417 if (key == index) { 418 data->target = pos->target; 419 return 1; 420 } 421 } 422 423 return 0; 424} 425 426int get_jump_key_char(void) 427{ 428 jump_key_char = next_jump_key(jump_key_char); 429 430 return jump_key_char; 431} 432 | |
433static void search_conf(void) 434{ 435 struct symbol **sym_arr; 436 struct gstr res; 437 struct gstr title; 438 char *dialog_input; 439 int dres, vscroll = 0, hscroll = 0; 440 bool again; --- 607 unchanged lines hidden --- | 381static void search_conf(void) 382{ 383 struct symbol **sym_arr; 384 struct gstr res; 385 struct gstr title; 386 char *dialog_input; 387 int dres, vscroll = 0, hscroll = 0; 388 bool again; --- 607 unchanged lines hidden --- |