[688] | 1 | /*
|
---|
| 2 | * $Id: mondo-rstr-newt.h 1106 2007-02-07 22:55:11Z bruno $
|
---|
| 3 | **/
|
---|
[1] | 4 |
|
---|
[783] | 5 | #include "my-stuff.h"
|
---|
[1] | 6 | #include "../common/mondostructures.h"
|
---|
| 7 | #include "../common/libmondo.h"
|
---|
| 8 | #ifdef __FreeBSD__
|
---|
| 9 | #define raid_device_record vinum_volume
|
---|
| 10 | #endif /*__FreeBSD__*/
|
---|
| 11 |
|
---|
[507] | 12 | #define NO_FLAWS_DETECTED _("No flaws detected in mountlist at this time. Hit 'OK' to proceed.")
|
---|
[1] | 13 |
|
---|
| 14 |
|
---|
| 15 | /** I found this in the code :) *******************************************/
|
---|
| 16 | char g_strings_of_flist_window[ARBITRARY_MAXIMUM][MAX_STR_LEN];
|
---|
| 17 | bool g_is_path_selected[ARBITRARY_MAXIMUM];
|
---|
| 18 | bool g_is_path_expanded[ARBITRARY_MAXIMUM];
|
---|
| 19 | char tmpnopath[MAX_STR_LEN + 2];
|
---|
| 20 | char tmpprevpath[MAX_STR_LEN + 2];
|
---|
| 21 |
|
---|
| 22 | /* external subroutines and global vars */
|
---|
| 23 |
|
---|
[59] | 24 | extern long get_time(void);
|
---|
| 25 | extern char *last_line_of_file(char *);
|
---|
| 26 | extern void center_string(char *, int);
|
---|
| 27 | extern bool does_file_exist(char *);
|
---|
| 28 | extern void finish(int);
|
---|
| 29 | extern long get_phys_size_of_drive(char *);
|
---|
| 30 | extern bool is_this_device_mounted(char *);
|
---|
| 31 | extern void strip_spaces(char *);
|
---|
| 32 | extern void initialize_raidrec(struct raid_device_record *);
|
---|
| 33 | extern int make_list_of_drives(struct mountlist_itself *,
|
---|
| 34 | char[ARBITRARY_MAXIMUM][MAX_STR_LEN]);
|
---|
| 35 | char *number_to_text(int);
|
---|
| 36 | extern void reload_filelist(struct s_node *);
|
---|
| 37 | extern void toggle_all_root_dirs_on(struct s_node *);
|
---|
| 38 | extern void toggle_path_expandability(struct s_node *, char *, bool);
|
---|
| 39 | extern void toggle_path_selection(struct s_node *, char *, bool);
|
---|
| 40 | extern void toggle_node_selection(struct s_node *, bool);
|
---|
| 41 | extern struct s_node *find_node_in_filelist(struct s_node *,
|
---|
| 42 | char *filename);
|
---|
| 43 | extern int what_number_cd_is_this(struct s_bkpinfo *);
|
---|
[1] | 44 | //extern void fatal_error (char *);
|
---|
[59] | 45 | extern void sort_mountlist_by_device(struct mountlist_itself *);
|
---|
| 46 | extern int load_mountlist(struct mountlist_itself *a, char *b);
|
---|
[1] | 47 | extern bool g_text_mode;
|
---|
| 48 |
|
---|
| 49 |
|
---|
| 50 | /* hacks */
|
---|
[59] | 51 | extern int load_raidtab_into_raidlist(struct raidlist_itself *a, char *b);
|
---|
[1] | 52 |
|
---|
| 53 |
|
---|
| 54 |
|
---|
| 55 | extern long g_start_time, g_minimum_progress, g_maximum_progress,
|
---|
[59] | 56 | g_current_progress, g_currentY;
|
---|
[1] | 57 | extern bool g_ISO_restore_mode;
|
---|
| 58 |
|
---|
| 59 | /* my subroutines */
|
---|
| 60 |
|
---|
[59] | 61 | void add_disklist_entry(struct list_of_disks *, char *,
|
---|
| 62 | struct mountlist_itself *);
|
---|
| 63 | void add_mountlist_entry(struct mountlist_itself *,
|
---|
| 64 | struct raidlist_itself *, newtComponent, int,
|
---|
| 65 | void *keylist[]);
|
---|
| 66 | void add_varslist_entry(struct raid_device_record *);
|
---|
| 67 | bool ask_me_yes_or_no(char *);
|
---|
| 68 | bool ask_me_OK_or_cancel(char *);
|
---|
| 69 | long calculate_raid_device_size(struct mountlist_itself *,
|
---|
| 70 | struct raidlist_itself *, char *);
|
---|
| 71 | void choose_raid_level(struct
|
---|
[1] | 72 | #ifdef __FreeBSD__
|
---|
[59] | 73 | vinum_plex
|
---|
[1] | 74 | #else
|
---|
[59] | 75 | raid_device_record
|
---|
[1] | 76 | #endif
|
---|
[59] | 77 | *);
|
---|
| 78 | void close_evalcall_form(void);
|
---|
| 79 | void close_progress_form(void);
|
---|
| 80 | void del_partns_listed_in_disklist(struct mountlist_itself *,
|
---|
| 81 | struct raidlist_itself *,
|
---|
| 82 | struct list_of_disks *);
|
---|
| 83 | void delete_disklist_entry(struct list_of_disks *, char *, int);
|
---|
| 84 | void delete_mountlist_entry(struct mountlist_itself *,
|
---|
| 85 | struct raidlist_itself *, newtComponent, int,
|
---|
| 86 | void *keylist[]);
|
---|
| 87 | void delete_raidlist_entry(struct mountlist_itself *,
|
---|
| 88 | struct raidlist_itself *, char *);
|
---|
| 89 | void delete_varslist_entry(struct raid_device_record *, int);
|
---|
| 90 | char *disklist_entry_to_string(struct list_of_disks *, int);
|
---|
| 91 | int edit_filelist(struct s_node *);
|
---|
| 92 | void edit_mountlist_entry(struct mountlist_itself *,
|
---|
| 93 | struct raidlist_itself *, newtComponent, int,
|
---|
| 94 | void *keylist[]);
|
---|
| 95 | void edit_raidlist_entry(struct mountlist_itself *,
|
---|
| 96 | struct raidlist_itself *,
|
---|
| 97 | struct raid_device_record *, int);
|
---|
| 98 | void edit_varslist_entry(struct raid_device_record *, int);
|
---|
| 99 | int edit_mountlist_in_newt(char *mountlist_fname,
|
---|
| 100 | struct mountlist_itself *,
|
---|
| 101 | struct raidlist_itself *);
|
---|
| 102 | int edit_mountlist(char *mountlist_fname, struct mountlist_itself *,
|
---|
| 103 | struct raidlist_itself *);
|
---|
| 104 | void edit_raidrec_additional_vars(struct raid_device_record *);
|
---|
| 105 | int evaluate_mountlist(struct mountlist_itself *, char *, char *, char *);
|
---|
| 106 | int find_device_in_mountlist(struct mountlist_itself *, char *);
|
---|
| 107 | int find_next_free_index_in_disklist(struct list_of_disks *);
|
---|
| 108 | int find_raid_device_in_raidlist(struct raidlist_itself *, char *);
|
---|
| 109 | bool get_isodir_info(char *, char *, char *, bool);
|
---|
| 110 | void initiate_new_raidlist_entry(struct raidlist_itself *,
|
---|
| 111 | struct mountlist_itself *, int, char *);
|
---|
| 112 | void insert_essential_additionalvars(struct raid_device_record *);
|
---|
| 113 | bool is_this_raid_personality_registered(int);
|
---|
| 114 | void log_file_end_to_screen(char *, char *);
|
---|
| 115 | void log_to_screen(const char *fmt, ...);
|
---|
| 116 | int look_for_duplicate_mountpoints(struct mountlist_itself *, char *);
|
---|
| 117 | void make_list_of_unallocated_raid_partitions(struct mountlist_itself *,
|
---|
| 118 | struct mountlist_itself *,
|
---|
| 119 | struct raidlist_itself *);
|
---|
| 120 | char *mountlist_entry_to_string(struct mountlist_itself *, int);
|
---|
| 121 | void mvaddstr_and_log_it(int, int, char *);
|
---|
[1106] | 122 | void nuke_mode_dummy(void);
|
---|
[59] | 123 | char *number_of_disks_as_string(int, char *);
|
---|
| 124 | void open_evalcall_form(char *);
|
---|
| 125 | void open_progress_form(char *, char *, char *, char *, long);
|
---|
| 126 | void popup_and_OK(char *);
|
---|
[688] | 127 | bool popup_and_get_string(char *, char *, char *);
|
---|
[59] | 128 | bool popup_with_buttons(char *, char *, char *);
|
---|
| 129 | void redraw_disklist(struct list_of_disks *, void *keylist[],
|
---|
| 130 | newtComponent);
|
---|
| 131 | void redraw_mountlist(struct mountlist_itself *, void *keylist[],
|
---|
| 132 | newtComponent);
|
---|
| 133 | void redraw_unallocpartnslist(struct mountlist_itself *, void *keylist[],
|
---|
| 134 | newtComponent);
|
---|
| 135 | void redraw_varslist(struct additional_raid_variables *, void *keylist[],
|
---|
| 136 | newtComponent);
|
---|
| 137 | int read_variableINT_and_remove_from_raidvars(struct raid_device_record *,
|
---|
| 138 | char *);
|
---|
| 139 | void refresh_log_screen(void);
|
---|
| 140 | void rejig_partition_name_in_raidlist_if_necessary(struct raidlist_itself
|
---|
| 141 | *, char *, char *);
|
---|
| 142 | void remove_essential_additionalvars(struct raid_device_record *);
|
---|
| 143 | void select_raid_disks(struct mountlist_itself *, struct raidlist_itself *,
|
---|
| 144 | struct raid_device_record *, char *,
|
---|
| 145 | struct list_of_disks *);
|
---|
| 146 | void setup_newt_stuff(void);
|
---|
| 147 | long size_of_specific_device(struct mountlist_itself *, char *);
|
---|
| 148 | bool spread_flaws_across_three_lines(char *, char *, char *, char *, int);
|
---|
| 149 | char *turn_raid_level_number_to_string(int);
|
---|
| 150 | void update_evalcall_form(int);
|
---|
| 151 | void update_progress_form(char *);
|
---|
| 152 | void update_progress_form_full(char *, char *, char *);
|
---|
| 153 | char which_restore_mode(void);
|
---|
| 154 | void write_variableINT_to_raid_var_line(struct raid_device_record *, int,
|
---|
| 155 | char *, int);
|
---|
| 156 | int where_in_drivelist_is_drive(struct list_of_disks *, char *);
|
---|
[1] | 157 | char *strip_path(char *);
|
---|
| 158 |
|
---|
| 159 | /* -------------------------------------------------------------------- */
|
---|
| 160 |
|
---|
| 161 |
|
---|
| 162 | #ifdef __FreeBSD__
|
---|
| 163 | #undef raid_device_record
|
---|
| 164 | #endif
|
---|