- Use wprintw ncurses function instead of a custom one

- src/file_mov.c: Fix a compilation error if DEBUG_MOV is defined
This commit is contained in:
Christophe Grenier 2007-11-02 17:14:52 +01:00
parent 6d5421fd22
commit 249bad4bb7
21 changed files with 320 additions and 345 deletions

View file

@ -188,7 +188,7 @@ void interface_adv(disk_t *disk_car, const int verbose,const int dump_ind, const
{
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
if(list_part!=NULL)
mvwaddstr(stdscr,6,0,msg_PART_HEADER_LONG);
rewrite=0;
@ -216,7 +216,7 @@ void interface_adv(disk_t *disk_car, const int verbose,const int dump_ind, const
#ifdef HAVE_NCURSES
wmove(stdscr,5+2,0);
wattrset(stdscr, A_REVERSE);
wdoprintf(stdscr,"No partition available.");
wprintw(stdscr,"No partition available.");
wattroff(stdscr, A_REVERSE);
#endif
}
@ -424,7 +424,7 @@ static void dump_fat1x_ncurses(disk_t *disk_car, partition_t *partition, const u
keypad(window, TRUE); /* Need it to get arrow key */
aff_copy(window);
wmove(window,4,0);
wdoprintf(window,"%s",disk_car->description(disk_car));
wprintw(window,"%s",disk_car->description(disk_car));
wmove(window,5,0);
aff_part(window,AFF_PART_ORDER,disk_car,partition);
mvwaddstr(window,6,0, "Boot sector");
@ -473,7 +473,7 @@ int fat1x_boot_sector(disk_t *disk_car, partition_t *partition, const int verbos
#ifdef HAVE_NCURSES
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
mvwaddstr(stdscr,5,0,msg_PART_HEADER_LONG);
wmove(stdscr,6,0);
aff_part(stdscr,AFF_PART_ORDER,disk_car,partition);
@ -580,7 +580,7 @@ static void dump_fat32_ncurses(disk_t *disk_car, const partition_t *partition, c
keypad(window, TRUE); /* Need it to get arrow key */
aff_copy(window);
wmove(window,4,0);
wdoprintf(window,"%s",disk_car->description(disk_car));
wprintw(window,"%s",disk_car->description(disk_car));
wmove(window,5,0);
aff_part(window,AFF_PART_ORDER,disk_car,partition);
mvwaddstr(window,6,0, "Boot sector Backup boot sector");
@ -637,7 +637,7 @@ int fat32_boot_sector(disk_t *disk_car, partition_t *partition, const int verbos
#ifdef HAVE_NCURSES
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
mvwaddstr(stdscr,5,0,msg_PART_HEADER_LONG);
wmove(stdscr,6,0);
aff_part(stdscr,AFF_PART_ORDER,disk_car,partition);
@ -836,7 +836,7 @@ static void dump_NTFS_ncurses(disk_t *disk_car, const partition_t *partition, co
keypad(window, TRUE); /* Need it to get arrow key */
aff_copy(window);
wmove(window,4,0);
wdoprintf(window,"%s",disk_car->description(disk_car));
wprintw(window,"%s",disk_car->description(disk_car));
wmove(window,5,0);
aff_part(window,AFF_PART_ORDER,disk_car,partition);
mvwaddstr(window,6,0, "Boot sector Backup boot sector");
@ -895,7 +895,7 @@ int ntfs_boot_sector(disk_t *disk_car, partition_t *partition, const int verbose
#ifdef HAVE_NCURSES
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
mvwaddstr(stdscr,5,0,msg_PART_HEADER_LONG);
wmove(stdscr,6,0);
aff_part(stdscr,AFF_PART_ORDER,disk_car,partition);
@ -1079,7 +1079,7 @@ static void hfs_dump_ncurses(disk_t *disk_car, const partition_t *partition, con
keypad(window, TRUE); /* Need it to get arrow key */
aff_copy(window);
wmove(window,4,0);
wdoprintf(window,"%s",disk_car->description(disk_car));
wprintw(window,"%s",disk_car->description(disk_car));
wmove(window,5,0);
aff_part(window,AFF_PART_ORDER,disk_car,partition);
mvwaddstr(window,6,0, "Superblock Backup superblock");
@ -1133,7 +1133,7 @@ int HFS_HFSP_boot_sector(disk_t *disk_car, partition_t *partition, const int ver
#ifdef HAVE_NCURSES
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
mvwaddstr(stdscr,5,0,msg_PART_HEADER_LONG);
wmove(stdscr,6,0);
aff_part(stdscr,AFF_PART_ORDER,disk_car,partition);

View file

@ -279,7 +279,7 @@ list_part_t *search_superblock(disk_t *disk_car, const partition_t *partition, c
{
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
mvwaddstr(stdscr,5,0,msg_PART_HEADER_LONG);
wmove(stdscr,6,0);
aff_part(stdscr,AFF_PART_ORDER,disk_car,partition);
@ -298,7 +298,7 @@ list_part_t *search_superblock(disk_t *disk_car, const partition_t *partition, c
{
wmove(stdscr,9,0);
wclrtoeol(stdscr);
wdoprintf(stdscr,"Search EXT2/EXT3 superblock %10lu/%lu %lu%%", (long unsigned)(hd_offset/disk_car->sector_size),
wprintw(stdscr,"Search EXT2/EXT3 superblock %10lu/%lu %lu%%", (long unsigned)(hd_offset/disk_car->sector_size),
(long unsigned)(partition->part_size/disk_car->sector_size),percent);
wrefresh(stdscr);
ind_stop|=check_enter_key_or_s(stdscr);
@ -339,7 +339,7 @@ list_part_t *search_superblock(disk_t *disk_car, const partition_t *partition, c
EXT2_MIN_BLOCK_SIZE<<le32(sb->s_log_block_size));
#ifdef HAVE_NCURSES
wmove(stdscr,10+nbr_sb,0);
wdoprintf(stdscr,"Ext2 superblock found at sector %llu (block=%llu, blocksize=%u) \n",
wprintw(stdscr,"Ext2 superblock found at sector %llu (block=%llu, blocksize=%u) \n",
(long long unsigned) hd_offset/DEFAULT_SECTOR_SIZE,
(long long unsigned) hd_offset>>(EXT2_MIN_BLOCK_LOG_SIZE+le32(sb->s_log_block_size)),
EXT2_MIN_BLOCK_SIZE<<le32(sb->s_log_block_size));

View file

@ -112,7 +112,7 @@ static void change_part_type_ncurses(const disk_t *disk_car,partition_t *partiti
aff_part(stdscr,AFF_PART_ORDER,disk_car,partition);
screen_buffer_display(stdscr,"",menuType);
wmove(stdscr,23,0);
wdoprintf(stdscr,"New partition type [current %02x] ? ",partition->arch->get_part_type(partition));
wprintw(stdscr,"New partition type [current %02x] ? ",partition->arch->get_part_type(partition));
if (get_string(response, sizeof(response), NULL) > 0) {
int tmp_val = strtol(response, NULL, 16);
partition->arch->set_part_type(partition,tmp_val);

View file

@ -254,7 +254,7 @@ static long int dir_aff_ncurses(disk_t *disk_car, const partition_t *partition,
wbkgdset(window,' ' | COLOR_PAIR(0));
waddstr(window," to quit");
wmove(window,6,0);
wdoprintf(window,"Directory %s\n",dir_data->current_directory);
wprintw(window,"Directory %s\n",dir_data->current_directory);
do
{
int i;
@ -281,29 +281,29 @@ static long int dir_aff_ncurses(disk_t *disk_car, const partition_t *partition,
strncpy(datestr, " ",sizeof(datestr));
}
mode_string(current_file->filestat.st_mode,str);
wdoprintf(window, "%s %5u %5u ",
wprintw(window, "%s %5u %5u ",
str, (unsigned int)current_file->filestat.st_uid, (unsigned int)current_file->filestat.st_gid);
wdoprintf(window, "%7llu", (long long unsigned int)current_file->filestat.st_size);
wprintw(window, "%7llu", (long long unsigned int)current_file->filestat.st_size);
/* screen may overlap due to long filename */
wdoprintf(window, " %s %s", datestr, current_file->name);
wprintw(window, " %s %s", datestr, current_file->name);
if(current_file==pos)
wattroff(window, A_REVERSE);
}
wmove(window, 8-1, 51);
wclrtoeol(window);
if(offset>0)
wdoprintf(window, "Previous");
wprintw(window, "Previous");
/* Clear the last line, useful if overlapping */
wmove(window,8+i-offset,0);
wclrtoeol(window);
wmove(window, 8+INTER_DIR, 51);
wclrtoeol(window);
if(current_file!=NULL)
wdoprintf(window, "Next");
wprintw(window, "Next");
if(dir_list==NULL)
{
wmove(window,8,0);
wdoprintf(window,"No file found, filesystem seems damaged.");
wprintw(window,"No file found, filesystem seems damaged.");
}
wrefresh(window);
/* Using gnome terminal under FC3, TERM=xterm, the screen is not always correct */
@ -421,7 +421,7 @@ static long int dir_aff_ncurses(disk_t *disk_car, const partition_t *partition,
wclrtoeol(window);
if(has_colors())
wbkgdset(window,' ' | A_BOLD | COLOR_PAIR(1));
wdoprintf(window,"Copying, please wait...");
wprintw(window,"Copying, please wait...");
if(has_colors())
wbkgdset(window,' ' | COLOR_PAIR(0));
wrefresh(window);
@ -439,16 +439,16 @@ static long int dir_aff_ncurses(disk_t *disk_car, const partition_t *partition,
{
if(has_colors())
wbkgdset(window,' ' | A_BOLD | COLOR_PAIR(1));
wdoprintf(window,"Copy failed!");
wprintw(window,"Copy failed!");
}
else
{
if(has_colors())
wbkgdset(window,' ' | A_BOLD | COLOR_PAIR(2));
if(res < 0)
wdoprintf(window,"Copy done! (Failed to copy some files)");
wprintw(window,"Copy done! (Failed to copy some files)");
else
wdoprintf(window,"Copy done!");
wprintw(window,"Copy done!");
}
if(has_colors())
wbkgdset(window,' ' | COLOR_PAIR(0));

View file

@ -77,11 +77,11 @@ static void interface_editor_ncurses(disk_t *disk_car)
{
wmove(stdscr,4,0);
wclrtoeol(stdscr);
wdoprintf(stdscr,"%lu ", (unsigned long)(hd_offset/disk_car->sector_size));
wprintw(stdscr,"%lu ", (unsigned long)(hd_offset/disk_car->sector_size));
aff_LBA2CHS(disk_car,hd_offset/disk_car->sector_size);
if(disk_car->read(disk_car,disk_car->sector_size, buffer, hd_offset))
{
wdoprintf(stdscr,msg_PART_RD_ERR);
wprintw(stdscr,msg_PART_RD_ERR);
}
{
menu_pos=dump_editor(buffer,disk_car->sector_size,menu_pos);
@ -152,7 +152,7 @@ static void interface_editor_position(const disk_t *disk_car,uint64_t *lba)
if (tmp_val <= disk_car->CHS.cylinder) {
position.cylinder = tmp_val;
} else
wdoprintf(stdscr,"Illegal cylinders value");
wprintw(stdscr,"Illegal cylinders value");
}
break;
case 'h':
@ -164,7 +164,7 @@ static void interface_editor_position(const disk_t *disk_car,uint64_t *lba)
if (tmp_val <= disk_car->CHS.head) {
position.head = tmp_val;
} else
wdoprintf(stdscr,"Illegal heads value");
wprintw(stdscr,"Illegal heads value");
}
break;
case 's':
@ -176,7 +176,7 @@ static void interface_editor_position(const disk_t *disk_car,uint64_t *lba)
if (tmp_val > 0 && tmp_val <= disk_car->CHS.sector ) {
position.sector = tmp_val;
} else
wdoprintf(stdscr,"Illegal sectors value");
wprintw(stdscr,"Illegal sectors value");
}
break;
case key_ESC:
@ -215,22 +215,22 @@ static int dump_editor(const unsigned char *nom_dump,const unsigned int lng, con
{
wmove(stdscr,DUMP_Y+i-pos,DUMP_X);
wclrtoeol(stdscr);
wdoprintf(stdscr,"%04X ",i*0x10);
wprintw(stdscr,"%04X ",i*0x10);
for(j=0; j< 0x10;j++)
{
car=*(nom_dump+i*0x10+j);
wdoprintf(stdscr,"%02x", car);
wprintw(stdscr,"%02x", car);
if(j%4==(4-1))
wdoprintf(stdscr," ");
wprintw(stdscr," ");
}
wdoprintf(stdscr," ");
wprintw(stdscr," ");
for(j=0; j< 0x10;j++)
{
car=*(nom_dump+i*0x10+j);
if ((car<32)||(car >= 127))
wdoprintf(stdscr,".");
wprintw(stdscr,".");
else
wdoprintf(stdscr,"%c", car);
wprintw(stdscr,"%c", car);
}
}
switch (wmenuSelect(stdscr,INTER_DUMP_Y, INTER_DUMP_X, menuDump, 8, "PNQ", MENU_HORIZ | MENU_BUTTON | MENU_ACCEPT_OTHERS, menu))

View file

@ -103,44 +103,44 @@ static int dump_fat_info_ncurses(const struct fat_boot_sector*fh1, const upart_t
switch(upart_type)
{
case UP_FAT12:
wdoprintf(stdscr,"FAT : 12\n");
wprintw(stdscr,"FAT : 12\n");
break;
case UP_FAT16:
wdoprintf(stdscr,"FAT : 16\n");
wprintw(stdscr,"FAT : 16\n");
break;
case UP_FAT32:
wdoprintf(stdscr,"FAT : 32\n");
wprintw(stdscr,"FAT : 32\n");
break;
default:
wdoprintf(stdscr,"Not a FAT\n");
wprintw(stdscr,"Not a FAT\n");
return 0;
}
wdoprintf(stdscr,"cluster_size %u\n", fh1->cluster_size);
wdoprintf(stdscr,"reserved %u\n", le16(fh1->reserved));
wprintw(stdscr,"cluster_size %u\n", fh1->cluster_size);
wprintw(stdscr,"reserved %u\n", le16(fh1->reserved));
if(sectors(fh1)!=0)
wdoprintf(stdscr,"sectors %u\n", sectors(fh1));
wprintw(stdscr,"sectors %u\n", sectors(fh1));
if(le32(fh1->total_sect)!=0)
wdoprintf(stdscr,"total_sect %u\n", (unsigned int)le32(fh1->total_sect));
wprintw(stdscr,"total_sect %u\n", (unsigned int)le32(fh1->total_sect));
if(upart_type==UP_FAT32)
{
wdoprintf(stdscr,"fat32_length %u\n", (unsigned int)le32(fh1->fat32_length));
wdoprintf(stdscr,"root_cluster %u\n", (unsigned int)le32(fh1->root_cluster));
wdoprintf(stdscr,"flags %04X\n", le16(fh1->flags));
wdoprintf(stdscr,"version %u.%u\n", fh1->version[0], fh1->version[1]);
wdoprintf(stdscr,"root_cluster %u\n", (unsigned int)le32(fh1->root_cluster));
wdoprintf(stdscr,"info_sector %u\n", le16(fh1->info_sector));
wdoprintf(stdscr,"backup_boot %u\n", le16(fh1->backup_boot));
wprintw(stdscr,"fat32_length %u\n", (unsigned int)le32(fh1->fat32_length));
wprintw(stdscr,"root_cluster %u\n", (unsigned int)le32(fh1->root_cluster));
wprintw(stdscr,"flags %04X\n", le16(fh1->flags));
wprintw(stdscr,"version %u.%u\n", fh1->version[0], fh1->version[1]);
wprintw(stdscr,"root_cluster %u\n", (unsigned int)le32(fh1->root_cluster));
wprintw(stdscr,"info_sector %u\n", le16(fh1->info_sector));
wprintw(stdscr,"backup_boot %u\n", le16(fh1->backup_boot));
if(fat32_get_free_count((const unsigned char*)fh1,sector_size)==0xFFFFFFFF)
wdoprintf(stdscr,"free_count uninitialised\n");
wprintw(stdscr,"free_count uninitialised\n");
else
wdoprintf(stdscr,"free_count %lu\n",fat32_get_free_count((const unsigned char*)fh1,sector_size));
wprintw(stdscr,"free_count %lu\n",fat32_get_free_count((const unsigned char*)fh1,sector_size));
if(fat32_get_next_free((const unsigned char*)fh1,sector_size)==0xFFFFFFFF)
wdoprintf(stdscr,"next_free uninitialised\n");
wprintw(stdscr,"next_free uninitialised\n");
else
wdoprintf(stdscr,"next_free %lu\n",fat32_get_next_free((const unsigned char*)fh1,sector_size));
wprintw(stdscr,"next_free %lu\n",fat32_get_next_free((const unsigned char*)fh1,sector_size));
} else {
wdoprintf(stdscr,"fat_length %u\n", le16(fh1->fat_length));
wdoprintf(stdscr,"dir_entries %u\n", get_dir_entries(fh1));
wprintw(stdscr,"fat_length %u\n", le16(fh1->fat_length));
wprintw(stdscr,"dir_entries %u\n", get_dir_entries(fh1));
}
return 0;
}
@ -161,49 +161,49 @@ static int dump_2fat_info_ncurses(const struct fat_boot_sector*fh1, const struct
switch(upart_type)
{
case UP_FAT12:
wdoprintf(stdscr,"FAT : 12\n");
wprintw(stdscr,"FAT : 12\n");
break;
case UP_FAT16:
wdoprintf(stdscr,"FAT : 16\n");
wprintw(stdscr,"FAT : 16\n");
break;
case UP_FAT32:
wdoprintf(stdscr,"FAT : 32\n");
wprintw(stdscr,"FAT : 32\n");
break;
default:
wdoprintf(stdscr,"Not a FAT\n");
wprintw(stdscr,"Not a FAT\n");
return 1;
}
wdoprintf(stdscr,"cluster_size %u %u\n", fh1->cluster_size, fh2->cluster_size);
wdoprintf(stdscr,"reserved %u %u\n", le16(fh1->reserved),le16(fh2->reserved));
wprintw(stdscr,"cluster_size %u %u\n", fh1->cluster_size, fh2->cluster_size);
wprintw(stdscr,"reserved %u %u\n", le16(fh1->reserved),le16(fh2->reserved));
if(sectors(fh1)!=0 || sectors(fh2)!=0)
wdoprintf(stdscr,"sectors %u %u\n", sectors(fh1), sectors(fh2));
wprintw(stdscr,"sectors %u %u\n", sectors(fh1), sectors(fh2));
if(le32(fh1->total_sect)!=0 || le32(fh2->total_sect)!=0)
wdoprintf(stdscr,"total_sect %u %u\n", (unsigned int)le32(fh1->total_sect), (unsigned int)le32(fh2->total_sect));
wprintw(stdscr,"total_sect %u %u\n", (unsigned int)le32(fh1->total_sect), (unsigned int)le32(fh2->total_sect));
if(upart_type==UP_FAT32)
{
wdoprintf(stdscr,"fat32_length %u %u\n", (unsigned int)le32(fh1->fat32_length), (unsigned int)le32(fh2->fat32_length));
wdoprintf(stdscr,"root_cluster %u %u\n", (unsigned int)le32(fh1->root_cluster), (unsigned int)le32(fh2->root_cluster));
wdoprintf(stdscr,"free_count ");
wprintw(stdscr,"fat32_length %u %u\n", (unsigned int)le32(fh1->fat32_length), (unsigned int)le32(fh2->fat32_length));
wprintw(stdscr,"root_cluster %u %u\n", (unsigned int)le32(fh1->root_cluster), (unsigned int)le32(fh2->root_cluster));
wprintw(stdscr,"free_count ");
if(fat32_get_free_count((const unsigned char*)fh1,sector_size)==0xFFFFFFFF)
wdoprintf(stdscr,"uninitialised ");
wprintw(stdscr,"uninitialised ");
else
wdoprintf(stdscr,"%lu ",fat32_get_free_count((const unsigned char*)fh1,sector_size));
wprintw(stdscr,"%lu ",fat32_get_free_count((const unsigned char*)fh1,sector_size));
if(fat32_get_free_count((const unsigned char*)fh2,sector_size)==0xFFFFFFFF)
wdoprintf(stdscr,"uninitialised\n");
wprintw(stdscr,"uninitialised\n");
else
wdoprintf(stdscr,"%lu\n",fat32_get_free_count((const unsigned char*)fh2,sector_size));
wdoprintf(stdscr,"next_free ");
wprintw(stdscr,"%lu\n",fat32_get_free_count((const unsigned char*)fh2,sector_size));
wprintw(stdscr,"next_free ");
if(fat32_get_next_free((const unsigned char*)fh1,sector_size)==0xFFFFFFFF)
wdoprintf(stdscr,"uninitialised ");
wprintw(stdscr,"uninitialised ");
else
wdoprintf(stdscr,"%lu ",fat32_get_next_free((const unsigned char*)fh1,sector_size));
wprintw(stdscr,"%lu ",fat32_get_next_free((const unsigned char*)fh1,sector_size));
if(fat32_get_next_free((const unsigned char*)fh2,sector_size)==0xFFFFFFFF)
wdoprintf(stdscr,"uninitialised\n");
wprintw(stdscr,"uninitialised\n");
else
wdoprintf(stdscr,"%lu\n",fat32_get_next_free((const unsigned char*)fh2,sector_size));
wprintw(stdscr,"%lu\n",fat32_get_next_free((const unsigned char*)fh2,sector_size));
} else {
wdoprintf(stdscr,"fat_length %u %u\n", le16(fh1->fat_length), le16(fh2->fat_length));
wdoprintf(stdscr,"dir_entries %u %u\n", get_dir_entries(fh1), get_dir_entries(fh2));
wprintw(stdscr,"fat_length %u %u\n", le16(fh1->fat_length), le16(fh2->fat_length));
wprintw(stdscr,"dir_entries %u %u\n", get_dir_entries(fh1), get_dir_entries(fh2));
}
return 0;
}

View file

@ -203,7 +203,7 @@ static int ask_root_directory(disk_t *disk_car, const partition_t *partition, co
wmove(window,4,0);
aff_part(window,AFF_PART_ORDER,disk_car,partition);
wmove(window,6,0);
wdoprintf(window,"Answer Y(es), N(o) or A(bort interactive mode). N or A if not sure.");
wprintw(window,"Answer Y(es), N(o) or A(bort interactive mode). N or A if not sure.");
curs_set(1);
do
{
@ -229,11 +229,11 @@ static int ask_root_directory(disk_t *disk_car, const partition_t *partition, co
strncpy(datestr, " ",sizeof(datestr));
}
mode_string(current_file->filestat.st_mode,str);
wdoprintf(window, "%s %5u %5u ",
wprintw(window, "%s %5u %5u ",
str, (unsigned int)current_file->filestat.st_uid, (unsigned int)current_file->filestat.st_gid);
wdoprintf(window, "%7llu", (long long unsigned int)current_file->filestat.st_size);
wprintw(window, "%7llu", (long long unsigned int)current_file->filestat.st_size);
/* FIXME: screen overlaps due to long filename */
wdoprintf(window, " %s %s\n", datestr, current_file->name);
wprintw(window, " %s %s\n", datestr, current_file->name);
if(current_file==pos)
wattroff(window, A_REVERSE);
}
@ -243,7 +243,7 @@ static int ask_root_directory(disk_t *disk_car, const partition_t *partition, co
/* print the cluster in the loop, so */
/* the visible cursor will be at the end */
wmove(window,5,0);
wdoprintf(window,"Cluster %lu, Directory / found ? ", cluster);
wprintw(window,"Cluster %lu, Directory / found ? ", cluster);
wrefresh(window);
car=wgetch(window);
switch(car)
@ -301,7 +301,7 @@ static int ask_root_directory(disk_t *disk_car, const partition_t *partition, co
}
} while(quit==0);
curs_set(0);
wdoprintf(window,"%c\n",car);
wprintw(window,"%c\n",car);
delwin(window);
(void) clearok(stdscr, TRUE);
#ifdef HAVE_TOUCHWIN
@ -344,7 +344,7 @@ static unsigned int fat32_find_root_cluster(disk_t *disk_car,const partition_t *
{
wmove(stdscr,9,0);
wclrtoeol(stdscr);
wdoprintf(stdscr,"Search root cluster %10lu/%lu %lu%%",root_cluster,2+no_of_cluster,percent);
wprintw(stdscr,"Search root cluster %10lu/%lu %lu%%",root_cluster,2+no_of_cluster,percent);
wrefresh(stdscr);
ind_stop|=check_enter_key_or_s(stdscr);
}
@ -861,7 +861,7 @@ static void fat32_dump_ncurses(disk_t *disk_car, const partition_t *partition, c
keypad(window, TRUE); /* Need it to get arrow key */
aff_copy(window);
wmove(window,4,0);
wdoprintf(window,"%s",disk_car->description(disk_car));
wprintw(window,"%s",disk_car->description(disk_car));
wmove(window,5,0);
aff_part(window,AFF_PART_ORDER,disk_car,partition);
mvwaddstr(window,6,0, " Rebuild Boot sector Boot sector");
@ -906,7 +906,7 @@ static void menu_write_fat_boot_sector(disk_t *disk_car, partition_t *partition,
#ifdef HAVE_NCURSES
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
mvwaddstr(stdscr,5,0,msg_PART_HEADER_LONG);
wmove(stdscr,6,0);
aff_part(stdscr,AFF_PART_ORDER,disk_car,partition);
@ -916,9 +916,9 @@ static void menu_write_fat_boot_sector(disk_t *disk_car, partition_t *partition,
{
dump_2fat_info(fat_header, org_fat_header, upart_type,disk_car->sector_size);
#ifdef HAVE_NCURSES
wdoprintf(stdscr,"Extrapolated boot sector and current boot sector are different.\n");
wprintw(stdscr,"Extrapolated boot sector and current boot sector are different.\n");
if(error)
wdoprintf(stdscr,"Warning: Extrapolated boot sector have incorrect values.\n");
wprintw(stdscr,"Warning: Extrapolated boot sector have incorrect values.\n");
#endif
if(error)
log_error("Warning: Extrapolated boot sector have incorrect values.\n");
@ -928,7 +928,7 @@ static void menu_write_fat_boot_sector(disk_t *disk_car, partition_t *partition,
{
dump_fat_info(fat_header, upart_type,disk_car->sector_size);
#ifdef HAVE_NCURSES
wdoprintf(stdscr,"Extrapolated boot sector and current boot sector are identical.\n");
wprintw(stdscr,"Extrapolated boot sector and current boot sector are identical.\n");
#endif
}
if(*current_cmd!=NULL)
@ -1529,7 +1529,7 @@ static int fat_find_type(disk_t *disk_car,const partition_t *partition,const uin
if(interface)
{
wmove(stdscr,8,0);
wdoprintf(stdscr,"FAT : %s%s%s?\n",p_fat12?"12 ":"", p_fat16?"16 ":"", p_fat32?"32 ":"");
wprintw(stdscr,"FAT : %s%s%s?\n",p_fat12?"12 ":"", p_fat16?"16 ":"", p_fat32?"32 ":"");
wmove(stdscr,22,0);
wattrset(stdscr, A_REVERSE);
waddstr(stdscr," Stop ");
@ -1546,7 +1546,7 @@ static int fat_find_type(disk_t *disk_car,const partition_t *partition,const uin
{
wmove(stdscr,8,30);
wclrtoeol(stdscr); /* before addstr for BSD compatibility */
wdoprintf(stdscr,"Searching for FAT table %lu%%",percent);
wprintw(stdscr,"Searching for FAT table %lu%%",percent);
old_percent=percent;
wrefresh(stdscr);
ind_stop|=check_enter_key_or_s(stdscr);
@ -1883,7 +1883,7 @@ static int find_cluster_size(disk_t *disk_car, partition_t *partition, const int
{
wmove(stdscr,9,0);
wclrtoeol(stdscr);
wdoprintf(stdscr,"Search subdirectory %10lu/%lu %u",(unsigned long)(offset/disk_car->sector_size),(unsigned long)(partition->part_size/disk_car->sector_size),nbr_subdir);
wprintw(stdscr,"Search subdirectory %10lu/%lu %u",(unsigned long)(offset/disk_car->sector_size),(unsigned long)(partition->part_size/disk_car->sector_size),nbr_subdir);
wrefresh(stdscr);
ind_stop|=check_enter_key_or_s(stdscr);
}
@ -2101,7 +2101,7 @@ int rebuild_FAT_BS(disk_t *disk_car, partition_t *partition, const int verbose,
{
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
mvwaddstr(stdscr,5,0,msg_PART_HEADER_LONG);
wmove(stdscr,6,0);
aff_part(stdscr,AFF_PART_ORDER,disk_car,partition);
@ -2114,7 +2114,7 @@ int rebuild_FAT_BS(disk_t *disk_car, partition_t *partition, const int verbose,
{
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
mvwaddstr(stdscr,5,0,msg_PART_HEADER_LONG);
wmove(stdscr,6,0);
aff_part(stdscr,AFF_PART_ORDER,disk_car,partition);
@ -2510,7 +2510,7 @@ int repair_FAT_table(disk_t *disk_car, partition_t *partition, const int verbose
if(percent!=old_percent)
{
wmove(window,4,0);
wdoprintf(window,"Checking FAT %lu%%",percent);
wprintw(window,"Checking FAT %lu%%",percent);
wrefresh(window);
old_percent=percent;
}

View file

@ -228,10 +228,7 @@ static int data_check_mov(const unsigned char *buffer, const unsigned int buffer
}
}
#ifdef DEBUG_MOV
log_trace("file_mov.c: atom %c%c%c%c (0x%02x%02x%02x%02x) size %u, new calculated_file_size %llu\n",
buffer[i+4],buffer[i+5],buffer[i+6],buffer[i+7],
buffer[i+4],buffer[i+5],buffer[i+6],buffer[i+7],
atom_size,
log_trace("file_mov.c: new calculated_file_size %llu\n",
(long long unsigned)file_recovery->calculated_file_size);
#endif
return 1;

View file

@ -162,19 +162,19 @@ static void change_geometry_ncurses(disk_t *disk_car)
};
aff_copy(stdscr);
wmove(stdscr,5,0);
wdoprintf(stdscr,"%s, sector size=%u\n",disk_car->description(disk_car),disk_car->sector_size);
wprintw(stdscr,"%s, sector size=%u\n",disk_car->description(disk_car),disk_car->sector_size);
wmove(stdscr,7,0);
wdoprintf(stdscr,"Because these numbers change the way that TestDisk looks for partitions");
wprintw(stdscr,"Because these numbers change the way that TestDisk looks for partitions");
wmove(stdscr,8,0);
wdoprintf(stdscr,"and calculates their sizes, it's important to have the correct disk geometry.");
wprintw(stdscr,"and calculates their sizes, it's important to have the correct disk geometry.");
wmove(stdscr,9,0);
wdoprintf(stdscr,"PC partitioning programs often make partitions end on cylinder boundaries.");
wprintw(stdscr,"PC partitioning programs often make partitions end on cylinder boundaries.");
wmove(stdscr,11,0);
wdoprintf(stdscr,"A partition's CHS values are based on disk translations which make them");
wprintw(stdscr,"A partition's CHS values are based on disk translations which make them");
wmove(stdscr,12,0);
wdoprintf(stdscr,"different than its physical geometry. The most common CHS head values");
wprintw(stdscr,"different than its physical geometry. The most common CHS head values");
wmove(stdscr,13,0);
wdoprintf(stdscr,"are: 255, 240 and sometimes 16.");
wprintw(stdscr,"are: 255, 240 and sometimes 16.");
wmove(stdscr,INTER_GEOM_Y, INTER_GEOM_X);
wclrtoeol(stdscr);
wrefresh(stdscr);
@ -192,7 +192,7 @@ static void change_geometry_ncurses(disk_t *disk_car)
cyl_modified=1;
geo_modified=1;
} else
wdoprintf(stdscr,"Illegal cylinders value");
wprintw(stdscr,"Illegal cylinders value");
}
}
default_option=1;
@ -212,7 +212,7 @@ static void change_geometry_ncurses(disk_t *disk_car)
disk_car->CHS.cylinder=(((disk_car->disk_size/disk_car->sector_size+disk_car->CHS.head)/(disk_car->CHS.head+1))+disk_car->CHS.sector-1)/disk_car->CHS.sector-1;
}
} else
wdoprintf(stdscr,"Illegal heads value");
wprintw(stdscr,"Illegal heads value");
}
}
default_option=2;
@ -235,7 +235,7 @@ static void change_geometry_ncurses(disk_t *disk_car)
disk_car->CHS.cylinder=(disk_car->disk_size/disk_car->sector_size/(disk_car->CHS.head+1))/disk_car->CHS.sector-1;
}
} else
wdoprintf(stdscr,"Illegal sectors value");
wprintw(stdscr,"Illegal sectors value");
}
}
default_option=3;
@ -256,7 +256,7 @@ static void change_geometry_ncurses(disk_t *disk_car)
disk_car->CHS.cylinder=(disk_car->disk_size/disk_car->sector_size/(disk_car->CHS.head+1))/disk_car->CHS.sector-1;
}
} else
wdoprintf(stdscr,"Illegal sector size");
wprintw(stdscr,"Illegal sector size");
}
}
default_option=4;

View file

@ -127,34 +127,34 @@ static int interface_part_bad_ncurses(disk_t *disk_car, list_part_t *list_part)
}
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
wmove(stdscr,6,0);
{
char buffer_disk_size[100];
char buffer_disk_size_found[100];
wdoprintf(stdscr,"The harddisk (%s) seems too small! (< %s)",
wprintw(stdscr,"The harddisk (%s) seems too small! (< %s)",
size_to_unit(disk_car->disk_size,buffer_disk_size), size_to_unit(disk_size,buffer_disk_size_found));
}
wmove(stdscr,7,0);
wdoprintf(stdscr,"Check the harddisk size: HD jumpers settings, BIOS detection...");
wprintw(stdscr,"Check the harddisk size: HD jumpers settings, BIOS detection...");
#if defined(__CYGWIN__) || defined(__MINGW32__)
if(disk_car->disk_size<=((uint64_t)1<<(28-1)) && disk_size>=((uint64_t)1<<(28-1)))
{
wmove(stdscr,8,0);
wdoprintf(stdscr,"Hint: update Windows to support LBA48 (minimum: W2K SP4 or XP SP1)");
wprintw(stdscr,"Hint: update Windows to support LBA48 (minimum: W2K SP4 or XP SP1)");
}
#endif
wmove(stdscr,9,0);
if(list_part->next==NULL)
{
wdoprintf(stdscr,"The following partition can't be recovered:");
wprintw(stdscr,"The following partition can't be recovered:");
} else {
wdoprintf(stdscr,"The following partitions can't be recovered:");
wprintw(stdscr,"The following partitions can't be recovered:");
}
mvwaddstr(stdscr,10,0,msg_PART_HEADER);
wmove(stdscr,22,0);
wattrset(stdscr, A_REVERSE);
wdoprintf(stdscr,"[ Continue ]");
wprintw(stdscr,"[ Continue ]");
wattroff(stdscr, A_REVERSE);
do
{
@ -176,9 +176,9 @@ static int interface_part_bad_ncurses(disk_t *disk_car, list_part_t *list_part)
wclrtoeol(stdscr); /* before addstr for BSD compatibility */
if(parts->part->info[0]!='\0')
{
wdoprintf(stdscr,"%s, ",parts->part->info);
wprintw(stdscr,"%s, ",parts->part->info);
}
wdoprintf(stdscr,"%s",size_to_unit(parts->part->part_size,buffer_part_size));
wprintw(stdscr,"%s",size_to_unit(parts->part->part_size,buffer_part_size));
} else
{
aff_part(stdscr,AFF_PART_NONL,disk_car,parts->part);
@ -300,22 +300,22 @@ static void warning_geometry_ncurses(disk_t *disk_car, const unsigned int recomm
{
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
wmove(stdscr,6,0);
wdoprintf(stdscr,"Warning: the current number of heads per cylinder is %u",disk_car->CHS.head+1);
wprintw(stdscr,"Warning: the current number of heads per cylinder is %u",disk_car->CHS.head+1);
wmove(stdscr,7,0);
wdoprintf(stdscr,"but the correct value may be %u.",recommanded_heads_per_cylinder);
wprintw(stdscr,"but the correct value may be %u.",recommanded_heads_per_cylinder);
wmove(stdscr,8,0);
wdoprintf(stdscr,"You can use the Geometry menu to change this value.");
wprintw(stdscr,"You can use the Geometry menu to change this value.");
wmove(stdscr,9,0);
wdoprintf(stdscr,"It's something to try if");
wprintw(stdscr,"It's something to try if");
wmove(stdscr,10,0);
wdoprintf(stdscr,"- some partitions are not found by TestDisk");
wprintw(stdscr,"- some partitions are not found by TestDisk");
wmove(stdscr,11,0);
wdoprintf(stdscr,"- or the partition table can not be written because partitions overlaps.");
wprintw(stdscr,"- or the partition table can not be written because partitions overlaps.");
wmove(stdscr,22,0);
wattrset(stdscr, A_REVERSE);
wdoprintf(stdscr,"[ Continue ]");
wprintw(stdscr,"[ Continue ]");
wattroff(stdscr, A_REVERSE);
wrefresh(stdscr);
while(wgetch(stdscr)==ERR);
@ -452,7 +452,7 @@ static list_part_t *search_part(disk_t *disk_car, const list_part_t *list_part_o
old_cylinder=start.cylinder;
wmove(stdscr,ANALYSE_Y,ANALYSE_X);
wclrtoeol(stdscr);
wdoprintf(stdscr,"Analyse cylinder %5u/%u: %02u%%",start.cylinder,disk_car->CHS.cylinder,(unsigned int)((uint64_t)start.cylinder*100/(disk_car->CHS.cylinder+1)));
wprintw(stdscr,"Analyse cylinder %5u/%u: %02u%%",start.cylinder,disk_car->CHS.cylinder,(unsigned int)((uint64_t)start.cylinder*100/(disk_car->CHS.cylinder+1)));
wrefresh(stdscr);
ind_stop|=check_enter_key_or_s(stdscr);
}
@ -646,7 +646,7 @@ static list_part_t *search_part(disk_t *disk_car, const list_part_t *list_part_o
{
wmove(stdscr,ANALYSE_Y+1,ANALYSE_X);
wclrtoeol(stdscr);
wdoprintf(stdscr,msg_READ_ERROR_AT, start.cylinder,start.head,start.sector,(unsigned long)(partition->part_offset/disk_car->sector_size));
wprintw(stdscr,msg_READ_ERROR_AT, start.cylinder,start.head,start.sector,(unsigned long)(partition->part_offset/disk_car->sector_size));
}
#endif
}
@ -834,7 +834,7 @@ static void ask_mbr_order_i386(disk_t *disk_car,list_part_t *list_part)
/* Initialisation */
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
mvwaddstr(stdscr,5,0,msg_MBR_ORDER);
mvwaddstr(stdscr,6,0,msg_PART_HEADER_LONG);
for(element=list_part;element!=NULL;element=element->next)
@ -880,9 +880,9 @@ static void ask_mbr_order_i386(disk_t *disk_car,list_part_t *list_part)
}
wmove(stdscr,20,0);
if(res)
wdoprintf(stdscr,msg_MBR_ORDER_BAD);
wprintw(stdscr,msg_MBR_ORDER_BAD);
else
wdoprintf(stdscr,msg_MBR_ORDER_GOOD);
wprintw(stdscr,msg_MBR_ORDER_GOOD);
wrefresh(stdscr);
car=wgetch(stdscr);
quit=0;
@ -1163,7 +1163,7 @@ int interface_recovery(disk_t *disk_car, const list_part_t * list_part_org, cons
#ifdef HAVE_NCURSES
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
wmove(stdscr,5,0);
#endif
res_interface_write=0;

View file

@ -151,7 +151,7 @@ int aff_buffer(const buffer_cmd_t cmd, const char *_format, ...)
{
wmove(stdscr,DUMP_Y+1+i-pos,DUMP_X);
wclrtoeol(stdscr);
wdoprintf(stdscr,"%s",intr_buffer_screen[i]);
wprintw(stdscr,"%s",intr_buffer_screen[i]);
}
wrefresh(stdscr);
}
@ -494,7 +494,7 @@ int wmenuSelect_ext(WINDOW *window, int y, int x, const struct MenuItem *menuIte
/*
if( ( menuType & ( MENU_HORIZ | MENU_VERT ) )==0 )
{
wdoprintf(window,"Menu without direction. Defaulting horizontal.");
wprintw(window,"Menu without direction. Defaulting horizontal.");
menuType |= MENU_HORIZ;
}
*/
@ -599,7 +599,7 @@ int wmenuSelect_ext(WINDOW *window, int y, int x, const struct MenuItem *menuIte
if( key )
{
wmove(window,5,0);
wdoprintf(window,"key %03X",key);
wprintw(window,"key %03X",key);
putchar( BELL );
}
#endif
@ -711,32 +711,32 @@ void dump(WINDOW *window, const void *nom_dump,unsigned int lng)
{
wmove(window,DUMP_Y+i-pos,DUMP_X);
wclrtoeol(window);
wdoprintf(window,"%04X ",i*0x10);
wprintw(window,"%04X ",i*0x10);
for(j=0; j< 0x10;j++)
{
if(i*0x10+j<lng)
{
car=*((const unsigned char*)nom_dump+i*0x10+j);
wdoprintf(window,"%02x", car);
wprintw(window,"%02x", car);
}
else
wdoprintf(window," ");
wprintw(window," ");
if(j%4==(4-1))
wdoprintf(window," ");
wprintw(window," ");
}
wdoprintf(window," ");
wprintw(window," ");
for(j=0; j< 0x10;j++)
{
if(i*0x10+j<lng)
{
car=*((const unsigned char*)nom_dump+i*0x10+j);
if ((car<32)||(car >= 127))
wdoprintf(window,".");
wprintw(window,".");
else
wdoprintf(window,"%c", car);
wprintw(window,"%c", car);
}
else
wdoprintf(window," ");
wprintw(window," ");
}
}
switch (wmenuSelect(window,INTER_DUMP_Y, INTER_DUMP_X, menuDump, 8, options, MENU_HORIZ | MENU_BUTTON | MENU_ACCEPT_OTHERS, menu))
@ -817,7 +817,7 @@ void dump2(WINDOW *window, const void *dump_1, const void *dump_2, const unsigne
{
wmove(window,DUMP_Y+i-pos,DUMP_X);
wclrtoeol(window);
wdoprintf(window,"%04X ",i*0x08);
wprintw(window,"%04X ",i*0x08);
for(j=0; j<0x08;j++)
{
if(i*0x08+j<lng)
@ -826,16 +826,16 @@ void dump2(WINDOW *window, const void *dump_1, const void *dump_2, const unsigne
unsigned char car2=*((const unsigned char*)dump_2+i*0x08+j);
if(car1!=car2)
wattrset(window, A_REVERSE);
wdoprintf(window,"%02x", car1);
wprintw(window,"%02x", car1);
if(car1!=car2)
wattroff(window, A_REVERSE);
}
else
wdoprintf(window," ");
wprintw(window," ");
if(j%4==(4-1))
wdoprintf(window," ");
wprintw(window," ");
}
wdoprintf(window," ");
wprintw(window," ");
for(j=0; j<0x08;j++)
{
if(i*0x08+j<lng)
@ -845,16 +845,16 @@ void dump2(WINDOW *window, const void *dump_1, const void *dump_2, const unsigne
if(car1!=car2)
wattrset(window, A_REVERSE);
if ((car1<32)||(car1 >= 127))
wdoprintf(window,".");
wprintw(window,".");
else
wdoprintf(window,"%c", car1);
wprintw(window,"%c", car1);
if(car1!=car2)
wattroff(window, A_REVERSE);
}
else
wdoprintf(window," ");
wprintw(window," ");
}
wdoprintf(window," ");
wprintw(window," ");
for(j=0; j<0x08;j++)
{
if(i*0x08+j<lng)
@ -863,16 +863,16 @@ void dump2(WINDOW *window, const void *dump_1, const void *dump_2, const unsigne
unsigned char car2=*((const unsigned char*)dump_2+i*0x08+j);
if(car1!=car2)
wattrset(window, A_REVERSE);
wdoprintf(window,"%02x", car2);
wprintw(window,"%02x", car2);
if(car1!=car2)
wattroff(window, A_REVERSE);
if(j%4==(4-1))
wdoprintf(window," ");
wprintw(window," ");
}
else
wdoprintf(window," ");
wprintw(window," ");
}
wdoprintf(window," ");
wprintw(window," ");
for(j=0; j<0x08;j++)
{
if(i*0x08+j<lng)
@ -882,14 +882,14 @@ void dump2(WINDOW *window, const void *dump_1, const void *dump_2, const unsigne
if(car1!=car2)
wattrset(window, A_REVERSE);
if ((car2<32)||(car2 >= 127))
wdoprintf(window,".");
wprintw(window,".");
else
wdoprintf(window,"%c", car2);
wprintw(window,"%c", car2);
if(car1!=car2)
wattroff(window, A_REVERSE);
}
else
wdoprintf(window," ");
wprintw(window," ");
}
}
switch (wmenuSelect(window,INTER_DUMP_Y, INTER_DUMP_X, menuDump, 8, options, MENU_HORIZ | MENU_BUTTON | MENU_ACCEPT_OTHERS, menu))
@ -976,21 +976,21 @@ int screen_buffer_display_ext(WINDOW *window, const char *options_org, const str
wmove(window, INTER_ANALYSE_Y-1, INTER_ANALYSE_X+4);
wclrtoeol(window);
if(first_line_to_display>0)
wdoprintf(window, "Previous");
wprintw(window, "Previous");
for (i=first_line_to_display; (i<intr_nbr_line)&&((i-first_line_to_display)<INTER_MAX_LINES); i++)
{
wmove(window,INTER_ANALYSE_Y+i-first_line_to_display,INTER_ANALYSE_X);
wclrtoeol(window);
if(i==current_line && intr_nbr_line>INTER_MAX_LINES && has_colors())
wattrset(window, A_REVERSE);
wdoprintf(window,"%s",intr_buffer_screen[i]);
wprintw(window,"%s",intr_buffer_screen[i]);
if(i==current_line && intr_nbr_line>INTER_MAX_LINES && has_colors())
wattroff(window, A_REVERSE);
}
wmove(window, INTER_ANALYSE_Y+INTER_MAX_LINES, INTER_ANALYSE_X+4);
wclrtoeol(window);
if(i<intr_nbr_line)
wdoprintf(window, "Next");
wprintw(window, "Next");
key=wmenuSelect_ext(window,INTER_ANALYSE_MENU_Y, INTER_ANALYSE_MENU_X, (menuItems!=NULL?menuItems:menuDefault),
itemLength, options, MENU_HORIZ | MENU_BUTTON | MENU_ACCEPT_OTHERS, menu,NULL);
switch (key)
@ -1043,7 +1043,7 @@ int screen_buffer_display_ext(WINDOW *window, const char *options_org, const str
void aff_CHS(const CHS_t * CHS)
{
wdoprintf(stdscr,"%5u %3u %2u ", CHS->cylinder, CHS->head, CHS->sector);
wprintw(stdscr,"%5u %3u %2u ", CHS->cylinder, CHS->head, CHS->sector);
}
void aff_CHS_buffer(const CHS_t * CHS)
@ -1055,7 +1055,7 @@ void aff_part(WINDOW *window,const aff_part_type_t newline,const disk_t *disk_ca
{
const char *msg;
msg=aff_part_aux(newline, disk_car, partition);
wdoprintf(window,"%s",msg);
wprintw(window,"%s",msg);
}
void aff_LBA2CHS(const disk_t *disk_car, const unsigned long int pos_LBA)
@ -1067,7 +1067,7 @@ void aff_LBA2CHS(const disk_t *disk_car, const unsigned long int pos_LBA)
tmp=pos_LBA/tmp;
cylinder=tmp/(disk_car->CHS.head+1);
head=tmp%(disk_car->CHS.head+1);
wdoprintf(stdscr,"%lu/%lu/%lu", cylinder,head,sector);
wprintw(stdscr,"%lu/%lu/%lu", cylinder,head,sector);
}
int ask_YN(WINDOW *window)
@ -1080,7 +1080,7 @@ int ask_YN(WINDOW *window)
res=toupper(wgetch(window));
} while((res!=c_NO)&&(res!=c_YES));
curs_set(0);
wdoprintf(window,"%c\n",res);
wprintw(window,"%c\n",res);
return (res==c_YES);
}
@ -1102,27 +1102,6 @@ int ask_confirmation(const char*_format, ...)
return res;
}
int wdoprintf(WINDOW *window, const char *_format, ...)
{
char res[800];
va_list ap;
va_start(ap,_format);
vsnprintf(res,sizeof(res),_format,ap);
va_end(ap);
res[sizeof(res)-1]='\0';
#ifdef __MINGW32__
{
int len=strlen(res);
if(res[len-1]=='\n' && len<sizeof(res)-1)
{
res[len]='\r';
res[len+1]=0;
}
}
#endif
return waddstr(window,res);
}
static int display_message_ncurses(const char*msg)
{
int pipo=0;
@ -1148,11 +1127,11 @@ void not_implemented(const char *msg)
WINDOW *window=newwin(0,0,0,0); /* full screen */
aff_copy(window);
wmove(window,7,0);
wdoprintf(window,"Function %s not implemented",msg);
wprintw(window,"Function %s not implemented",msg);
log_warning("Function %s not implemented\n",msg);
wmove(window,22,0);
wattrset(window, A_REVERSE);
wdoprintf(window,"[ Abort ]");
wprintw(window,"[ Abort ]");
wattroff(window, A_REVERSE);
wrefresh(window);
while(wgetch(window)==ERR);
@ -1273,12 +1252,12 @@ int start_ncurses(const char *prog_name, const char *real_prog_name)
{
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s need 25 lines to work.", prog_name);
wprintw(stdscr,"%s need 25 lines to work.", prog_name);
wmove(stdscr,5,0);
wdoprintf(stdscr,"Please enlarge the terminal.");
wprintw(stdscr,"Please enlarge the terminal.");
wmove(stdscr,LINES-2,0);
wattrset(stdscr, A_REVERSE);
wdoprintf(stdscr,"[ Quit ]");
wprintw(stdscr,"[ Quit ]");
wattroff(stdscr, A_REVERSE);
wrefresh(stdscr);
switch(wgetch(stdscr))
@ -1325,16 +1304,16 @@ char *ask_log_location(const char*filename)
static char response[LINE_LENGTH];
aff_copy(stdscr);
wmove(stdscr,6,0);
wdoprintf(stdscr,"Cannot open %s: %s\n",filename, strerror(errno));
wprintw(stdscr,"Cannot open %s: %s\n",filename, strerror(errno));
wmove(stdscr,8,0);
wdoprintf(stdscr,"Please enter the full log filename or press ");
wprintw(stdscr,"Please enter the full log filename or press ");
if(has_colors())
wbkgdset(stdscr,' ' | A_BOLD | COLOR_PAIR(0));
wdoprintf(stdscr,"Enter");
wprintw(stdscr,"Enter");
if(has_colors())
wbkgdset(stdscr,' ' | COLOR_PAIR(0));
wmove(stdscr,9,0);
wdoprintf(stdscr,"to abort log file creation.\n");
wprintw(stdscr,"to abort log file creation.\n");
if (get_string(response, LINE_LENGTH, NULL) > 0)
return response;
return NULL;
@ -1358,31 +1337,31 @@ int ask_log_creation()
};
aff_copy(stdscr);
wmove(stdscr,5,0);
wdoprintf(stdscr,"TestDisk is a data recovery designed to help recover lost partitions");
wprintw(stdscr,"TestDisk is a data recovery designed to help recover lost partitions");
wmove(stdscr,6,0);
wdoprintf(stdscr,"and/or make non-booting disks bootable again when these symptoms");
wprintw(stdscr,"and/or make non-booting disks bootable again when these symptoms");
wmove(stdscr,7,0);
wdoprintf(stdscr,"are caused by faulty software, certain types of viruses or human error.");
wprintw(stdscr,"are caused by faulty software, certain types of viruses or human error.");
wmove(stdscr,8,0);
wdoprintf(stdscr,"It can also be used to repair some filesystem errors.");
wprintw(stdscr,"It can also be used to repair some filesystem errors.");
wmove(stdscr,10,0);
wdoprintf(stdscr,"Information gathered during TestDisk use can be recorded for later");
wprintw(stdscr,"Information gathered during TestDisk use can be recorded for later");
wmove(stdscr,11,0);
wdoprintf(stdscr,"review. If you choose to create the text file, ");
wprintw(stdscr,"review. If you choose to create the text file, ");
if(has_colors())
wbkgdset(stdscr,' ' | A_BOLD | COLOR_PAIR(0));
wdoprintf(stdscr,"testdisk.log");
wprintw(stdscr,"testdisk.log");
if(has_colors())
wbkgdset(stdscr,' ' | COLOR_PAIR(0));
wdoprintf(stdscr," , it");
wprintw(stdscr," , it");
wmove(stdscr,12,0);
wdoprintf(stdscr,"will contain TestDisk options, technical information and various");
wprintw(stdscr,"will contain TestDisk options, technical information and various");
wmove(stdscr,13,0);
wdoprintf(stdscr,"outputs; including any folder/file names TestDisk was used to find and");
wprintw(stdscr,"outputs; including any folder/file names TestDisk was used to find and");
wmove(stdscr,14,0);
wdoprintf(stdscr,"list onscreen.");
wprintw(stdscr,"list onscreen.");
wmove(stdscr,16,0);
wdoprintf(stdscr,"Use arrow keys to select, then press Enter key:");
wprintw(stdscr,"Use arrow keys to select, then press Enter key:");
while(1)
{
command = wmenuSelect_ext(stdscr,17, 0, menuLogCreation, 8,
@ -1408,27 +1387,27 @@ static void intrf_no_disk_ncurses(const char *prog_name)
{
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr," %s is free software, and",prog_name);
wprintw(stdscr," %s is free software, and",prog_name);
wmove(stdscr,5,0);
wdoprintf(stdscr,"comes with ABSOLUTELY NO WARRANTY.");
wprintw(stdscr,"comes with ABSOLUTELY NO WARRANTY.");
wmove(stdscr,7,0);
wdoprintf(stdscr,"No harddisk found\n");
wprintw(stdscr,"No harddisk found\n");
wmove(stdscr,8,0);
#if defined(__CYGWIN__) || defined(__MINGW32__)
wdoprintf(stdscr,"You need to be administrator to use %s.\n", prog_name);
wprintw(stdscr,"You need to be administrator to use %s.\n", prog_name);
wmove(stdscr,9,0);
wdoprintf(stdscr,"Under Win9x, use the DOS version instead.\n");
wprintw(stdscr,"Under Win9x, use the DOS version instead.\n");
wmove(stdscr,10,0);
wdoprintf(stdscr,"Under Vista, select %s, right-click and choose \"Run as administrator\".\n", prog_name);
wprintw(stdscr,"Under Vista, select %s, right-click and choose \"Run as administrator\".\n", prog_name);
#else
#ifndef DJGPP
#ifdef HAVE_GETEUID
if(geteuid()!=0)
{
wdoprintf(stdscr,"You need to be root to use %s.\n", prog_name);
wprintw(stdscr,"You need to be root to use %s.\n", prog_name);
#if defined(__APPLE__)
wmove(stdscr,9,0);
wdoprintf(stdscr,"Use the sudo command to launch %s.\n", prog_name);
wprintw(stdscr,"Use the sudo command to launch %s.\n", prog_name);
#endif
}
#endif
@ -1436,7 +1415,7 @@ static void intrf_no_disk_ncurses(const char *prog_name)
#endif
wmove(stdscr,22,0);
wattrset(stdscr, A_REVERSE);
wdoprintf(stdscr,"[ Quit ]");
wprintw(stdscr,"[ Quit ]");
wattroff(stdscr, A_REVERSE);
wrefresh(stdscr);
while(wgetch(stdscr)==ERR);
@ -1487,13 +1466,13 @@ static int interface_partition_type_ncurses(disk_t *disk_car)
};
aff_copy(stdscr);
wmove(stdscr,5,0);
wdoprintf(stdscr,"%s\n",disk_car->description_short(disk_car));
wprintw(stdscr,"%s\n",disk_car->description_short(disk_car));
wmove(stdscr,INTER_PARTITION_Y-1,0);
wdoprintf(stdscr,"Please select the partition table type, press Enter when done.");
wprintw(stdscr,"Please select the partition table type, press Enter when done.");
wmove(stdscr,20,0);
wdoprintf(stdscr,"Note: Do NOT select 'None' for media with only a single partition. It's very");
wprintw(stdscr,"Note: Do NOT select 'None' for media with only a single partition. It's very");
wmove(stdscr,21,0);
wdoprintf(stdscr,"rare for a drive to be 'Non-partitioned'.");
wprintw(stdscr,"rare for a drive to be 'Non-partitioned'.");
car=wmenuSelect_ext(stdscr,INTER_PARTITION_Y, INTER_PARTITION_X, menuOptions, 7, "IGMNSXQ", MENU_BUTTON | MENU_VERT | MENU_VERT_WARN, &menu,&real_key);
switch(car)
{
@ -1649,17 +1628,17 @@ char *ask_location(const char*msg, const char *src_dir)
#ifdef PATH_DRIVE_LENGTH
#ifdef __CYGWIN__
if(strlen(dst_directory)<=PATH_DRIVE_LENGTH)
wdoprintf(window,"To select a drive, use the arrow keys.");
wprintw(window,"To select a drive, use the arrow keys.");
else
wdoprintf(window,"To select another directory, use the arrow keys.");
wprintw(window,"To select another directory, use the arrow keys.");
#else
if(strlen(dst_directory)<PATH_DRIVE_LENGTH)
wdoprintf(window,"To select a drive, use the arrow keys.");
wprintw(window,"To select a drive, use the arrow keys.");
else
wdoprintf(window,"To select another directory, use the arrow keys.");
wprintw(window,"To select another directory, use the arrow keys.");
#endif
#else
wdoprintf(window,"To select another directory, use the arrow keys.");
wprintw(window,"To select another directory, use the arrow keys.");
#endif
{
struct td_list_head *dir_walker = NULL;
@ -1907,11 +1886,11 @@ static void dir_aff_entry(WINDOW *window, struct file_info *dir_info)
strncpy(datestr, " ",sizeof(datestr));
}
mode_string(dir_info->stat.st_mode,str);
wdoprintf(window, "%s %5u %5u ",
wprintw(window, "%s %5u %5u ",
str, (unsigned int)dir_info->stat.st_uid, (unsigned int)dir_info->stat.st_gid);
wdoprintf(window, "%7llu", (long long unsigned int)dir_info->stat.st_size);
wprintw(window, "%7llu", (long long unsigned int)dir_info->stat.st_size);
/* screen may overlap due to long filename */
wdoprintf(window, " %s %s", datestr, dir_info->name);
wprintw(window, " %s %s", datestr, dir_info->name);
}
#else
int ask_log_creation()

View file

@ -116,14 +116,14 @@ static int write_MBR_code(disk_t *disk_car)
{
aff_copy(stdscr);
wmove(stdscr,5,0);
wdoprintf(stdscr,"%s\n",disk_car->description(disk_car));
wprintw(stdscr,"%s\n",disk_car->description(disk_car));
wmove(stdscr,INTER_DISK_Y,INTER_DISK_X);
if(disk_car->arch->write_MBR_code==NULL)
{
display_message("Function to write a new MBR code not implemented for this partition type.\n");
return 1;
}
wdoprintf(stdscr,msg_WRITE_MBR_CODE);
wprintw(stdscr,msg_WRITE_MBR_CODE);
if(ask_YN(stdscr)!=0 && ask_confirmation("Write a new copy of MBR code, confirm ? (Y/N)")!=0)
{
if(disk_car->arch->write_MBR_code(disk_car))
@ -141,14 +141,14 @@ static int write_clean_table(disk_t *disk_car)
{
aff_copy(stdscr);
wmove(stdscr,5,0);
wdoprintf(stdscr,"%s\n",disk_car->description(disk_car));
wprintw(stdscr,"%s\n",disk_car->description(disk_car));
wmove(stdscr,INTER_DISK_Y,INTER_DISK_X);
if(disk_car->arch->erase_list_part==NULL)
{
display_message("Clear partition table not implemented for this partition type.\n");
return 1;
}
wdoprintf(stdscr,msg_WRITE_CLEAN_TABLE);
wprintw(stdscr,msg_WRITE_CLEAN_TABLE);
if(ask_YN(stdscr)!=0 && ask_confirmation("Clear partition table, confirm ? (Y/N)")!=0)
{
if(disk_car->arch->erase_list_part(disk_car))
@ -310,11 +310,11 @@ static int menu_disk_ncurses(disk_t *disk_car, const int verbose,int dump_ind, c
{
aff_copy(stdscr);
wmove(stdscr,5,0);
wdoprintf(stdscr,"%s\n",disk_car->description(disk_car));
wprintw(stdscr,"%s\n",disk_car->description(disk_car));
wmove(stdscr,20,0);
wdoprintf(stdscr,"Note: Correct disk geometry is required for a successful recovery. 'Analyse'");
wprintw(stdscr,"Note: Correct disk geometry is required for a successful recovery. 'Analyse'");
wmove(stdscr,21,0);
wdoprintf(stdscr,"process may give some warnings if it thinks the logical geometry is mismatched.");
wprintw(stdscr,"process may give some warnings if it thinks the logical geometry is mismatched.");
command = wmenuSelect_ext(stdscr,INTER_DISK_Y, INTER_DISK_X, menuMain, 10,
options, MENU_VERT | MENU_VERT_WARN | MENU_BUTTON | MENU_ACCEPT_OTHERS, &menu,&real_key);
/* e for editor will be added when the editor will be better */
@ -468,22 +468,22 @@ static int testdisk_disk_selection_ncurses(int verbose,int dump_ind, const list_
#ifdef HAVE_NCURSES
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr," TestDisk is free software, and");
wprintw(stdscr," TestDisk is free software, and");
wmove(stdscr,5,0);
wdoprintf(stdscr,"comes with ABSOLUTELY NO WARRANTY.");
wprintw(stdscr,"comes with ABSOLUTELY NO WARRANTY.");
wmove(stdscr,7,0);
wdoprintf(stdscr,"Select a media (use Arrow keys, then press Enter):");
wprintw(stdscr,"Select a media (use Arrow keys, then press Enter):");
#endif
for(i=0,element_disk=list_disk;(element_disk!=NULL) && (i<offset);element_disk=element_disk->next,i++);
for(;element_disk!=NULL && (i-offset)<10;i++,element_disk=element_disk->next)
{
wmove(stdscr,8+i-offset,0);
if(element_disk!=current_disk)
wdoprintf(stdscr,"%s\n",element_disk->disk->description_short(element_disk->disk));
wprintw(stdscr,"%s\n",element_disk->disk->description_short(element_disk->disk));
else
{
wattrset(stdscr, A_REVERSE);
wdoprintf(stdscr,"%s\n",element_disk->disk->description_short(element_disk->disk));
wprintw(stdscr,"%s\n",element_disk->disk->description_short(element_disk->disk));
wattroff(stdscr, A_REVERSE);
}
}
@ -510,9 +510,9 @@ static int testdisk_disk_selection_ncurses(int verbose,int dump_ind, const list_
#endif
waddstr(stdscr,"Disk capacity must be correctly detected for a successful recovery.");
wmove(stdscr,line++,0);
wdoprintf(stdscr,"If a disk listed above has incorrect size, check HD jumper settings, BIOS");
wprintw(stdscr,"If a disk listed above has incorrect size, check HD jumper settings, BIOS");
wmove(stdscr,line++,0);
wdoprintf(stdscr,"detection, and install the latest OS patches and disk drivers.");
wprintw(stdscr,"detection, and install the latest OS patches and disk drivers.");
}
command = wmenuSelect_ext(stdscr,INTER_MAIN_Y, INTER_MAIN_X, menuMain, 8,
options, MENU_HORIZ | MENU_BUTTON | MENU_ACCEPT_OTHERS, &menu,NULL);
@ -602,16 +602,16 @@ static int interface_check_disk_capacity_ncurses(disk_t *disk_car)
int car;
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s\n",disk_car->description(disk_car));
wprintw(stdscr,"%s\n",disk_car->description(disk_car));
wmove(stdscr,6,0);
wdoprintf(stdscr,"The Harddisk size seems to be 137GB.");
wprintw(stdscr,"The Harddisk size seems to be 137GB.");
wmove(stdscr,7,0);
wdoprintf(stdscr,"Support for 48-bit Logical Block Addressing (LBA) is needed to access");
wprintw(stdscr,"Support for 48-bit Logical Block Addressing (LBA) is needed to access");
wmove(stdscr,8,0);
wdoprintf(stdscr,"hard disks larger than 137 GB.");
wprintw(stdscr,"hard disks larger than 137 GB.");
wmove(stdscr,9,0);
#if defined(__CYGWIN__) || defined(__MINGW32__)
wdoprintf(stdscr,"Update Windows to support LBA48 (minimum: W2K SP4 or XP SP1)");
wprintw(stdscr,"Update Windows to support LBA48 (minimum: W2K SP4 or XP SP1)");
#endif
car= wmenuSelect_ext(stdscr,INTER_MAIN_Y, INTER_MAIN_X, menuMain, 10,
"CQ", MENU_VERT | MENU_VERT_WARN | MENU_BUTTON, &menu,NULL);
@ -650,40 +650,40 @@ static int interface_check_disk_access_ncurses(disk_t *disk_car)
int line=9;
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s\n",disk_car->description(disk_car));
wprintw(stdscr,"%s\n",disk_car->description(disk_car));
wmove(stdscr,6,0);
wdoprintf(stdscr,"Write access for this media is not available.");
wprintw(stdscr,"Write access for this media is not available.");
wmove(stdscr,7,0);
wdoprintf(stdscr,"TestDisk won't be able to modify it.");
wprintw(stdscr,"TestDisk won't be able to modify it.");
#ifdef DJGPP
#elif defined(__CYGWIN__) || defined(__MINGW32__)
wmove(stdscr,line++,0);
wdoprintf(stdscr,"- You may need to be administrator to have write access.\n");
wprintw(stdscr,"- You may need to be administrator to have write access.\n");
wmove(stdscr,line++,0);
wdoprintf(stdscr,"Under Vista, select %s, right-click and choose \"Run as administrator\".\n", prog_name);
wprintw(stdscr,"Under Vista, select %s, right-click and choose \"Run as administrator\".\n", prog_name);
#elif defined HAVE_GETEUID
if(geteuid()!=0)
{
wmove(stdscr,line++,0);
wdoprintf(stdscr,"- You may need to be root to have write access.\n");
wprintw(stdscr,"- You may need to be root to have write access.\n");
#if defined(__APPLE__)
wmove(stdscr,line++,0);
wdoprintf(stdscr,"Use the sudo command to launch %s.\n", prog_name);
wprintw(stdscr,"Use the sudo command to launch %s.\n", prog_name);
#endif
wmove(stdscr,line++,0);
wdoprintf(stdscr,"- Check the OS permission for this file or device.\n");
wprintw(stdscr,"- Check the OS permission for this file or device.\n");
}
#endif
#if defined(__APPLE__)
wmove(stdscr,line++,0);
wdoprintf(stdscr,"- No partition from this disk must be mounted:\n");
wprintw(stdscr,"- No partition from this disk must be mounted:\n");
wmove(stdscr,line++,0);
wdoprintf(stdscr,"Open the Disk Utility (In Finder -> Application -> Utility folder)\n");
wprintw(stdscr,"Open the Disk Utility (In Finder -> Application -> Utility folder)\n");
wmove(stdscr,line++,0);
wdoprintf(stdscr,"and press Umount button for each volume from this disk\n");
wprintw(stdscr,"and press Umount button for each volume from this disk\n");
#endif
wmove(stdscr,line++,0);
wdoprintf(stdscr,"- This media may be physically write-protected, check the jumpers.\n");
wprintw(stdscr,"- This media may be physically write-protected, check the jumpers.\n");
car= wmenuSelect_ext(stdscr,INTER_MAIN_Y, INTER_MAIN_X, menuDiskAccess, 10,
"CQ", MENU_VERT | MENU_VERT_WARN | MENU_BUTTON, &menu,NULL);
if(car=='c' || car=='C')
@ -726,11 +726,11 @@ static list_part_t *interface_analyse_ncurses(disk_t *disk_car, const int verbos
if(disk_car->arch->msg_part_type!=NULL)
mvwaddstr(stdscr,22,0,disk_car->arch->msg_part_type);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s\n",disk_car->description(disk_car));
wprintw(stdscr,"%s\n",disk_car->description(disk_car));
mvwaddstr(stdscr,5,0,"Checking current partition structure");
wmove(stdscr,6,0);
wrefresh(stdscr);
wdoprintf(stdscr,msg_PART_HEADER_LONG);
wprintw(stdscr,msg_PART_HEADER_LONG);
#endif
list_part=disk_car->arch->read_part(disk_car,verbose,saveheader);
log_info("Current partition structure:\n");
@ -796,7 +796,7 @@ int interface_write(disk_t *disk_car,list_part_t *list_part,const int can_search
#ifdef HAVE_NCURSES
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
wmove(stdscr,5,0);
mvwaddstr(stdscr,6,0,msg_PART_HEADER_LONG);
#endif
@ -1007,7 +1007,7 @@ static list_part_t *ask_structure_ncurses(disk_t *disk_car,list_part_t *list_par
{
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
mvwaddstr(stdscr,5,0,msg_PART_HEADER);
rewrite=0;
}
@ -1034,9 +1034,9 @@ static list_part_t *ask_structure_ncurses(disk_t *disk_car,list_part_t *list_par
wclrtoeol(stdscr); /* before addstr for BSD compatibility */
if(parts->part->info[0]!='\0')
{
wdoprintf(stdscr,"%s, ",parts->part->info);
wprintw(stdscr,"%s, ",parts->part->info);
}
wdoprintf(stdscr,"%s",size_to_unit(parts->part->part_size,buffer_part_size));
wprintw(stdscr,"%s",size_to_unit(parts->part->part_size,buffer_part_size));
}
}
if(structure_status==0)
@ -1333,11 +1333,11 @@ static struct td_list_head *interface_load_ncurses(disk_t *disk_car, backup_disk
if(backup_walker==backup_current)
{
wattrset(stdscr, A_REVERSE);
wdoprintf(stdscr,"%s %s",backup->description,ctime(&backup->my_time));
wprintw(stdscr,"%s %s",backup->description,ctime(&backup->my_time));
wattroff(stdscr, A_REVERSE);
} else
{
wdoprintf(stdscr,"%s %s",backup->description,ctime(&backup->my_time));
wprintw(stdscr,"%s %s",backup->description,ctime(&backup->my_time));
}
}
if(i<=INTER_STRUCTURE && backup==NULL)
@ -1473,7 +1473,7 @@ int interface_superblock(disk_t *disk_car,list_part_t *list_part, char**current_
#ifdef HAVE_NCURSES
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
wmove(stdscr,5,0);
mvwaddstr(stdscr,6,0,msg_PART_HEADER_LONG);
#endif

View file

@ -41,7 +41,6 @@ void dump(WINDOW *window,const void *nom_dump,unsigned int lng);
int screen_buffer_display_ext(WINDOW *window, const char *options_org, const struct MenuItem *menuItems, unsigned int *menu);
int screen_buffer_display(WINDOW *window, const char *options_org, const struct MenuItem *menuItems);
int vaff_txt(int line, WINDOW *window, const char *_format, va_list ap);
int wdoprintf(WINDOW *window, const char *_format, ...) __attribute__ ((format (printf, 2, 3)));
int wgetch_nodelay(WINDOW *window);
int wmenuSelect_ext(WINDOW *window, int y, int x, const struct MenuItem *menuItems, const unsigned int itemLength, const char *available, int menuType, unsigned int *current, int *real_key);
int wmenuSelect(WINDOW *window, int y, int x, const struct MenuItem *menuItems, const unsigned int itemLength, const char *available, int menuType, unsigned int menuDefault);

View file

@ -68,7 +68,7 @@ static void ntfs_dump_ncurses(disk_t *disk_car, const partition_t *partition, co
keypad(window, TRUE); /* Need it to get arrow key */
aff_copy(window);
wmove(window,4,0);
wdoprintf(window,"%s",disk_car->description(disk_car));
wprintw(window,"%s",disk_car->description(disk_car));
wmove(window,5,0);
aff_part(window,AFF_PART_ORDER,disk_car,partition);
mvwaddstr(window,6,0, " Rebuild Boot sector Boot sector");
@ -171,7 +171,7 @@ static void menu_write_ntfs_boot_sector_ncurses(disk_t *disk_car, partition_t *p
{
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
mvwaddstr(stdscr,5,0,msg_PART_HEADER_LONG);
wmove(stdscr,6,0);
aff_part(stdscr,AFF_PART_ORDER,disk_car,partition);
@ -180,7 +180,7 @@ static void menu_write_ntfs_boot_sector_ncurses(disk_t *disk_car, partition_t *p
{
options="DLWQ";
ncurses_ntfs2_info(ntfs_header, org_ntfs_header);
wdoprintf(stdscr,"Extrapolated boot sector and current boot sector are different.\n");
wprintw(stdscr,"Extrapolated boot sector and current boot sector are different.\n");
log_ntfs2_info(ntfs_header, org_ntfs_header);
if(error)
log_error("Warning: Extrapolated boot sector have incorrect values.\n");
@ -189,7 +189,7 @@ static void menu_write_ntfs_boot_sector_ncurses(disk_t *disk_car, partition_t *p
{
log_ntfs_info(ntfs_header);
ncurses_ntfs_info(ntfs_header);
wdoprintf(stdscr,"Extrapolated boot sector and current boot sector are identical.\n");
wprintw(stdscr,"Extrapolated boot sector and current boot sector are identical.\n");
}
command=wmenuSelect(stdscr,INTER_DUMP_Y, INTER_DUMP_X, menuSaveBoot,8,options,MENU_HORIZ | MENU_BUTTON, 1);
switch(command)
@ -218,7 +218,7 @@ static void menu_write_ntfs_boot_sector_ncurses(disk_t *disk_car, partition_t *p
keypad(window, TRUE); /* Need it to get arrow key */
aff_copy(window);
wmove(window,4,0);
wdoprintf(window,"%s",disk_car->description(disk_car));
wprintw(window,"%s",disk_car->description(disk_car));
wmove(window,5,0);
aff_part(window,AFF_PART_ORDER,disk_car,partition);
log_info(" Rebuild Boot sector Boot sector\n");
@ -439,7 +439,7 @@ int rebuild_NTFS_BS(disk_t *disk_car, partition_t *partition, const int verbose,
{
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
mvwaddstr(stdscr,5,0,msg_PART_HEADER_LONG);
wmove(stdscr,6,0);
aff_part(stdscr,AFF_PART_ORDER,disk_car,partition);
@ -492,7 +492,7 @@ int rebuild_NTFS_BS(disk_t *disk_car, partition_t *partition, const int verbose,
{
wmove(stdscr,9,0);
wclrtoeol(stdscr);
wdoprintf(stdscr,"Search mft %10lu/%lu", (long unsigned)sector,
wprintw(stdscr,"Search mft %10lu/%lu", (long unsigned)sector,
(long unsigned)(partition->part_size/disk_car->sector_size));
wrefresh(stdscr);
if(check_enter_key_or_s(stdscr))
@ -663,29 +663,29 @@ static int testdisk_ffs(int x)
#ifdef HAVE_NCURSES
static int ncurses_ntfs_info(const struct ntfs_boot_sector *ntfs_header)
{
wdoprintf(stdscr,"filesystem size %llu\n", (long long unsigned)(le64(ntfs_header->sectors_nbr)+1));
wdoprintf(stdscr,"sectors_per_cluster %u\n",ntfs_header->sectors_per_cluster);
wdoprintf(stdscr,"mft_lcn %lu\n",(long unsigned int)le64(ntfs_header->mft_lcn));
wdoprintf(stdscr,"mftmirr_lcn %lu\n",(long unsigned int)le64(ntfs_header->mftmirr_lcn));
wdoprintf(stdscr,"clusters_per_mft_record %d\n",ntfs_header->clusters_per_mft_record);
wdoprintf(stdscr,"clusters_per_index_record %d\n",ntfs_header->clusters_per_index_record);
wprintw(stdscr,"filesystem size %llu\n", (long long unsigned)(le64(ntfs_header->sectors_nbr)+1));
wprintw(stdscr,"sectors_per_cluster %u\n",ntfs_header->sectors_per_cluster);
wprintw(stdscr,"mft_lcn %lu\n",(long unsigned int)le64(ntfs_header->mft_lcn));
wprintw(stdscr,"mftmirr_lcn %lu\n",(long unsigned int)le64(ntfs_header->mftmirr_lcn));
wprintw(stdscr,"clusters_per_mft_record %d\n",ntfs_header->clusters_per_mft_record);
wprintw(stdscr,"clusters_per_index_record %d\n",ntfs_header->clusters_per_index_record);
return 0;
}
static int ncurses_ntfs2_info(const struct ntfs_boot_sector *nh1, const struct ntfs_boot_sector *nh2)
{
wdoprintf(stdscr,"filesystem size %llu %llu\n",
wprintw(stdscr,"filesystem size %llu %llu\n",
(long long unsigned)(le64(nh1->sectors_nbr)+1),
(long long unsigned)(le64(nh2->sectors_nbr)+1));
wdoprintf(stdscr,"sectors_per_cluster %u %u\n",nh1->sectors_per_cluster,nh2->sectors_per_cluster);
wdoprintf(stdscr,"mft_lcn %lu %lu\n",
wprintw(stdscr,"sectors_per_cluster %u %u\n",nh1->sectors_per_cluster,nh2->sectors_per_cluster);
wprintw(stdscr,"mft_lcn %lu %lu\n",
(long unsigned int)le64(nh1->mft_lcn),
(long unsigned int)le64(nh2->mft_lcn));
wdoprintf(stdscr,"mftmirr_lcn %lu %lu\n",
wprintw(stdscr,"mftmirr_lcn %lu %lu\n",
(long unsigned int)le64(nh1->mftmirr_lcn),
(long unsigned int)le64(nh2->mftmirr_lcn));
wdoprintf(stdscr,"clusters_per_mft_record %d %d\n",nh1->clusters_per_mft_record,nh2->clusters_per_mft_record);
wdoprintf(stdscr,"clusters_per_index_record %d %d\n",nh1->clusters_per_index_record,nh2->clusters_per_index_record);
wprintw(stdscr,"clusters_per_mft_record %d %d\n",nh1->clusters_per_mft_record,nh2->clusters_per_mft_record);
wprintw(stdscr,"clusters_per_index_record %d %d\n",nh1->clusters_per_index_record,nh2->clusters_per_index_record);
return 0;
}
#endif

View file

@ -606,7 +606,7 @@ static list_part_t *add_partition_gpt_ncurses(disk_t *disk_car,list_part_t *list
};
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
wmove(stdscr,10, 0);
wclrtoeol(stdscr);
aff_part(stdscr,AFF_PART_SHORT,disk_car,new_partition);

View file

@ -1276,7 +1276,7 @@ static list_part_t *add_partition_i386_ncurses(disk_t *disk_car,list_part_t *lis
};
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
new_partition->part_offset=CHS2offset(disk_car,&start);
new_partition->part_size=CHS2offset(disk_car,&end) - new_partition->part_offset + disk_car->sector_size;
wmove(stdscr,10, 0);

View file

@ -208,15 +208,15 @@ static void write_part_mac_warning_ncurses(void)
WINDOW *window=newwin(0,0,0,0); /* full screen */
aff_copy(window);
wmove(window,7,0);
wdoprintf(window,"Function write_part_mac not implemented");
wprintw(window,"Function write_part_mac not implemented");
log_warning("Function write_part_mac not implemented\n");
wmove(window,8,0);
wdoprintf(window,"Use pdisk to recreate the missing partition");
wprintw(window,"Use pdisk to recreate the missing partition");
wmove(window,9,0);
wdoprintf(window,"using values displayed by TestDisk");
wprintw(window,"using values displayed by TestDisk");
wmove(window,22,0);
wattrset(window, A_REVERSE);
wdoprintf(window,"[ Abort ]");
wprintw(window,"[ Abort ]");
wattroff(window, A_REVERSE);
wrefresh(window);
while(wgetch(window)==ERR);
@ -327,7 +327,7 @@ static list_part_t *add_partition_mac_ncurses(disk_t *disk_car,list_part_t *list
};
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
wmove(stdscr,10, 0);
wclrtoeol(stdscr);
aff_part(stdscr,AFF_PART_SHORT,disk_car,new_partition);

View file

@ -301,7 +301,7 @@ static list_part_t *add_partition_sun_ncurses(disk_t *disk_car,list_part_t *list
};
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
new_partition->part_offset=CHS2offset(disk_car,&start);
new_partition->part_size=CHS2offset(disk_car,&end) - new_partition->part_offset + disk_car->sector_size;
wmove(stdscr,10, 0);

View file

@ -231,7 +231,7 @@ static list_part_t *add_partition_xbox_ncurses(disk_t *disk_car,list_part_t *lis
};
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description(disk_car));
wprintw(stdscr,"%s",disk_car->description(disk_car));
wmove(stdscr,10, 0);
wclrtoeol(stdscr);
aff_part(stdscr,AFF_PART_SHORT,disk_car,new_partition);

View file

@ -184,7 +184,7 @@ static void photorec_info(WINDOW *window, const file_stat_t *file_stats)
{
wmove(window,11+i,0);
wclrtoeol(window);
wdoprintf(window, "%s: %u recovered\n",
wprintw(window, "%s: %u recovered\n",
(new_file_stats[i].file_hint->extension!=NULL?
new_file_stats[i].file_hint->extension:""),
new_file_stats[i].recovered);
@ -196,7 +196,7 @@ static void photorec_info(WINDOW *window, const file_stat_t *file_stats)
{
wmove(window,11+10,0);
wclrtoeol(window);
wdoprintf(window, "others: %u recovered\n", others);
wprintw(window, "others: %u recovered\n", others);
}
free(new_file_stats);
}
@ -207,30 +207,30 @@ static int photorec_progressbar(WINDOW *window, const unsigned int pass, const p
wclrtoeol(window);
if(status==STATUS_EXT2_ON_BF || status==STATUS_EXT2_OFF_BF)
{
wdoprintf(window,"Bruteforce %10lu sectors remaining (test %u), %u files found\n",
wprintw(window,"Bruteforce %10lu sectors remaining (test %u), %u files found\n",
(unsigned long)((offset-partition->part_offset)/disk_car->sector_size), pass, file_nbr);
}
else
{
wdoprintf(window, "Pass %u - ", pass);
wprintw(window, "Pass %u - ", pass);
if(status==STATUS_FIND_OFFSET)
wdoprintf(window,"Reading sector %10lu/%lu, %u/10 headers found\n",
wprintw(window,"Reading sector %10lu/%lu, %u/10 headers found\n",
(unsigned long)((offset-partition->part_offset)/disk_car->sector_size),
(unsigned long)(partition->part_size/disk_car->sector_size), file_nbr);
else
wdoprintf(window,"Reading sector %10lu/%lu, %u files found\n",
wprintw(window,"Reading sector %10lu/%lu, %u files found\n",
(unsigned long)((offset-partition->part_offset)/disk_car->sector_size),
(unsigned long)(partition->part_size/disk_car->sector_size), file_nbr);
}
wmove(window,10,0);
wclrtoeol(window);
wdoprintf(window,"Elapsed time %uh%02um%02us",
wprintw(window,"Elapsed time %uh%02um%02us",
(unsigned)(elapsed_time/60/60),
(unsigned)(elapsed_time/60%60),
(unsigned)(elapsed_time%60));
if(offset-partition->part_offset!=0 && (status!=STATUS_EXT2_ON_BF && status!=STATUS_EXT2_OFF_BF))
{
wdoprintf(window," - Estimated time for achievement %uh%02um%02u\n",
wprintw(window," - Estimated time for achievement %uh%02um%02u\n",
(unsigned)((partition->part_offset+partition->part_size-1-offset)*elapsed_time/(offset-partition->part_offset)/3600),
(unsigned)(((partition->part_offset+partition->part_size-1-offset)*elapsed_time/(offset-partition->part_offset)/60)%60),
(unsigned)((partition->part_offset+partition->part_size-1-offset)*elapsed_time/(offset-partition->part_offset))%60);
@ -245,11 +245,11 @@ void aff_copy(WINDOW *window)
wclear(window);
keypad(window, TRUE); /* Need it to get arrow key */
wmove(window,0,0);
wdoprintf(window, "PhotoRec %s, Data Recovery Utility, %s\n",VERSION,TESTDISKDATE);
wprintw(window, "PhotoRec %s, Data Recovery Utility, %s\n",VERSION,TESTDISKDATE);
wmove(window,1,0);
wdoprintf(window, "Christophe GRENIER <grenier@cgsecurity.org>");
wprintw(window, "Christophe GRENIER <grenier@cgsecurity.org>");
wmove(window,2,0);
wdoprintf(window, "http://www.cgsecurity.org");
wprintw(window, "http://www.cgsecurity.org");
}
static int ask_mode_ext2(const disk_t *disk_car, const partition_t *partition, unsigned int *mode_ext2, unsigned int *carve_free_space_only)
@ -390,7 +390,7 @@ static unsigned int menu_choose_blocksize(unsigned int blocksize, const unsigned
}
aff_copy(stdscr);
wmove(stdscr,INTER_PARTITION_Y-1,0);
wdoprintf(stdscr,"Please select the block size, press Enter when done.");
wprintw(stdscr,"Please select the block size, press Enter when done.");
command = wmenuSelect_ext(stdscr,INTER_PARTITION_Y, INTER_PARTITION_X, menuBlocksize, 7,
optionsBlocksize, MENU_VERT| MENU_BUTTON|MENU_VERT_WARN, &menu,NULL);
switch(command)
@ -411,14 +411,14 @@ static unsigned int menu_choose_blocksize(unsigned int blocksize, const unsigned
unsigned int quit=0;
aff_copy(stdscr);
wmove(stdscr,INTER_PARTITION_Y-2,0);
wdoprintf(stdscr,"Please select the offset (0 - %u). Press Up/Down to increase/decrease it,",blocksize-sector_size);
wprintw(stdscr,"Please select the offset (0 - %u). Press Up/Down to increase/decrease it,",blocksize-sector_size);
wmove(stdscr,INTER_PARTITION_Y-1,0);
wdoprintf(stdscr,"Enter when done.");
wprintw(stdscr,"Enter when done.");
do
{
wmove(stdscr,INTER_PARTITION_Y,0);
wclrtoeol(stdscr);
wdoprintf(stdscr,"Offset %u",(unsigned int)(*offset));
wprintw(stdscr,"Offset %u",(unsigned int)(*offset));
switch(wgetch(stdscr))
{
case KEY_ENTER:
@ -1073,7 +1073,7 @@ static int photorec_aux(disk_t *disk_car, partition_t *partition, const int verb
{
wmove(stdscr,11,0);
wclrtoeol(stdscr);
wdoprintf(stdscr,"Error reading sector %10lu\n",
wprintw(stdscr,"Error reading sector %10lu\n",
(unsigned long)((offset-partition->part_offset)/disk_car->sector_size));
}
#endif
@ -1115,28 +1115,28 @@ static void recovery_finished(const unsigned int file_nbr, const char *recup_dir
{
wmove(stdscr,9,0);
wclrtoeol(stdscr);
wdoprintf(stdscr,"%u files saved in %s directory.\n",file_nbr,recup_dir);
wprintw(stdscr,"%u files saved in %s directory.\n",file_nbr,recup_dir);
wmove(stdscr,10,0);
wclrtoeol(stdscr);
switch(ind_stop)
{
case 0:
wdoprintf(stdscr,"Recovery completed.");
wprintw(stdscr,"Recovery completed.");
break;
case 1:
wdoprintf(stdscr,"Recovery aborted by the user.");
wprintw(stdscr,"Recovery aborted by the user.");
break;
case 2:
wdoprintf(stdscr,"Cannot create file in current directory.");
wprintw(stdscr,"Cannot create file in current directory.");
break;
case 3:
wdoprintf(stdscr,"Cannot write file, no space left.");
wprintw(stdscr,"Cannot write file, no space left.");
break;
}
wmove(stdscr,22,0);
wclrtoeol(stdscr);
wattrset(stdscr, A_REVERSE);
wdoprintf(stdscr,"[ Quit ]");
wprintw(stdscr,"[ Quit ]");
wattroff(stdscr, A_REVERSE);
wrefresh(stdscr);
while(1)
@ -1267,7 +1267,7 @@ static int photorec(disk_t *disk_car, partition_t *partition, const int verbose,
{
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description_short(disk_car));
wprintw(stdscr,"%s",disk_car->description_short(disk_car));
mvwaddstr(stdscr,5,0,msg_PART_HEADER_LONG);
wmove(stdscr,6,0);
aff_part(stdscr,AFF_PART_ORDER,disk_car,partition);
@ -1539,7 +1539,7 @@ static void menu_photorec_ncurses(disk_t *disk_car, int verbose, const char *rec
unsigned int i;
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr,"%s",disk_car->description_short(disk_car));
wprintw(stdscr,"%s",disk_car->description_short(disk_car));
mvwaddstr(stdscr,6,0,msg_PART_HEADER_LONG);
for(i=0,element=list_part;(element!=NULL) && (i<offset);element=element->next,i++);
for(i=offset;(element!=NULL) && ((i-offset)<INTER_SELECT);i++,element=element->next)
@ -1701,21 +1701,21 @@ static void photorec_disk_selection_ncurses(int verbose, const char *recup_dir,
int i;
aff_copy(stdscr);
wmove(stdscr,4,0);
wdoprintf(stdscr," PhotoRec is free software, and");
wprintw(stdscr," PhotoRec is free software, and");
wmove(stdscr,5,0);
wdoprintf(stdscr,"comes with ABSOLUTELY NO WARRANTY.");
wprintw(stdscr,"comes with ABSOLUTELY NO WARRANTY.");
wmove(stdscr,7,0);
wdoprintf(stdscr,"Select a media (use Arrow keys, then press Enter):");
wprintw(stdscr,"Select a media (use Arrow keys, then press Enter):");
for(i=0,element_disk=list_disk;(element_disk!=NULL) && (i<offset);element_disk=element_disk->next,i++);
for(;element_disk!=NULL && (i-offset)<10;i++,element_disk=element_disk->next)
{
wmove(stdscr,8+i-offset,0);
if(element_disk!=current_disk)
wdoprintf(stdscr,"%s\n",element_disk->disk->description_short(element_disk->disk));
wprintw(stdscr,"%s\n",element_disk->disk->description_short(element_disk->disk));
else
{
wattrset(stdscr, A_REVERSE);
wdoprintf(stdscr,"%s\n",element_disk->disk->description_short(element_disk->disk));
wprintw(stdscr,"%s\n",element_disk->disk->description_short(element_disk->disk));
wattroff(stdscr, A_REVERSE);
}
}
@ -1732,20 +1732,20 @@ static void photorec_disk_selection_ncurses(int verbose, const char *recup_dir,
if(geteuid()!=0)
{
wmove(stdscr,line++,0);
wdoprintf(stdscr,"Note: Some disks won't appear unless you're root user.");
wprintw(stdscr,"Note: Some disks won't appear unless you're root user.");
}
#endif
#endif
#endif
wmove(stdscr,line++,0);
if(line==22)
wdoprintf(stdscr,"Disk capacity must be correctly detected for a successful recovery.");
wprintw(stdscr,"Disk capacity must be correctly detected for a successful recovery.");
else
wdoprintf(stdscr,"Note: Disk capacity must be correctly detected for a successful recovery.");
wprintw(stdscr,"Note: Disk capacity must be correctly detected for a successful recovery.");
wmove(stdscr,line++,0);
wdoprintf(stdscr,"If a disk listed above has incorrect size, check HD jumper settings, BIOS");
wprintw(stdscr,"If a disk listed above has incorrect size, check HD jumper settings, BIOS");
wmove(stdscr,line++,0);
wdoprintf(stdscr,"detection, and install the latest OS patches and disk drivers.");
wprintw(stdscr,"detection, and install the latest OS patches and disk drivers.");
}
command = wmenuSelect_ext(stdscr,INTER_MAIN_Y, INTER_MAIN_X, menuMain, 8,
options, MENU_HORIZ | MENU_BUTTON | MENU_ACCEPT_OTHERS, &menu,&real_key);
@ -2018,13 +2018,13 @@ static void interface_file_select_ncurses(file_enable_t *files_enable)
{
aff_copy(stdscr);
wmove(stdscr,5,0);
wdoprintf(stdscr,"PhotoRec will try to locate the following files");
wprintw(stdscr,"PhotoRec will try to locate the following files");
rewrite=0;
}
wmove(stdscr,5+1,4);
wclrtoeol(stdscr);
if(offset>0)
wdoprintf(stdscr,"Previous");
wprintw(stdscr,"Previous");
for(i=offset;files_enable[i].file_hint!=NULL && ((i-offset)<INTER_SELECT);i++)
{
wmove(stdscr,5+2+i-offset,0);
@ -2032,14 +2032,14 @@ static void interface_file_select_ncurses(file_enable_t *files_enable)
if(i==current_element_num)
{
wattrset(stdscr, A_REVERSE);
wdoprintf(stdscr,"[%c] %-4s %s", (files_enable[i].enable==0?' ':'X'),
wprintw(stdscr,"[%c] %-4s %s", (files_enable[i].enable==0?' ':'X'),
(files_enable[i].file_hint->extension!=NULL?
files_enable[i].file_hint->extension:""),
files_enable[i].file_hint->description);
wattroff(stdscr, A_REVERSE);
} else
{
wdoprintf(stdscr,"[%c] %-4s %s", (files_enable[i].enable==0?' ':'X'),
wprintw(stdscr,"[%c] %-4s %s", (files_enable[i].enable==0?' ':'X'),
(files_enable[i].file_hint->extension!=NULL?
files_enable[i].file_hint->extension:""),
files_enable[i].file_hint->description);
@ -2048,7 +2048,7 @@ static void interface_file_select_ncurses(file_enable_t *files_enable)
wmove(stdscr,5+2+INTER_SELECT,4);
wclrtoeol(stdscr); /* before addstr for BSD compatibility */
if(files_enable[i].file_hint!=NULL)
wdoprintf(stdscr,"Next");
wprintw(stdscr,"Next");
command = wmenuSelect(stdscr,INTER_SELECT_Y, INTER_SELECT_X, menuAdv, 8,
"q", MENU_BUTTON | MENU_ACCEPT_OTHERS, menu);
switch(command)

View file

@ -80,11 +80,11 @@ void aff_copy(WINDOW *window)
wclear(window);
keypad(window, TRUE); /* Need it to get arrow key */
wmove(window,0,0);
wdoprintf(window, "TestDisk %s, Data Recovery Utility, %s",VERSION,TESTDISKDATE);
wprintw(window, "TestDisk %s, Data Recovery Utility, %s",VERSION,TESTDISKDATE);
wmove(window,1,0);
wdoprintf(window,"Christophe GRENIER <grenier@cgsecurity.org>");
wprintw(window,"Christophe GRENIER <grenier@cgsecurity.org>");
wmove(window,2,0);
wdoprintf(window,"http://www.cgsecurity.org");
wprintw(window,"http://www.cgsecurity.org");
}
#endif
@ -291,7 +291,7 @@ int main( int argc, char **argv )
#ifdef HAVE_NCURSES
aff_copy(stdscr);
wmove(stdscr,5,0);
wdoprintf(stdscr, "Please wait...\n");
wprintw(stdscr, "Please wait...\n");
#endif
/* Scan for available device only if no device or image has been supplied in parameter */
if(list_disk==NULL)
@ -303,7 +303,7 @@ int main( int argc, char **argv )
wmove(stdscr,6,0);
for(element_disk=list_disk;element_disk!=NULL;element_disk=element_disk->next)
{
wdoprintf(stdscr,"%s\n",element_disk->disk->description(element_disk->disk));
wprintw(stdscr,"%s\n",element_disk->disk->description(element_disk->disk));
}
wrefresh(stdscr);
#endif