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

Function menu_choose_blocksize

src/pblocksize.c:38–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36
37#ifdef HAVE_NCURSES
38void menu_choose_blocksize(unsigned int *blocksize, uint64_t *offset, const unsigned int sector_size)
39{
40 int command;
41 unsigned int menu=0;
42 const char *optionsBlocksize="BS512487360ACM";
43 static const struct MenuItem menuBlocksize[]=
44 {
45 {'B',"1",""},
46 {'S',"256",""},
47 {'5',"512",""},
48 {'1',"1024",""},
49 {'2',"2048",""},
50 {'4',"4096",""},
51 {'8',"8192",""},
52 {'7',"16384",""},
53 {'3',"32768",""},
54 {'6',"65536",""},
55 {'0',"128k",""},
56 {'A',"256k",""},
57 {'C',"512k",""},
58 {'M',"1M",""},
59 {0,NULL,NULL}
60 };
61 switch(sector_size)
62 {
63 case 256: optionsBlocksize+=1; break;
64 case 512: optionsBlocksize+=2; break;
65 case 1024: optionsBlocksize+=3; break;
66 case 2048: optionsBlocksize+=4; break;
67 case 4096: optionsBlocksize+=5; break;
68 case 8192: optionsBlocksize+=6; break;
69 case 16384: optionsBlocksize+=7;break;
70 case 32768: optionsBlocksize+=8; break;
71 case 65536: optionsBlocksize+=9; break;
72 case 131072: optionsBlocksize+=10; break;
73 case 262144: optionsBlocksize+=11; break;
74 case 524288: optionsBlocksize+=12; break;
75 case 1048576: optionsBlocksize+=13; break;
76 }
77 switch(*blocksize)
78 {
79 case 1: menu=0; break;
80 case 256: menu=1; break;
81 case 512: menu=2; break;
82 case 1024: menu=3; break;
83 case 2048: menu=4; break;
84 case 4096: menu=5; break;
85 case 8192: menu=6; break;
86 case 16384: menu=7; break;
87 case 32768: menu=8; break;
88 case 65536: menu=9; break;
89 case 131072: menu=10; break;
90 case 262144: menu=11; break;
91 case 524288: menu=12; break;
92 case 1048576: menu=13; break;
93 }
94 aff_copy(stdscr);
95 wmove(stdscr,INTER_PARTITION_Y-1,0);

Callers 2

photorecFunction · 0.85
fat_unformatFunction · 0.85

Calls 2

wmenuSelect_extFunction · 0.85
aff_copyFunction · 0.70

Tested by

no test coverage detected