summaryrefslogtreecommitdiffstats
path: root/src/addpart.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-05-15 17:53:26 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2013-05-15 17:53:26 +0200
commit816032140813972e230863a002b4acd1b15d2bcf (patch)
tree9c2b26ea8c5680b6127217c7c3933fb8f5c30252 /src/addpart.c
parent2dd9cec608a056ded9df373610854918f492a339 (diff)
split add_partition() into add_partition_cli() and add_partition_ncurses()
Diffstat (limited to 'src/addpart.c')
-rw-r--r--src/addpart.c46
1 files changed, 13 insertions, 33 deletions
diff --git a/src/addpart.c b/src/addpart.c
index a4b2ea3..a365413 100644
--- a/src/addpart.c
+++ b/src/addpart.c
@@ -32,13 +32,6 @@
#include "partmac.h"
#include "partsun.h"
#include "partxbox.h"
-#ifdef HAVE_NCURSES
-#include "parti386n.h"
-#include "partgptn.h"
-#include "partmacn.h"
-#include "partsunn.h"
-#include "partxboxn.h"
-#endif
#include "addpart.h"
extern const arch_fnct_t arch_gpt;
@@ -47,32 +40,19 @@ extern const arch_fnct_t arch_mac;
extern const arch_fnct_t arch_sun;
extern const arch_fnct_t arch_xbox;
-list_part_t *add_partition(disk_t *disk_car, list_part_t *list_part, char **current_cmd)
+list_part_t *add_partition_cli(disk_t *disk, list_part_t *list_part, char **current_cmd)
{
- if(*current_cmd!=NULL)
- {
- if(disk_car->arch==&arch_gpt)
- return add_partition_gpt_cli(disk_car, list_part, current_cmd);
- else if(disk_car->arch==&arch_i386)
- return add_partition_i386_cli(disk_car, list_part, current_cmd);
- else if(disk_car->arch==&arch_mac)
- return add_partition_mac_cli(disk_car, list_part, current_cmd);
- else if(disk_car->arch==&arch_sun)
- return add_partition_sun_cli(disk_car, list_part, current_cmd);
- else if(disk_car->arch==&arch_xbox)
- return add_partition_xbox_cli(disk_car, list_part, current_cmd);
- }
-#ifdef HAVE_NCURSES
- if(disk_car->arch==&arch_gpt)
- return add_partition_gpt_ncurses(disk_car, list_part, current_cmd);
- else if(disk_car->arch==&arch_i386)
- return add_partition_i386_ncurses(disk_car, list_part, current_cmd);
- else if(disk_car->arch==&arch_mac)
- return add_partition_mac_ncurses(disk_car, list_part, current_cmd);
- else if(disk_car->arch==&arch_sun)
- return add_partition_sun_ncurses(disk_car, list_part, current_cmd);
- else if(disk_car->arch==&arch_xbox)
- return add_partition_xbox_ncurses(disk_car, list_part, current_cmd);
-#endif
+ if(*current_cmd==NULL)
+ return list_part;
+ if(disk->arch==&arch_gpt)
+ return add_partition_gpt_cli(disk, list_part, current_cmd);
+ else if(disk->arch==&arch_i386)
+ return add_partition_i386_cli(disk, list_part, current_cmd);
+ else if(disk->arch==&arch_mac)
+ return add_partition_mac_cli(disk, list_part, current_cmd);
+ else if(disk->arch==&arch_sun)
+ return add_partition_sun_cli(disk, list_part, current_cmd);
+ else if(disk->arch==&arch_xbox)
+ return add_partition_xbox_cli(disk, list_part, current_cmd);
return list_part;
}