summaryrefslogtreecommitdiffstats
path: root/src/adv.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2009-01-14 22:13:47 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2009-01-14 22:13:47 +0100
commit1650fe5b8b6cea638c280df13605aea816718a00 (patch)
treefed11bd9361236aba47157d859607c109db05814 /src/adv.c
parent56e1c29b2c0614b0b3230946d72e1eaf37618bcc (diff)
Split ncurses text interface from functions
Diffstat (limited to 'src/adv.c')
-rw-r--r--src/adv.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/adv.c b/src/adv.c
index e887410..de237c0 100644
--- a/src/adv.c
+++ b/src/adv.c
@@ -2,7 +2,7 @@
File: adv.c
- Copyright (C) 1998-2008 Christophe GRENIER <grenier@cgsecurity.org>
+ Copyright (C) 1998-2009 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
@@ -22,7 +22,8 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-
+
+#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -35,21 +36,25 @@
#include "intrf.h"
#include "intrfn.h"
#include "fnctdsk.h"
-#include "chgtype.h"
+#include "chgtypen.h"
#include "dirpart.h"
#include "fat.h"
#include "ntfs.h"
#include "adv.h"
#include "analyse.h"
#include "log.h"
+#include "log_part.h"
#include "guid_cmp.h"
#include "dimage.h"
#include "ntfs_udl.h"
#include "ext2_sb.h"
+#include "ext2_sbn.h"
#include "fat1x.h"
#include "fat32.h"
#include "tntfs.h"
#include "thfs.h"
+#include "askloc.h"
+#include "addpart.h"
extern const arch_fnct_t arch_gpt;
extern const arch_fnct_t arch_i386;
@@ -378,9 +383,9 @@ void interface_adv(disk_t *disk_car, const int verbose,const int dump_ind, const
break;
case 'a':
case 'A':
- if(disk_car->arch->add_partition!=NULL)
+ if(disk_car->arch!=&arch_none)
{
- list_part=disk_car->arch->add_partition(disk_car,list_part, verbose, current_cmd);
+ list_part=add_partition(disk_car, list_part, verbose, current_cmd);
current_element=list_part;
rewrite=1;
}
@@ -463,10 +468,14 @@ void interface_adv(disk_t *disk_car, const int verbose,const int dump_ind, const
case 'C':
{
char *image_dd;
+#ifdef HAVE_NCURSES
if(*current_cmd!=NULL)
image_dd=get_default_location();
else
image_dd=ask_location("Do you want to save partition file image.dd in %s%s ? [Y/N]","");
+#else
+ image_dd=get_default_location();
+#endif
if(image_dd!=NULL)
{
char *new_recup_dir=(char *)MALLOC(strlen(image_dd)+1+strlen(DEFAULT_IMAGE_NAME)+1);