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

Function interface_adv

src/adv.c:450–633  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

448}
449
450void interface_adv(disk_t *disk_car, const int verbose,const int dump_ind, const unsigned int expert, char**current_cmd)
451{
452 int current_element_num=0;
453#ifdef HAVE_NCURSES
454 int offset=0;
455#endif
456 int rewrite=1;
457 unsigned int menu=0;
458 list_part_t *list_part;
459 list_part_t *current_element;
460 assert(current_cmd!=NULL);
461 log_info("\nInterface Advanced\n");
462 list_part=disk_car->arch->read_part(disk_car,verbose,0);
463 /*@ assert valid_list_part(list_part); */
464 current_element=list_part;
465 log_all_partitions(disk_car, list_part);
466 while(1)
467 {
468 int command;
469#ifdef HAVE_NCURSES
470 static struct MenuItem menuAdv[]=
471 {
472 {'t',"Type","Change type, this setting will not be saved on disk"},
473 {'b',"Boot","Boot sector recovery"},
474 {'s',"Superblock",NULL},
475 {'l',"List", "List and copy files"},
476 {'u',"Undelete", "File undelete"},
477 {'c',"Image Creation", "Create an image"},
478// {'a',"Add", "Add temporary partition (Expert only)"},
479 {'q',"Quit","Return to main menu"},
480 {0,NULL,NULL}
481 };
482 const char *options;
483 int old_LINES=LINES;
484 interface_adv_ncurses(disk_car, rewrite, list_part, current_element, offset);
485#endif
486 rewrite=0;
487 if(current_element==NULL)
488 {
489#ifdef HAVE_NCURSES
490 options="q";
491#endif
492 }
493 else
494 {
495 if(menu==0 && (disk_car->arch!=&arch_none || current_element->part->upart_type!=UP_UNK))
496 menu=1;
497#ifdef HAVE_NCURSES
498 options=adv_get_options_for_partition(current_element->part);
499 menuAdv[2].desc=adv_get_boot_description(current_element->part);
500#endif
501 }
502 if(*current_cmd!=NULL)
503 {
504 command=adv_string_to_command(current_cmd, &current_element, list_part);
505 }
506 else
507 {

Callers 2

menu_disk_cliFunction · 0.85
menu_disk_ncursesFunction · 0.85

Calls 15

log_all_partitionsFunction · 0.85
interface_adv_ncursesFunction · 0.85
adv_get_boot_descriptionFunction · 0.85
adv_string_to_commandFunction · 0.85
wmenuSelect_extFunction · 0.85
part_free_listFunction · 0.85
add_partition_cliFunction · 0.85
add_partition_ncursesFunction · 0.85
adv_menu_boot_selectedFunction · 0.85
adv_menu_image_selectedFunction · 0.85

Tested by

no test coverage detected