2007-10-29 22:38:52 +01:00
|
|
|
/*
|
|
|
|
|
|
|
|
File: intrface.c
|
|
|
|
|
2009-01-14 22:13:47 +01:00
|
|
|
Copyright (C) 1998-2009 Christophe GRENIER <grenier@cgsecurity.org>
|
2007-10-29 22:38:52 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2009-06-12 08:42:45 +02:00
|
|
|
#include <stdio.h>
|
2007-10-29 22:38:52 +01:00
|
|
|
#ifdef HAVE_STRING_H
|
|
|
|
#include <string.h>
|
|
|
|
#endif
|
|
|
|
#include "types.h"
|
|
|
|
#include "common.h"
|
|
|
|
#include "lang.h"
|
|
|
|
#include "intrf.h"
|
|
|
|
#include "godmode.h"
|
|
|
|
#include "fnctdsk.h"
|
2009-01-14 22:13:47 +01:00
|
|
|
#include "chgtypen.h"
|
2007-10-29 22:38:52 +01:00
|
|
|
#include "savehdr.h"
|
|
|
|
#include "dirpart.h"
|
|
|
|
#include "log.h"
|
2007-11-13 23:35:47 +01:00
|
|
|
#include "io_redir.h"
|
2008-08-24 13:36:34 +02:00
|
|
|
#include "tload.h"
|
|
|
|
#include "intrface.h"
|
2009-01-14 22:13:47 +01:00
|
|
|
#include "addpart.h"
|
2013-05-15 17:53:26 +02:00
|
|
|
#ifdef HAVE_NCURSES
|
|
|
|
#include "intrfn.h"
|
|
|
|
#include "addpartn.h"
|
|
|
|
#endif
|
2007-10-29 22:38:52 +01:00
|
|
|
|
|
|
|
#define INTER_DISK_X 0
|
|
|
|
#define INTER_DISK_Y 7
|
|
|
|
|
2009-01-14 22:13:47 +01:00
|
|
|
extern const arch_fnct_t arch_none;
|
|
|
|
|
2012-04-21 14:20:50 +02:00
|
|
|
void interface_list(disk_t *disk, const int verbose, const int saveheader, const int backup)
|
2007-10-29 22:38:52 +01:00
|
|
|
{
|
|
|
|
list_part_t *list_part;
|
2012-04-21 14:20:50 +02:00
|
|
|
list_part_t *parts;
|
2007-10-29 22:38:52 +01:00
|
|
|
log_info("\nAnalyse ");
|
2012-04-21 14:20:50 +02:00
|
|
|
log_info("%s\n", disk->description(disk));
|
|
|
|
printf("%s\n", disk->description(disk));
|
2007-10-29 22:38:52 +01:00
|
|
|
printf(msg_PART_HEADER_LONG);
|
2012-04-21 14:20:50 +02:00
|
|
|
list_part=disk->arch->read_part(disk,verbose,saveheader);
|
2021-11-20 11:26:50 +01:00
|
|
|
/*@ assert valid_list_part(list_part); */
|
2012-04-21 14:20:50 +02:00
|
|
|
for(parts=list_part; parts!=NULL; parts=parts->next)
|
|
|
|
{
|
|
|
|
const char *msg;
|
|
|
|
const partition_t *partition=parts->part;
|
|
|
|
msg=aff_part_aux(AFF_PART_ORDER|AFF_PART_STATUS, disk, partition);
|
|
|
|
printf("%s\n", msg);
|
|
|
|
if(partition->info[0]!='\0')
|
|
|
|
printf(" %s\n", partition->info);
|
|
|
|
}
|
2007-10-29 22:38:52 +01:00
|
|
|
if(backup>0)
|
|
|
|
{
|
2012-04-21 14:20:50 +02:00
|
|
|
partition_save(disk, list_part, verbose);
|
2007-10-29 22:38:52 +01:00
|
|
|
}
|
|
|
|
part_free_list(list_part);
|
|
|
|
}
|
2007-12-06 00:29:52 +01:00
|
|
|
|
2007-10-29 22:38:52 +01:00
|
|
|
static list_part_t *ask_structure_cli(disk_t *disk_car,list_part_t *list_part, const int verbose, char **current_cmd)
|
|
|
|
{
|
2013-06-01 18:06:35 +02:00
|
|
|
const list_part_t *pos=list_part;
|
2018-03-17 17:29:28 +01:00
|
|
|
skip_comma_in_command(current_cmd);
|
|
|
|
if(check_command(current_cmd,"list",4)==0)
|
2007-10-29 22:38:52 +01:00
|
|
|
{
|
|
|
|
if(pos!=NULL)
|
2007-11-13 23:35:47 +01:00
|
|
|
{
|
2013-06-01 18:06:35 +02:00
|
|
|
const partition_t *partition=pos->part;
|
2007-11-13 23:35:47 +01:00
|
|
|
if(partition->sb_offset==0 || partition->sb_size==0)
|
2018-06-22 19:05:04 +02:00
|
|
|
dir_partition(disk_car, partition, verbose, 0, current_cmd);
|
2007-11-13 23:35:47 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
io_redir_add_redir(disk_car,
|
|
|
|
partition->part_offset+partition->sborg_offset,
|
|
|
|
partition->sb_size,
|
|
|
|
partition->part_offset+partition->sb_offset,
|
|
|
|
NULL);
|
2018-06-22 19:05:04 +02:00
|
|
|
dir_partition(disk_car, partition, verbose, 0, current_cmd);
|
2007-11-13 23:35:47 +01:00
|
|
|
io_redir_del_redir(disk_car, partition->part_offset+partition->sborg_offset);
|
|
|
|
}
|
|
|
|
}
|
2007-10-29 22:38:52 +01:00
|
|
|
}
|
|
|
|
return list_part;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef HAVE_NCURSES
|
2008-08-25 23:15:17 +02:00
|
|
|
#define INTER_STRUCTURE (LINES-12)
|
2014-02-02 15:24:26 +01:00
|
|
|
static list_part_t *ask_structure_ncurses(disk_t *disk_car,list_part_t *list_part, const int verbose)
|
2007-10-29 22:38:52 +01:00
|
|
|
{
|
|
|
|
int offset=0;
|
|
|
|
int pos_num=0;
|
|
|
|
list_part_t *pos=list_part;
|
|
|
|
int rewrite=1;
|
2008-08-25 23:15:17 +02:00
|
|
|
int old_LINES=LINES;
|
2007-10-29 22:38:52 +01:00
|
|
|
while(1)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int command;
|
|
|
|
list_part_t *parts;
|
|
|
|
int structure_status;
|
2008-08-25 23:15:17 +02:00
|
|
|
if(old_LINES!=LINES)
|
|
|
|
{
|
|
|
|
rewrite=1;
|
|
|
|
old_LINES=LINES;
|
|
|
|
}
|
2007-10-29 22:38:52 +01:00
|
|
|
if(rewrite)
|
|
|
|
{
|
|
|
|
aff_copy(stdscr);
|
|
|
|
wmove(stdscr,4,0);
|
2007-11-02 17:14:52 +01:00
|
|
|
wprintw(stdscr,"%s",disk_car->description(disk_car));
|
2007-10-29 22:38:52 +01:00
|
|
|
mvwaddstr(stdscr,5,0,msg_PART_HEADER);
|
|
|
|
rewrite=0;
|
|
|
|
}
|
|
|
|
structure_status=disk_car->arch->test_structure(list_part);
|
2008-08-25 23:15:17 +02:00
|
|
|
for(i=0,parts=list_part;
|
|
|
|
parts!=NULL && i<offset+INTER_STRUCTURE;
|
|
|
|
i++, parts=parts->next)
|
2007-10-29 22:38:52 +01:00
|
|
|
{
|
2008-08-25 23:15:17 +02:00
|
|
|
if(i<offset)
|
|
|
|
continue;
|
2007-10-29 22:38:52 +01:00
|
|
|
wmove(stdscr,6+i-offset,0);
|
|
|
|
wclrtoeol(stdscr); /* before addstr for BSD compatibility */
|
|
|
|
if(parts==pos)
|
|
|
|
wattrset(stdscr, A_REVERSE);
|
|
|
|
if(structure_status==0 && parts->part->status!=STATUS_DELETED && has_colors())
|
|
|
|
wbkgdset(stdscr,' ' | COLOR_PAIR(2));
|
2010-05-21 08:47:38 +02:00
|
|
|
if(parts==pos)
|
|
|
|
waddstr(stdscr, ">");
|
|
|
|
else
|
|
|
|
waddstr(stdscr, " ");
|
2007-12-06 00:29:52 +01:00
|
|
|
aff_part(stdscr, AFF_PART_STATUS, disk_car, parts->part);
|
2007-10-29 22:38:52 +01:00
|
|
|
if(structure_status==0 && parts->part->status!=STATUS_DELETED && has_colors())
|
|
|
|
wbkgdset(stdscr,' ' | COLOR_PAIR(0));
|
|
|
|
if(parts==pos)
|
|
|
|
{
|
|
|
|
char buffer_part_size[100];
|
|
|
|
wattroff(stdscr, A_REVERSE);
|
2008-08-25 23:15:17 +02:00
|
|
|
wmove(stdscr,LINES-1,0);
|
2007-10-29 22:38:52 +01:00
|
|
|
wclrtoeol(stdscr); /* before addstr for BSD compatibility */
|
|
|
|
if(parts->part->info[0]!='\0')
|
|
|
|
{
|
2007-11-02 17:14:52 +01:00
|
|
|
wprintw(stdscr,"%s, ",parts->part->info);
|
2007-10-29 22:38:52 +01:00
|
|
|
}
|
2010-10-24 20:30:19 +02:00
|
|
|
size_to_unit(parts->part->part_size, buffer_part_size);
|
|
|
|
wprintw(stdscr,"%s", buffer_part_size);
|
2007-10-29 22:38:52 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if(structure_status==0)
|
2009-08-27 08:47:16 +02:00
|
|
|
{
|
|
|
|
if(list_part!=NULL)
|
|
|
|
mvwaddstr(stdscr,LINES-6,0,msg_STRUCT_OK);
|
|
|
|
}
|
2007-10-29 22:38:52 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if(has_colors())
|
|
|
|
wbkgdset(stdscr,' ' | A_BOLD | COLOR_PAIR(1));
|
2008-08-25 23:15:17 +02:00
|
|
|
mvwaddstr(stdscr,LINES-6,0,msg_STRUCT_BAD);
|
2007-10-29 22:38:52 +01:00
|
|
|
if(has_colors())
|
|
|
|
wbkgdset(stdscr,' ' | COLOR_PAIR(0));
|
|
|
|
}
|
|
|
|
if(list_part!=NULL && disk_car->arch->msg_part_type!=NULL)
|
|
|
|
{
|
2008-08-25 23:15:17 +02:00
|
|
|
mvwaddstr(stdscr,LINES-6,16,"Use ");
|
2007-10-29 22:38:52 +01:00
|
|
|
if(has_colors())
|
|
|
|
wbkgdset(stdscr,' ' | A_BOLD | COLOR_PAIR(0));
|
|
|
|
waddstr(stdscr,"Up");
|
|
|
|
if(has_colors())
|
|
|
|
wbkgdset(stdscr,' ' | COLOR_PAIR(0));
|
|
|
|
waddstr(stdscr,"/");
|
|
|
|
if(has_colors())
|
|
|
|
wbkgdset(stdscr,' ' | A_BOLD | COLOR_PAIR(0));
|
|
|
|
waddstr(stdscr,"Down");
|
|
|
|
if(has_colors())
|
|
|
|
wbkgdset(stdscr,' ' | COLOR_PAIR(0));
|
|
|
|
waddstr(stdscr," Arrow keys to select partition.");
|
2008-08-25 23:15:17 +02:00
|
|
|
mvwaddstr(stdscr,LINES-5,0,"Use ");
|
2007-10-29 22:38:52 +01:00
|
|
|
if(has_colors())
|
|
|
|
wbkgdset(stdscr,' ' | A_BOLD | COLOR_PAIR(0));
|
|
|
|
waddstr(stdscr,"Left");
|
|
|
|
if(has_colors())
|
|
|
|
wbkgdset(stdscr,' ' | COLOR_PAIR(0));
|
|
|
|
waddstr(stdscr,"/");
|
|
|
|
if(has_colors())
|
|
|
|
wbkgdset(stdscr,' ' | A_BOLD | COLOR_PAIR(0));
|
|
|
|
waddstr(stdscr,"Right");
|
|
|
|
if(has_colors())
|
|
|
|
wbkgdset(stdscr,' ' | COLOR_PAIR(0));
|
|
|
|
waddstr(stdscr," Arrow keys to CHANGE partition characteristics:");
|
2008-08-25 23:15:17 +02:00
|
|
|
mvwaddstr(stdscr,LINES-4,0,disk_car->arch->msg_part_type);
|
2007-10-29 22:38:52 +01:00
|
|
|
}
|
2008-08-25 23:15:17 +02:00
|
|
|
wmove(stdscr,LINES-3,0);
|
2007-10-29 22:38:52 +01:00
|
|
|
wclrtoeol(stdscr); /* before addstr for BSD compatibility */
|
|
|
|
waddstr(stdscr,"Keys ");
|
2008-02-28 13:36:23 +01:00
|
|
|
/* If the disk can't be partionned, there is no partition to add and no partition to save */
|
2009-01-14 22:13:47 +01:00
|
|
|
if(disk_car->arch != &arch_none)
|
2008-02-28 13:36:23 +01:00
|
|
|
{
|
|
|
|
if(has_colors())
|
|
|
|
wbkgdset(stdscr,' ' | A_BOLD | COLOR_PAIR(0));
|
|
|
|
waddstr(stdscr,"A");
|
|
|
|
if(has_colors())
|
|
|
|
wbkgdset(stdscr,' ' | COLOR_PAIR(0));
|
|
|
|
waddstr(stdscr,": add partition, ");
|
|
|
|
if(has_colors())
|
|
|
|
wbkgdset(stdscr,' ' | A_BOLD | COLOR_PAIR(0));
|
|
|
|
waddstr(stdscr,"L");
|
|
|
|
if(has_colors())
|
|
|
|
wbkgdset(stdscr,' ' | COLOR_PAIR(0));
|
|
|
|
waddstr(stdscr,": load backup, ");
|
|
|
|
}
|
2007-10-29 22:38:52 +01:00
|
|
|
if(list_part==NULL)
|
|
|
|
{
|
|
|
|
waddstr(stdscr,"Enter: to continue");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if(pos->part->arch==NULL || pos->part->arch==disk_car->arch)
|
|
|
|
{
|
|
|
|
if(has_colors())
|
|
|
|
wbkgdset(stdscr,' ' | A_BOLD | COLOR_PAIR(0));
|
|
|
|
waddstr(stdscr,"T");
|
|
|
|
if(has_colors())
|
|
|
|
wbkgdset(stdscr,' ' | COLOR_PAIR(0));
|
|
|
|
waddstr(stdscr,": change type, ");
|
|
|
|
}
|
|
|
|
switch(pos->part->upart_type)
|
|
|
|
{
|
2011-02-07 09:17:12 +01:00
|
|
|
case UP_EXFAT:
|
2007-10-29 22:38:52 +01:00
|
|
|
case UP_EXT2:
|
|
|
|
case UP_EXT3:
|
2008-07-14 11:43:39 +02:00
|
|
|
case UP_EXT4:
|
2007-10-29 22:38:52 +01:00
|
|
|
case UP_RFS:
|
|
|
|
case UP_RFS2:
|
|
|
|
case UP_RFS3:
|
|
|
|
case UP_FAT12:
|
|
|
|
case UP_FAT16:
|
|
|
|
case UP_FAT32:
|
|
|
|
case UP_NTFS:
|
|
|
|
if(has_colors())
|
|
|
|
wbkgdset(stdscr,' ' | A_BOLD | COLOR_PAIR(0));
|
|
|
|
waddstr(stdscr,"P");
|
|
|
|
if(has_colors())
|
|
|
|
wbkgdset(stdscr,' ' | COLOR_PAIR(0));
|
|
|
|
waddstr(stdscr,": list files, ");
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if(has_colors())
|
|
|
|
wbkgdset(stdscr,' ' | A_BOLD | COLOR_PAIR(0));
|
2008-08-25 23:15:17 +02:00
|
|
|
mvwaddstr(stdscr,LINES-2,5, "Enter");
|
2007-10-29 22:38:52 +01:00
|
|
|
if(has_colors())
|
|
|
|
wbkgdset(stdscr,' ' | COLOR_PAIR(0));
|
|
|
|
waddstr(stdscr,": to continue");
|
|
|
|
}
|
|
|
|
wrefresh(stdscr);
|
|
|
|
command=wgetch(stdscr);
|
|
|
|
switch(command)
|
|
|
|
{
|
|
|
|
case KEY_UP:
|
|
|
|
if(list_part!=NULL)
|
|
|
|
{
|
|
|
|
only_one_bootable(list_part,pos);
|
|
|
|
if(pos->prev!=NULL)
|
|
|
|
{
|
|
|
|
pos=pos->prev;
|
|
|
|
pos_num--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case KEY_DOWN:
|
|
|
|
if(list_part!=NULL)
|
|
|
|
{
|
|
|
|
only_one_bootable(list_part,pos);
|
|
|
|
if(pos->next!=NULL)
|
|
|
|
{
|
|
|
|
pos=pos->next;
|
|
|
|
pos_num++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case KEY_PPAGE:
|
|
|
|
if(list_part!=NULL)
|
|
|
|
{
|
|
|
|
only_one_bootable(list_part,pos);
|
2008-08-24 13:36:34 +02:00
|
|
|
for(i=0; i<INTER_STRUCTURE && pos->prev!=NULL; i++)
|
2007-10-29 22:38:52 +01:00
|
|
|
{
|
|
|
|
pos=pos->prev;
|
|
|
|
pos_num--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case KEY_NPAGE:
|
|
|
|
if(list_part!=NULL)
|
|
|
|
{
|
|
|
|
only_one_bootable(list_part,pos);
|
2008-08-24 13:36:34 +02:00
|
|
|
for(i=0; i<INTER_STRUCTURE && pos->next!=NULL; i++)
|
2007-10-29 22:38:52 +01:00
|
|
|
{
|
|
|
|
pos=pos->next;
|
|
|
|
pos_num++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case KEY_RIGHT:
|
|
|
|
case '+':
|
|
|
|
case ' ':
|
|
|
|
if(list_part!=NULL)
|
|
|
|
{
|
|
|
|
if(pos->part->arch==NULL || pos->part->arch==disk_car->arch)
|
|
|
|
disk_car->arch->set_next_status(disk_car,pos->part);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case KEY_LEFT:
|
|
|
|
case '-':
|
|
|
|
if(list_part!=NULL)
|
|
|
|
{
|
|
|
|
if(pos->part->arch==NULL || pos->part->arch==disk_car->arch)
|
|
|
|
disk_car->arch->set_prev_status(disk_car,pos->part);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'a':
|
|
|
|
case 'A':
|
2009-01-14 22:13:47 +01:00
|
|
|
if(disk_car->arch != &arch_none)
|
2007-10-29 22:38:52 +01:00
|
|
|
{
|
2013-05-15 17:53:26 +02:00
|
|
|
list_part=add_partition_ncurses(disk_car, list_part);
|
2007-10-29 22:38:52 +01:00
|
|
|
rewrite=1;
|
|
|
|
offset=0;
|
|
|
|
pos_num=0;
|
|
|
|
pos=list_part;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 't':
|
|
|
|
case 'T':
|
|
|
|
if(list_part!=NULL)
|
|
|
|
{
|
|
|
|
rewrite=1;
|
2013-05-15 17:42:03 +02:00
|
|
|
change_part_type_ncurses(disk_car, pos->part);
|
2007-10-29 22:38:52 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'p':
|
|
|
|
case 'P':
|
|
|
|
if(list_part!=NULL)
|
2007-11-13 23:35:47 +01:00
|
|
|
{
|
2013-06-01 18:06:35 +02:00
|
|
|
const partition_t *partition=pos->part;
|
2014-02-02 15:24:26 +01:00
|
|
|
char *current_cmd=NULL;
|
2007-11-13 23:35:47 +01:00
|
|
|
if(partition->sb_offset==0 || partition->sb_size==0)
|
2018-06-22 19:05:04 +02:00
|
|
|
dir_partition(disk_car, partition, verbose, 0, ¤t_cmd);
|
2007-11-13 23:35:47 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
io_redir_add_redir(disk_car,
|
|
|
|
partition->part_offset+partition->sborg_offset,
|
|
|
|
partition->sb_size,
|
|
|
|
partition->part_offset+partition->sb_offset,
|
|
|
|
NULL);
|
2018-06-22 19:05:04 +02:00
|
|
|
dir_partition(disk_car, partition, verbose, 0, ¤t_cmd);
|
2007-11-13 23:35:47 +01:00
|
|
|
io_redir_del_redir(disk_car, partition->part_offset+partition->sborg_offset);
|
|
|
|
}
|
2009-03-22 14:53:02 +01:00
|
|
|
rewrite=1;
|
2007-11-13 23:35:47 +01:00
|
|
|
}
|
2007-10-29 22:38:52 +01:00
|
|
|
break;
|
2012-04-21 14:22:37 +02:00
|
|
|
case 'b':
|
|
|
|
case 'B':
|
|
|
|
if(partition_save(disk_car,list_part,verbose)<0)
|
|
|
|
display_message("Can't create backup.log.\n");
|
|
|
|
else
|
|
|
|
display_message("Results saved in backup.log.\n");
|
|
|
|
rewrite=1;
|
|
|
|
break;
|
2007-10-29 22:38:52 +01:00
|
|
|
case 'l':
|
|
|
|
case 'L':
|
2009-01-14 22:13:47 +01:00
|
|
|
if(disk_car->arch != &arch_none)
|
2008-02-28 13:36:23 +01:00
|
|
|
{
|
|
|
|
list_part=interface_load(disk_car,list_part,verbose);
|
|
|
|
rewrite=1;
|
|
|
|
offset=0;
|
|
|
|
pos_num=0;
|
|
|
|
pos=list_part;
|
|
|
|
}
|
2007-10-29 22:38:52 +01:00
|
|
|
break;
|
|
|
|
case 'q':
|
|
|
|
case '\r':
|
|
|
|
case '\n':
|
|
|
|
case KEY_ENTER:
|
|
|
|
#ifdef PADENTER
|
|
|
|
case PADENTER:
|
|
|
|
#endif
|
|
|
|
case 'M':
|
2015-09-05 18:11:16 +02:00
|
|
|
return list_part;
|
2007-10-29 22:38:52 +01:00
|
|
|
default:
|
|
|
|
/* log_trace("ask_structure command=%x\n",command); */
|
|
|
|
break;
|
|
|
|
}
|
2008-08-24 13:36:34 +02:00
|
|
|
if(pos_num<offset)
|
|
|
|
offset=pos_num;
|
|
|
|
if(pos_num>=offset+INTER_STRUCTURE)
|
|
|
|
offset=pos_num-INTER_STRUCTURE+1;
|
2007-10-29 22:38:52 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
list_part_t *ask_structure(disk_t *disk_car,list_part_t *list_part, const int verbose, char **current_cmd)
|
|
|
|
{
|
|
|
|
if(*current_cmd!=NULL)
|
|
|
|
return ask_structure_cli(disk_car, list_part, verbose, current_cmd);
|
|
|
|
#ifdef HAVE_NCURSES
|
2014-02-02 15:24:26 +01:00
|
|
|
return ask_structure_ncurses(disk_car, list_part, verbose);
|
2007-10-29 22:38:52 +01:00
|
|
|
#else
|
|
|
|
return list_part;
|
|
|
|
#endif
|
|
|
|
}
|