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