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 
  24 extern char*    prog_name;
  25 
  26 extern int init_ui ();
  27 extern int non_interactive_mode (PedDevice** dev, Command* cmd_list[],
  28                                  int argc, char* argv[]);
  29 extern int interactive_mode (PedDevice** dev, Command* cmd_list[]);
  30 extern void done_ui ();
  31 
  32 extern int screen_width ();
  33 extern void wipe_line ();
  34 
  35 extern void command_line_push_word (const char* word);
  36 extern char* command_line_pop_word ();
  37 extern char* command_line_peek_word ();
  38 extern void command_line_flush ();
  39 extern int command_line_get_word_count ();
  40 extern void command_line_prompt_words (const char* prompt, const char* def,
  41                                        const StrList* possibilities,
  42                                        int multi_word);
  43 extern char* command_line_get_word (const char* prompt, const char* def,
  44                                     const StrList* possibilities,
  45                                     int multi_word);
  46 extern int command_line_get_integer (const char* prompt, int* value);
  47 extern int command_line_get_sector (const char* prompt, PedDevice* dev,
  48                                     PedSector* value, PedGeometry** range);
  49 extern int command_line_get_state (const char* prompt, int* value);
  50 extern int command_line_get_device (const char* prompt, PedDevice** value);
  51 extern int command_line_get_disk (const char* prompt, PedDisk** value);
  52 extern int command_line_get_partition (const char* prompt, PedDisk* disk,
  53                                        PedPartition** value);
  54 extern int command_line_get_fs_type (const char* prompt,
  55                                      const PedFileSystemType*(* value));
  56 extern int command_line_get_disk_type (const char* prompt,
  57                                        const PedDiskType*(* value));
  58 extern int command_line_get_part_flag (const char* prompt,
  59                                        const PedPartition* part,
  60                                        PedPartitionFlag* flag);
  61 extern int command_line_get_part_type (const char* prompt, const PedDisk* disk,
  62                                        PedPartitionType* type);
  63 extern PedExceptionOption command_line_get_ex_opt (const char* prompt,
  64                                                    PedExceptionOption options);
  65 extern int command_line_get_unit (const char* prompt, PedUnit* unit);
  66 
  67 extern int command_line_is_integer ();
  68 extern int command_line_is_sector ();
  69 
  70 extern void help_msg ();
  71 
  72 extern void print_using_dev (PedDevice* dev);
  73 
  74 /* in parted.c */
  75 extern int      opt_script_mode;
  76 extern int      pretend_input_tty;
  77 
  78 extern void print_options_help ();
  79 extern void print_commands_help ();
  80 
  81 
  82 #endif /* UI_H_INCLUDED */