ui.h revision 9663:ace9a2ac3683
1/*
2    parted - a frontend to libparted
3    Copyright (C) 1999, 2000, 2001, 2007 Free Software Foundation, Inc.
4
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 3 of the License, or
8    (at your option) any later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program.  If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#ifndef UI_H_INCLUDED
20#define UI_H_INCLUDED
21
22#include "strlist.h"
23
24extern char*	prog_name;
25
26extern int init_ui ();
27extern int non_interactive_mode (PedDevice** dev, Command* cmd_list[],
28				 int argc, char* argv[]);
29extern int interactive_mode (PedDevice** dev, Command* cmd_list[]);
30extern void done_ui ();
31
32extern int screen_width ();
33extern void wipe_line ();
34
35extern void command_line_push_word (const char* word);
36extern char* command_line_pop_word ();
37extern char* command_line_peek_word ();
38extern void command_line_flush ();
39extern int command_line_get_word_count ();
40extern void command_line_prompt_words (const char* prompt, const char* def,
41				       const StrList* possibilities,
42				       int multi_word);
43extern char* command_line_get_word (const char* prompt, const char* def,
44				    const StrList* possibilities,
45				    int multi_word);
46extern int command_line_get_integer (const char* prompt, int* value);
47extern int command_line_get_sector (const char* prompt, PedDevice* dev,
48				    PedSector* value, PedGeometry** range);
49extern int command_line_get_state (const char* prompt, int* value);
50extern int command_line_get_device (const char* prompt, PedDevice** value);
51extern int command_line_get_disk (const char* prompt, PedDisk** value);
52extern int command_line_get_partition (const char* prompt, PedDisk* disk,
53				       PedPartition** value);
54extern int command_line_get_fs_type (const char* prompt,
55				     const PedFileSystemType*(* value));
56extern int command_line_get_disk_type (const char* prompt,
57				       const PedDiskType*(* value));
58extern int command_line_get_part_flag (const char* prompt,
59				       const PedPartition* part,
60				       PedPartitionFlag* flag);
61extern int command_line_get_part_type (const char* prompt, const PedDisk* disk,
62				       PedPartitionType* type);
63extern PedExceptionOption command_line_get_ex_opt (const char* prompt,
64						   PedExceptionOption options);
65extern int command_line_get_unit (const char* prompt, PedUnit* unit);
66
67extern int command_line_is_integer ();
68extern int command_line_is_sector ();
69
70extern void help_msg ();
71
72extern void print_using_dev (PedDevice* dev);
73
74/* in parted.c */
75extern int	opt_script_mode;
76extern int	pretend_input_tty;
77
78extern void print_options_help ();
79extern void print_commands_help ();
80
81
82#endif /* UI_H_INCLUDED */
83