summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Makefile.am8
-rw-r--r--src/chgarch.c81
-rw-r--r--src/chgarch.h31
-rw-r--r--src/chgarchn.c140
-rw-r--r--src/chgarchn.h31
-rw-r--r--src/chgtypen.c45
-rw-r--r--src/chgtypen.h1
-rw-r--r--src/intrfn.c94
-rw-r--r--src/intrfn.h1
-rw-r--r--src/pdisksel.c13
-rw-r--r--src/tdisksel.c13
11 files changed, 306 insertions, 152 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index f56dcb7..182bd02 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -19,8 +19,8 @@ base_H = alignio.h autoset.h common.h crc.h ewf.h fnctdsk.h hdaccess.h hdwin32
fs_C = analyse.c bfs.c bsd.c btrfs.c cramfs.c exfat.c fat.c fatx.c ext2.c jfs.c gfs2.c hfs.c hfsp.c hpfs.c luks.c lvm.c md.c netware.c ntfs.c rfs.c savehdr.c sun.c swap.c sysv.c ufs.c vmfs.c wbfs.c xfs.c zfs.c
fs_H = analyse.h bfs.h bsd.h btrfs.h cramfs.h exfat.h fat.h fatx.h ext2.h jfs_superblock.h jfs.h gfs2.h hfs.h hfsp.h hpfs.h luks.h lvm.h md.h netware.h ntfs.h rfs.h savehdr.h sun.h swap.h sysv.h ufs.h vmfs.h wbfs.h xfs.h zfs.h
-testdisk_ncurses_C = addpart.c adv.c askloc.c chgtype.c chgtypen.c dimage.c dirn.c dirpart.c diskacc.c diskcapa.c edit.c ext2_sb.c ext2_sbn.c fat1x.c fat32.c fat_adv.c fat_cluster.c fatn.c geometry.c geometryn.c godmode.c hiddenn.c intrface.c intrfn.c nodisk.c ntfs_adv.c ntfs_fix.c ntfs_udl.c parti386n.c partgptn.c partmacn.c partsunn.c partxboxn.c tanalyse.c tbanner.c tdelete.c tdiskop.c tdisksel.c testdisk.c texfat.c thfs.c tload.c tlog.c tmbrcode.c tntfs.c toptions.c tpartwr.c
-testdisk_ncurses_H = addpart.h adv.h askloc.h chgtype.h chgtypen.h dimage.h dirn.h dirpart.h diskacc.h diskcapa.h edit.h ext2_sb.h ext2_sbn.h fat1x.h fat32.h fat_adv.h fat_cluster.h fatn.h geometry.h geometryn.h godmode.h hiddenn.h intrface.h intrfn.h nodisk.h ntfs_fix.h ntfs_udl.h partgptn.h parti386n.h partmacn.h partsunn.h partxboxn.h tanalyse.h tdelete.h tdiskop.h tdisksel.h texfat.h thfs.h tload.h tlog.h tmbrcode.h tntfs.h toptions.h tpartwr.h
+testdisk_ncurses_C = addpart.c adv.c askloc.c chgarch.c chgarchn.c chgtype.c chgtypen.c dimage.c dirn.c dirpart.c diskacc.c diskcapa.c edit.c ext2_sb.c ext2_sbn.c fat1x.c fat32.c fat_adv.c fat_cluster.c fatn.c geometry.c geometryn.c godmode.c hiddenn.c intrface.c intrfn.c nodisk.c ntfs_adv.c ntfs_fix.c ntfs_udl.c parti386n.c partgptn.c partmacn.c partsunn.c partxboxn.c tanalyse.c tbanner.c tdelete.c tdiskop.c tdisksel.c testdisk.c texfat.c thfs.c tload.c tlog.c tmbrcode.c tntfs.c toptions.c tpartwr.c
+testdisk_ncurses_H = addpart.h adv.h askloc.h chgarch.h chgarchn.h chgtype.h chgtypen.h dimage.h dirn.h dirpart.h diskacc.h diskcapa.h edit.h ext2_sb.h ext2_sbn.h fat1x.h fat32.h fat_adv.h fat_cluster.h fatn.h geometry.h geometryn.h godmode.h hiddenn.h intrface.h intrfn.h nodisk.h ntfs_fix.h ntfs_udl.h partgptn.h parti386n.h partmacn.h partsunn.h partxboxn.h tanalyse.h tdelete.h tdiskop.h tdisksel.h texfat.h thfs.h tload.h tlog.h tmbrcode.h tntfs.h toptions.h tpartwr.h
testdisk_SOURCES = $(base_C) $(base_H) $(fs_C) $(fs_H) $(testdisk_ncurses_C) $(testdisk_ncurses_H) dir.c dir.h exfat_dir.c exfat_dir.h ext2_dir.c ext2_dir.h ext2_inc.h fat_dir.c fat_dir.h ntfs_dir.c ntfs_dir.h ntfs_inc.h partgptw.c rfs_dir.c rfs_dir.h setdate.c setdate.h $(ICON_TESTDISK) next.c next.h
@@ -294,8 +294,8 @@ photorec_C = photorec.c phcfg.c dir.c exfatp.c ext2grp.c ext2_dir.c ext2p.c fat
photorec_H = photorec.h phcfg.h dir.h exfatp.h ext2grp.h ext2p.h ext2_dir.h ext2_inc.h fat_dir.h fatp.h file_found.h geometry.h memmem.h ntfs_dir.h ntfsp.h ntfs_inc.h poptions.h sessionp.h setdate.h dfxml.h
-photorec_ncurses_C = addpart.c askloc.c chgtype.c chgtypen.c fat_cluster.c fat_unformat.c geometryn.c hiddenn.c intrfn.c nodisk.c parti386n.c partgptn.c partmacn.c partsunn.c partxboxn.c pbanner.c pblocksize.c pdisksel.c pfree_whole.c phbf.c phbs.c phnc.c phrecn.c ppartsel.c
-photorec_ncurses_H = addpart.h askloc.h chgtype.h chgtypen.h fat_cluster.h fat_unformat.h geometryn.h hiddenn.h intrfn.h nodisk.h parti386n.h partgptn.h partmacn.h partsunn.h partxboxn.h pblocksize.h pdisksel.h pfree_whole.h pnext.h phbf.h phbs.h phnc.h phrecn.h ppartsel.h
+photorec_ncurses_C = addpart.c askloc.c chgarch.c chgarchn.c chgtype.c chgtypen.c fat_cluster.c fat_unformat.c geometryn.c hiddenn.c intrfn.c nodisk.c parti386n.c partgptn.c partmacn.c partsunn.c partxboxn.c pbanner.c pblocksize.c pdisksel.c pfree_whole.c phbf.c phbs.c phnc.c phrecn.c ppartsel.c
+photorec_ncurses_H = addpart.h askloc.h chgarch.h chgarchn.h chgtype.h chgtypen.h fat_cluster.h fat_unformat.h geometryn.h hiddenn.h intrfn.h nodisk.h parti386n.h partgptn.h partmacn.h partsunn.h partxboxn.h pblocksize.h pdisksel.h pfree_whole.h pnext.h phbf.h phbs.h phnc.h phrecn.h ppartsel.h
photorec_SOURCES = phmain.c $(photorec_C) $(photorec_H) $(photorec_ncurses_C) $(photorec_ncurses_H) $(file_C) $(file_H) $(base_C) $(base_H) partgptro.c $(fs_C) $(fs_H) $(ICON_PHOTOREC) suspend_no.c
diff --git a/src/chgarch.c b/src/chgarch.c
new file mode 100644
index 0000000..699d1a9
--- /dev/null
+++ b/src/chgarch.c
@@ -0,0 +1,81 @@
+/*
+
+ File: chgarch.c
+
+ Copyright (C) 1998-2013 Christophe GRENIER <grenier@cgsecurity.org>
+
+ This software is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write the Free Software Foundation, Inc., 51
+ Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#include "types.h"
+#include "common.h"
+#include "log.h"
+#include "log_part.h"
+#include "autoset.h"
+#include "hdaccess.h"
+#include "chgarch.h"
+
+extern const arch_fnct_t arch_i386;
+extern const arch_fnct_t arch_gpt;
+extern const arch_fnct_t arch_humax;
+extern const arch_fnct_t arch_mac;
+extern const arch_fnct_t arch_none;
+extern const arch_fnct_t arch_sun;
+extern const arch_fnct_t arch_xbox;
+
+
+/* return 1 if user need to give the partition table type */
+int change_arch_type_cli(disk_t *disk, const int verbose, char**current_cmd)
+{
+ const arch_fnct_t *arch_list[]={&arch_i386, &arch_gpt, &arch_humax, &arch_mac, &arch_none, &arch_sun, &arch_xbox, NULL};
+ int keep_asking;
+ if(*current_cmd==NULL)
+ return 1;
+ do
+ {
+ int i;
+ keep_asking=0;
+ while(*current_cmd[0]==',')
+ (*current_cmd)++;
+ for(i=0;arch_list[i]!=NULL;i++)
+ if(strncmp(*current_cmd, arch_list[i]->part_name_option, strlen(arch_list[i]->part_name_option))==0)
+ {
+ (*current_cmd)+=strlen(arch_list[i]->part_name_option);
+ disk->arch=arch_list[i];
+ autoset_unit(disk);
+ hd_update_geometry(disk, verbose);
+ log_info("%s\n",disk->description_short(disk));
+ log_info("Partition table type: %s\n", disk->arch->part_name);
+ keep_asking=1;
+ }
+ if(strncmp(*current_cmd, "ask_type", 8)==0)
+ {
+ (*current_cmd)+=8;
+ return 1;
+ }
+ } while(keep_asking>0);
+ return 0;
+}
diff --git a/src/chgarch.h b/src/chgarch.h
new file mode 100644
index 0000000..5324933
--- /dev/null
+++ b/src/chgarch.h
@@ -0,0 +1,31 @@
+
+/*
+
+ File: chgarch.h
+
+ Copyright (C) 1998-2013 Christophe GRENIER <grenier@cgsecurity.org>
+
+ This software is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write the Free Software Foundation, Inc., 51
+ Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int change_arch_type_cli(disk_t *disk, const int verbose, char**current_cmd);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/chgarchn.c b/src/chgarchn.c
new file mode 100644
index 0000000..7ffa5ca
--- /dev/null
+++ b/src/chgarchn.c
@@ -0,0 +1,140 @@
+/*
+
+ File: chgarchn.c
+
+ Copyright (C) 1998-2013 Christophe GRENIER <grenier@cgsecurity.org>
+
+ This software is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write the Free Software Foundation, Inc., 51
+ Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_NCURSES
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#include "types.h"
+#include "common.h"
+#include "intrf.h"
+#include "intrfn.h"
+#include "log.h"
+#include "hdaccess.h"
+#include "autoset.h"
+#include "chgarchn.h"
+
+extern const arch_fnct_t arch_i386;
+extern const arch_fnct_t arch_gpt;
+extern const arch_fnct_t arch_humax;
+extern const arch_fnct_t arch_mac;
+extern const arch_fnct_t arch_none;
+extern const arch_fnct_t arch_sun;
+extern const arch_fnct_t arch_xbox;
+
+int change_arch_type_ncurses(disk_t *disk, const int verbose)
+{
+ /* arch_list must match the order from menuOptions */
+ const arch_fnct_t *arch_list[]={&arch_i386, &arch_gpt, &arch_humax, &arch_mac, &arch_none, &arch_sun, &arch_xbox, NULL};
+ unsigned int menu;
+ for(menu=0;arch_list[menu]!=NULL && disk->arch!=arch_list[menu];menu++);
+ if(arch_list[menu]==NULL)
+ {
+ menu=0;
+ disk->arch=arch_list[menu];
+ }
+ /* ncurses interface */
+ {
+ int car;
+ int real_key;
+ struct MenuItem menuOptions[]=
+ {
+ { 'I', arch_i386.part_name, "Intel/PC partition" },
+ { 'G', arch_gpt.part_name, "EFI GPT partition map (Mac i386, some x86_64...)" },
+ { 'H', arch_humax.part_name, "Humax partition table" },
+ { 'M', arch_mac.part_name, "Apple partition map" },
+ { 'N', arch_none.part_name, "Non partitioned media" },
+ { 'S', arch_sun.part_name, "Sun Solaris partition"},
+ { 'X', arch_xbox.part_name, "XBox partition"},
+ { 'Q', "Return", "Return to disk selection"},
+ { 0, NULL, NULL }
+ };
+ aff_copy(stdscr);
+ wmove(stdscr,5,0);
+ wprintw(stdscr,"%s\n",disk->description_short(disk));
+ wmove(stdscr,INTER_PARTITION_Y-1,0);
+ wprintw(stdscr,"Please select the partition table type, press Enter when done.");
+ if(disk->arch_autodetected!=NULL)
+ {
+ wmove(stdscr,19,0);
+ wprintw(stdscr, "Hint: ");
+ if(has_colors())
+ wbkgdset(stdscr,' ' | COLOR_PAIR(2));
+ wprintw(stdscr, "%s", disk->arch_autodetected->part_name);
+ if(has_colors())
+ wbkgdset(stdscr,' ' | COLOR_PAIR(0));
+ wprintw(stdscr, " partition table type has been detected.");
+ }
+ wmove(stdscr,20,0);
+ wprintw(stdscr,"Note: Do NOT select 'None' for media with only a single partition. It's very");
+ wmove(stdscr,21,0);
+ wprintw(stdscr,"rare for a drive to be 'Non-partitioned'.");
+ car=wmenuSelect_ext(stdscr, 23, INTER_PARTITION_Y, INTER_PARTITION_X, menuOptions, 7, "IGHMNSXQ", MENU_BUTTON | MENU_VERT | MENU_VERT_WARN, &menu,&real_key);
+ switch(car)
+ {
+ case 'i':
+ case 'I':
+ disk->arch=&arch_i386;
+ break;
+ case 'g':
+ case 'G':
+ disk->arch=&arch_gpt;
+ break;
+ case 'h':
+ case 'H':
+ disk->arch=&arch_humax;
+ break;
+ case 'm':
+ case 'M':
+ disk->arch=&arch_mac;
+ break;
+ case 'n':
+ case 'N':
+ disk->arch=&arch_none;
+ break;
+ case 's':
+ case 'S':
+ disk->arch=&arch_sun;
+ break;
+ case 'x':
+ case 'X':
+ disk->arch=&arch_xbox;
+ break;
+ case 'q':
+ case 'Q':
+ return 1;
+ }
+ }
+ autoset_unit(disk);
+ hd_update_geometry(disk, verbose);
+ log_info("%s\n", disk->description_short(disk));
+ log_info("Partition table type: %s\n", disk->arch->part_name);
+ return 0;
+}
+#endif
diff --git a/src/chgarchn.h b/src/chgarchn.h
new file mode 100644
index 0000000..1088079
--- /dev/null
+++ b/src/chgarchn.h
@@ -0,0 +1,31 @@
+/*
+
+ File: chgarchn.h
+
+ Copyright (C) 2007-2013 Christophe GRENIER <grenier@cgsecurity.org>
+
+ This software is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write the Free Software Foundation, Inc., 51
+ Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int change_arch_type_ncurses(disk_t *disk_car, const int verbose);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/chgtypen.c b/src/chgtypen.c
index 2e81a20..03a017f 100644
--- a/src/chgtypen.c
+++ b/src/chgtypen.c
@@ -23,6 +23,7 @@
#include <config.h>
#endif
+#ifdef HAVE_NCURSES
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -47,12 +48,10 @@
extern const arch_fnct_t arch_gpt;
extern const arch_fnct_t arch_i386;
-extern const arch_fnct_t arch_mac;
extern const arch_fnct_t arch_none;
extern const arch_fnct_t arch_sun;
extern const struct systypes_gtp gpt_sys_types[];
-#ifdef HAVE_NCURSES
struct part_name_struct
{
unsigned int index;
@@ -399,45 +398,3 @@ void change_part_type(const disk_t *disk_car,partition_t *partition, char **curr
log_partition(disk_car,partition);
}
#endif
-
-int interface_partition_type(disk_t *disk_car, const int verbose, char**current_cmd)
-{
- const arch_fnct_t *arch_list[]={&arch_i386, &arch_gpt, &arch_none, &arch_sun, &arch_mac, NULL};
- int ask_user=1;
- if(*current_cmd!=NULL)
- {
- int keep_asking;
- do
- {
- int i;
- ask_user=0;
- keep_asking=0;
- while(*current_cmd[0]==',')
- (*current_cmd)++;
- for(i=0;arch_list[i]!=NULL;i++)
- if(strncmp(*current_cmd, arch_list[i]->part_name_option, strlen(arch_list[i]->part_name_option))==0)
- {
- (*current_cmd)+=strlen(arch_list[i]->part_name_option);
- disk_car->arch=arch_list[i];
- autoset_unit(disk_car);
- keep_asking=1;
- }
- if(strncmp(*current_cmd, "ask_type", 8)==0)
- {
- (*current_cmd)+=8;
- ask_user=1;
- }
- } while(keep_asking>0);
- }
- if(ask_user>0)
- {
-#ifdef HAVE_NCURSES
- if(interface_partition_type_ncurses(disk_car))
- return 1;
-#endif
- }
- log_info("%s\n",disk_car->description_short(disk_car));
- log_info("Partition table type: %s\n",disk_car->arch->part_name);
- hd_update_geometry(disk_car, verbose);
- return 0;
-}
diff --git a/src/chgtypen.h b/src/chgtypen.h
index 4ad3d1e..cc89617 100644
--- a/src/chgtypen.h
+++ b/src/chgtypen.h
@@ -24,7 +24,6 @@ extern "C" {
#endif
void change_part_type(const disk_t *disk_car,partition_t *partition, char **current_cmd);
-int interface_partition_type(disk_t *disk_car, const int verbose, char**current_cmd);
#ifdef __cplusplus
} /* closing brace for extern "C" */
diff --git a/src/intrfn.c b/src/intrfn.c
index 26a77bb..dbea886 100644
--- a/src/intrfn.c
+++ b/src/intrfn.c
@@ -66,13 +66,6 @@
#include "hdaccess.h"
#include "autoset.h"
-extern const arch_fnct_t arch_i386;
-extern const arch_fnct_t arch_gpt;
-extern const arch_fnct_t arch_humax;
-extern const arch_fnct_t arch_mac;
-extern const arch_fnct_t arch_none;
-extern const arch_fnct_t arch_sun;
-extern const arch_fnct_t arch_xbox;
extern char intr_buffer_screen[MAX_LINES][BUFFER_LINE_LENGTH+1];
extern int intr_nbr_line;
@@ -1300,93 +1293,6 @@ int check_enter_key_or_s(WINDOW *window)
return 0;
}
-int interface_partition_type_ncurses(disk_t *disk_car)
-{
- /* arch_list must match the order from menuOptions */
- const arch_fnct_t *arch_list[]={&arch_i386, &arch_gpt, &arch_humax, &arch_mac, &arch_none, &arch_sun, &arch_xbox, NULL};
- unsigned int menu;
- for(menu=0;arch_list[menu]!=NULL && disk_car->arch!=arch_list[menu];menu++);
- if(arch_list[menu]==NULL)
- {
- menu=0;
- disk_car->arch=arch_list[menu];
- }
- /* ncurses interface */
- {
- int car;
- int real_key;
- struct MenuItem menuOptions[]=
- {
- { 'I', arch_i386.part_name, "Intel/PC partition" },
- { 'G', arch_gpt.part_name, "EFI GPT partition map (Mac i386, some x86_64...)" },
- { 'H', arch_humax.part_name, "Humax partition table" },
- { 'M', arch_mac.part_name, "Apple partition map" },
- { 'N', arch_none.part_name, "Non partitioned media" },
- { 'S', arch_sun.part_name, "Sun Solaris partition"},
- { 'X', arch_xbox.part_name, "XBox partition"},
- { 'Q', "Return", "Return to disk selection"},
- { 0, NULL, NULL }
- };
- aff_copy(stdscr);
- wmove(stdscr,5,0);
- wprintw(stdscr,"%s\n",disk_car->description_short(disk_car));
- wmove(stdscr,INTER_PARTITION_Y-1,0);
- wprintw(stdscr,"Please select the partition table type, press Enter when done.");
- if(disk_car->arch_autodetected!=NULL)
- {
- wmove(stdscr,19,0);
- wprintw(stdscr, "Hint: ");
- if(has_colors())
- wbkgdset(stdscr,' ' | COLOR_PAIR(2));
- wprintw(stdscr, "%s", disk_car->arch_autodetected->part_name);
- if(has_colors())
- wbkgdset(stdscr,' ' | COLOR_PAIR(0));
- wprintw(stdscr, " partition table type has been detected.");
- }
- wmove(stdscr,20,0);
- wprintw(stdscr,"Note: Do NOT select 'None' for media with only a single partition. It's very");
- wmove(stdscr,21,0);
- wprintw(stdscr,"rare for a drive to be 'Non-partitioned'.");
- car=wmenuSelect_ext(stdscr, 23, INTER_PARTITION_Y, INTER_PARTITION_X, menuOptions, 7, "IGHMNSXQ", MENU_BUTTON | MENU_VERT | MENU_VERT_WARN, &menu,&real_key);
- switch(car)
- {
- case 'i':
- case 'I':
- disk_car->arch=&arch_i386;
- break;
- case 'g':
- case 'G':
- disk_car->arch=&arch_gpt;
- break;
- case 'h':
- case 'H':
- disk_car->arch=&arch_humax;
- break;
- case 'm':
- case 'M':
- disk_car->arch=&arch_mac;
- break;
- case 'n':
- case 'N':
- disk_car->arch=&arch_none;
- break;
- case 's':
- case 'S':
- disk_car->arch=&arch_sun;
- break;
- case 'x':
- case 'X':
- disk_car->arch=&arch_xbox;
- break;
- case 'q':
- case 'Q':
- return 1;
- }
- }
- autoset_unit(disk_car);
- return 0;
-}
-
void screen_buffer_to_interface(void)
{
{
diff --git a/src/intrfn.h b/src/intrfn.h
index 27f6c6f..1698c4f 100644
--- a/src/intrfn.h
+++ b/src/intrfn.h
@@ -61,7 +61,6 @@ int wmenuSimple(WINDOW *window, const struct MenuItem *menuItems, const unsigned
int menu_to_command(const unsigned int yinfo, const unsigned int y, const unsigned int x, const struct MenuItem *menuItems, const unsigned int itemLength, const char *available, const int menuType, const unsigned int y_real, const unsigned int x_real);
int start_ncurses(const char *prog_name, const char *real_prog_name);
int end_ncurses(void);
-int interface_partition_type_ncurses(disk_t *disk_car);
int vaff_txt(int line, WINDOW *window, const char *_format, va_list ap) __attribute__((format(printf, 3, 0)));
char *ask_log_location(const char*filename, const int errsv);
int get_string(WINDOW *window, char *str, const int len, const char *def);
diff --git a/src/pdisksel.c b/src/pdisksel.c
index 8183d8c..684fd0f 100644
--- a/src/pdisksel.c
+++ b/src/pdisksel.c
@@ -52,7 +52,8 @@
#include "hidden.h"
#include "hiddenn.h"
#include "nodisk.h"
-#include "chgtypen.h"
+#include "chgarch.h"
+#include "chgarchn.h"
#ifdef HAVE_NCURSES
#define NBR_DISK_MAX (LINES-6-8)
@@ -94,8 +95,14 @@ static int photorec_disk_selection_cli(struct ph_param *params, struct ph_option
}
autodetect_arch(disk, &arch_none);
params->disk=disk;
- if(interface_partition_type(disk, options->verbose, &params->cmd_run)==0)
+ if(change_arch_type_cli(disk, options->verbose, &params->cmd_run)==0
+#ifdef HAVE_NCURSES
+ || change_arch_type_ncurses(disk, options->verbose)==0
+#endif
+ )
+ {
menu_photorec(params, options, list_search_space);
+ }
return 0;
}
@@ -272,7 +279,7 @@ static int photorec_disk_selection_ncurses(struct ph_param *params, struct ph_op
params->disk=disk;
if((hpa_dco==0 || interface_check_hidden_ncurses(disk, hpa_dco)==0) &&
(options->expert == 0 ||
- interface_partition_type(disk, options->verbose, &params->cmd_run)==0))
+ change_arch_type_ncurses(disk, options->verbose)==0))
menu_photorec(params, options, list_search_space);
}
break;
diff --git a/src/tdisksel.c b/src/tdisksel.c
index 6b3aa03..f2c11dd 100644
--- a/src/tdisksel.c
+++ b/src/tdisksel.c
@@ -46,7 +46,8 @@
#include "hidden.h"
#include "hiddenn.h"
#include "nodisk.h"
-#include "chgtypen.h"
+#include "chgarch.h"
+#include "chgarchn.h"
#include "autoset.h"
#ifdef HAVE_NCURSES
@@ -84,7 +85,6 @@ static int testdisk_disk_selection_ncurses(int verbose,int dump_ind, const list_
{
const char *options;
int i;
-#ifdef HAVE_NCURSES
aff_copy(stdscr);
wmove(stdscr,4,0);
wprintw(stdscr," TestDisk is free software, and");
@@ -92,7 +92,6 @@ static int testdisk_disk_selection_ncurses(int verbose,int dump_ind, const list_
wprintw(stdscr,"comes with ABSOLUTELY NO WARRANTY.");
wmove(stdscr,7,0);
wprintw(stdscr,"Select a media (use Arrow keys, then press Enter):");
-#endif
for(i=0,element_disk=list_disk;
element_disk!=NULL && i<offset+NBR_DISK_MAX;
i++, element_disk=element_disk->next)
@@ -195,7 +194,7 @@ static int testdisk_disk_selection_ncurses(int verbose,int dump_ind, const list_
if(interface_check_disk_capacity(disk)==0 &&
interface_check_disk_access(disk, current_cmd)==0 &&
(hpa_dco==0 || interface_check_hidden_ncurses(disk, hpa_dco)==0) &&
- interface_partition_type(disk, verbose, current_cmd)==0)
+ change_arch_type_ncurses(disk, verbose)==0)
{
if(menu_disk(disk, verbose, dump_ind, saveheader, current_cmd))
return 0;
@@ -246,7 +245,11 @@ static int testdisk_disk_selection_cli(int verbose,int dump_ind, const list_disk
autoset_unit(disk);
if(interface_check_disk_capacity(disk)==0 &&
interface_check_disk_access(disk, current_cmd)==0 &&
- interface_partition_type(disk, verbose, current_cmd)==0)
+ (change_arch_type_cli(disk, verbose, current_cmd)==0
+#ifdef HAVE_NCURSES
+ || change_arch_type_ncurses(disk, verbose)==0
+#endif
+ ))
{
menu_disk(disk, verbose, dump_ind, saveheader, current_cmd);
}