MCPcopy Create free account
hub / github.com/cgsecurity/testdisk / interface_options_ncurses

Function interface_options_ncurses

src/toptions.c:39–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37
38#ifdef HAVE_NCURSES
39static void interface_options_ncurses(int *dump_ind, int *align, unsigned int *expert)
40{
41 unsigned int menu = 3;
42 /* ncurses interface */
43 while (1)
44 {
45 int car;
46 int real_key;
47 struct MenuItem menuOptions[]=
48 {
49 { 'E',NULL,"Expert mode adds some functionalities"},
50 { 'C',NULL,"Align partitions to cylinder or 1MiB boundaries" },
51 { 'D',NULL,"Dump essential sectors" },
52 { 'Q',"[ Ok ]","Done with changing options"},
53 { 0, NULL, NULL }
54 };
55 menuOptions[0].name=*expert?"Expert mode : Yes":"Expert mode : No";
56 menuOptions[1].name=*align?"Align partition: Yes":"Align partition: No";
57 menuOptions[2].name=*dump_ind?"Dump : Yes":"Dump : No";
58 aff_copy(stdscr);
59 car=wmenuSelect_ext(stdscr, 23, INTER_OPTION_Y, INTER_OPTION_X, menuOptions, 0, "ECDQ", MENU_VERT|MENU_VERT_ARROW2VALID, &menu,&real_key);
60 switch(car)
61 {
62 case 'd':
63 case 'D':
64 *dump_ind=!*dump_ind;
65 break;
66 case 'c':
67 case 'C':
68 *align=!*align;
69 break;
70 case 'e':
71 case 'E':
72 *expert=!*expert;
73 break;
74 case key_ESC:
75 case 'q':
76 case 'Q':
77 return;
78 }
79 }
80}
81#endif
82
83void interface_options(int *dump_ind, int *align, unsigned int *expert, char**current_cmd)

Callers 1

interface_optionsFunction · 0.85

Calls 2

wmenuSelect_extFunction · 0.85
aff_copyFunction · 0.70

Tested by

no test coverage detected