Blame view

scripts/kconfig/nconf.h 1.82 KB
0c8741001   Masahiro Yamada   kconfig: convert ...
1
  /* SPDX-License-Identifier: GPL-2.0 */
692d97c38   nir.tzachar@gmail.com   kconfig: new conf...
2
  /*
0c8741001   Masahiro Yamada   kconfig: convert ...
3
   * Copyright (C) 2008 Nir Tzachar <nir.tzachar@gmail.com>
692d97c38   nir.tzachar@gmail.com   kconfig: new conf...
4
5
   *
   * Derived from menuconfig.
692d97c38   nir.tzachar@gmail.com   kconfig: new conf...
6
7
8
9
10
11
12
13
14
15
   */
  
  #include <ctype.h>
  #include <errno.h>
  #include <fcntl.h>
  #include <limits.h>
  #include <stdarg.h>
  #include <stdlib.h>
  #include <string.h>
  #include <unistd.h>
26561514c   Masahiro Yamada   kconfig: do not i...
16
  #include <ncurses.h>
692d97c38   nir.tzachar@gmail.com   kconfig: new conf...
17
18
19
20
21
22
23
  #include <menu.h>
  #include <panel.h>
  #include <form.h>
  
  #include <stdio.h>
  #include <time.h>
  #include <sys/time.h>
692d97c38   nir.tzachar@gmail.com   kconfig: new conf...
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
  #define max(a, b) ({\
  		typeof(a) _a = a;\
  		typeof(b) _b = b;\
  		_a > _b ? _a : _b; })
  
  #define min(a, b) ({\
  		typeof(a) _a = a;\
  		typeof(b) _b = b;\
  		_a < _b ? _a : _b; })
  
  typedef enum {
  	NORMAL = 1,
  	MAIN_HEADING,
  	MAIN_MENU_BOX,
  	MAIN_MENU_FORE,
  	MAIN_MENU_BACK,
  	MAIN_MENU_GREY,
  	MAIN_MENU_HEADING,
  	SCROLLWIN_TEXT,
  	SCROLLWIN_HEADING,
  	SCROLLWIN_BOX,
  	DIALOG_TEXT,
  	DIALOG_MENU_FORE,
  	DIALOG_MENU_BACK,
  	DIALOG_BOX,
  	INPUT_BOX,
  	INPUT_HEADING,
  	INPUT_TEXT,
  	INPUT_FIELD,
  	FUNCTION_TEXT,
  	FUNCTION_HIGHLIGHT,
  	ATTR_MAX
  } attributes_t;
  extern attributes_t attributes[];
  
  typedef enum {
  	F_HELP = 1,
  	F_SYMBOL = 2,
  	F_INSTS = 3,
  	F_CONF = 4,
  	F_BACK = 5,
  	F_SAVE = 6,
  	F_LOAD = 7,
a72f3e2b8   Nir Tzachar   nconfig: add sear...
67
68
  	F_SEARCH = 8,
  	F_EXIT = 9,
692d97c38   nir.tzachar@gmail.com   kconfig: new conf...
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
  } function_key;
  
  void set_colors(void);
  
  /* this changes the windows attributes !!! */
  void print_in_middle(WINDOW *win,
  		int starty,
  		int startx,
  		int width,
  		const char *string,
  		chtype color);
  int get_line_length(const char *line);
  int get_line_no(const char *text);
  const char *get_line(const char *text, int line_no);
  void fill_window(WINDOW *win, const char *text);
  int btn_dialog(WINDOW *main_window, const char *msg, int btn_num, ...);
  int dialog_inputbox(WINDOW *main_window,
  		const char *title, const char *prompt,
5ea9f64ff   Cheng Renquan   scripts/kconfig/n...
87
  		const char *init, char **resultp, int *result_len);
692d97c38   nir.tzachar@gmail.com   kconfig: new conf...
88
89
90
91
  void refresh_all_windows(WINDOW *main_window);
  void show_scroll_win(WINDOW *main_window,
  		const char *title,
  		const char *text);