source: MondoRescue/branches/3.3/mondo/src/mondorestore/mondo-rstr-newt.h@ 3858

Last change on this file since 3858 was 3858, checked in by Bruno Cornec, 3 months ago

remove center_string function to keep only mr_center_string

  • Property svn:keywords set to Id
File size: 7.8 KB
Line 
1/***************************************************************************
2 mondo-rstr-newt.h - description
3 -------------------
4 begin : Sat Apr 20 2002
5 copyright : (C) 2002 by Stan Benoit
6 email : troff@nakedsoul.org
7 cvsid : $Id: mondo-rstr-newt.h 3858 2024-03-06 23:52:46Z bruno $
8 ***************************************************************************/
9
10/***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18
19
20#include "my-stuff.h"
21#include "../common/mondostructures.h"
22#include "../common/libmondo.h"
23#ifdef __FreeBSD__
24#define raid_device_record vinum_volume
25#endif /*__FreeBSD__*/
26
27#define NO_FLAWS_DETECTED "No flaws detected in mountlist at this time. Hit 'OK' to proceed."
28
29
30/** I found this in the code :) *******************************************/
31char g_strings_of_flist_window[ARBITRARY_MAXIMUM][MAX_STR_LEN];
32bool g_is_path_selected[ARBITRARY_MAXIMUM];
33bool g_is_path_expanded[ARBITRARY_MAXIMUM];
34char tmpnopath[MAX_STR_LEN + 2];
35char tmpprevpath[MAX_STR_LEN + 2];
36
37/* external subroutines and global vars */
38
39extern long get_time(void);
40extern char *last_line_of_file(char *);
41extern bool does_file_exist(char *);
42extern void finish(int);
43extern long get_phys_size_of_drive(char *);
44extern bool is_this_device_mounted(char *);
45extern void strip_spaces(char *);
46extern void initialize_raidrec(struct raid_device_record *);
47extern int make_list_of_drives(struct mountlist_itself *,
48 char[ARBITRARY_MAXIMUM][MAX_STR_LEN]);
49char *number_to_text(int);
50extern void reload_filelist(struct s_node *);
51extern void toggle_all_root_dirs_on(struct s_node *);
52extern void toggle_path_expandability(struct s_node *, char *, bool);
53extern void toggle_path_selection(struct s_node *, char *, bool);
54extern void toggle_node_selection(struct s_node *, bool);
55extern struct s_node *find_node_in_filelist(struct s_node *,
56 char *filename);
57extern int what_number_cd_is_this();
58//extern void fatal_error (char *);
59extern void sort_mountlist_by_device(struct mountlist_itself *);
60extern int load_mountlist(struct mountlist_itself *a, char *b);
61extern bool g_text_mode;
62
63
64/* hacks */
65extern int load_raidtab_into_raidlist(struct raidlist_itself *a, char *b);
66
67
68
69extern long g_start_time, g_minimum_progress, g_maximum_progress,
70 g_current_progress, g_currentY;
71extern bool g_ISO_restore_mode;
72
73
74/* my global variables */
75
76//extern newtComponent g_progressForm, g_blurb1, g_blurb2, g_blurb3, g_label,
77// g_timeline, g_percentline, g_scale;
78//extern char err_log_lines[NOOF_ERR_LINES][MAX_STR_LEN], g_blurb_str_1[MAX_STR_LEN] =
79// "", g_blurb_str_2[MAX_STR_LEN] = "", g_blurb_str_3[MAX_STR_LEN] = "";
80//newtComponent g_isoform_main =
81// NULL, g_isoform_header, g_isoform_scale, g_isoform_timeline,
82// g_isoform_pcline;
83//long g_isoform_starttime;
84//int g_isoform_old_progress = -1;
85//char g_isoform_header_str[MAX_STR_LEN];
86//int g_mysterious_dot_counter;
87
88
89
90
91
92/* my subroutines */
93
94void add_disklist_entry(struct list_of_disks *, char *,
95 struct mountlist_itself *);
96void add_mountlist_entry(struct mountlist_itself *,
97 struct raidlist_itself *, newtComponent, int,
98 void *keylist[]);
99void add_varslist_entry(struct raid_device_record *);
100bool ask_me_yes_or_no(char *);
101bool ask_me_OK_or_cancel(char *);
102long calculate_raid_device_size(struct mountlist_itself *,
103 struct raidlist_itself *, char *);
104void choose_raid_level(struct
105#ifdef __FreeBSD__
106 vinum_plex
107#else
108 raid_device_record
109#endif
110 *);
111void close_evalcall_form(void);
112void close_progress_form(void);
113void del_partns_listed_in_disklist(struct mountlist_itself *,
114 struct raidlist_itself *,
115 struct list_of_disks *);
116void delete_disklist_entry(struct list_of_disks *, char *, int);
117void delete_mountlist_entry(struct mountlist_itself *,
118 struct raidlist_itself *, newtComponent, int,
119 void *keylist[]);
120void delete_raidlist_entry(struct mountlist_itself *,
121 struct raidlist_itself *, char *);
122void delete_varslist_entry(struct raid_device_record *, int);
123char *disklist_entry_to_string(struct list_of_disks *, int);
124int edit_filelist(struct s_node *);
125void edit_mountlist_entry(struct mountlist_itself *,
126 struct raidlist_itself *, newtComponent, int,
127 void *keylist[]);
128void edit_raidlist_entry(struct mountlist_itself *,
129 struct raidlist_itself *,
130 struct raid_device_record *, int);
131void edit_varslist_entry(struct raid_device_record *, int);
132int edit_mountlist_in_newt(char *mountlist_fname,
133 struct mountlist_itself *,
134 struct raidlist_itself *);
135int edit_mountlist(char *mountlist_fname, struct mountlist_itself *,
136 struct raidlist_itself *);
137void edit_raidrec_additional_vars(struct raid_device_record *);
138char *evaluate_mountlist(struct mountlist_itself *);
139int find_device_in_mountlist(struct mountlist_itself *, char *);
140int find_next_free_index_in_disklist(struct list_of_disks *);
141int find_raid_device_in_raidlist(struct raidlist_itself *, char *);
142void initiate_new_raidlist_entry(struct raidlist_itself *,
143 struct mountlist_itself *, int, char *);
144void insert_essential_additionalvars(struct raid_device_record *);
145bool is_this_raid_personality_registered(int);
146void log_file_end_to_screen(char *, char *);
147void log_to_screen(const char *fmt, ...);
148void make_list_of_unallocated_raid_partitions(struct mountlist_itself *,
149 struct mountlist_itself *,
150 struct raidlist_itself *);
151char *mountlist_entry_to_string(struct mountlist_itself *, int);
152void mvaddstr_and_log_it(int, int, char *);
153void nuke_mode_dummy();
154char *number_of_disks_as_string(int, char *);
155void open_evalcall_form(char *);
156void open_progress_form(char *, char *, char *, char *, long);
157void popup_and_OK(char *);
158bool popup_and_get_string(char *, char *, char *, int);
159bool popup_with_buttons(char *, char *, char *);
160void redraw_disklist(struct list_of_disks *, void *keylist[],
161 newtComponent);
162void redraw_mountlist(struct mountlist_itself *, void *keylist[],
163 newtComponent);
164void redraw_unallocpartnslist(struct mountlist_itself *, void *keylist[],
165 newtComponent);
166void redraw_varslist(struct additional_raid_variables *, void *keylist[],
167 newtComponent);
168int read_variableINT_and_remove_from_raidvars(struct raid_device_record *,
169 char *);
170void refresh_log_screen(void);
171void rejig_partition_name_in_raidlist_if_necessary(struct raidlist_itself
172 *, char *, char *);
173void remove_essential_additionalvars(struct raid_device_record *);
174void select_raid_disks(struct mountlist_itself *, struct raidlist_itself *,
175 struct raid_device_record *, char *,
176 struct list_of_disks *);
177void setup_newt_stuff(void);
178long size_of_specific_device(struct mountlist_itself *, char *);
179char *turn_raid_level_number_to_string(int);
180void update_evalcall_form(int);
181void update_progress_form(char *);
182char which_restore_mode(void);
183void write_variableINT_to_raid_var_line(struct raid_device_record *, int,
184 char *, int);
185int where_in_drivelist_is_drive(struct list_of_disks *, char *);
186char *strip_path(char *);
187
188
189
190
191/* -------------------------------------------------------------------- */
192
193
194
195
196char tmpnopath[MAX_STR_LEN + 2];
197char tmpprevpath[MAX_STR_LEN + 2];
198
199#ifdef __FreeBSD__
200#undef raid_device_record
201#endif
Note: See TracBrowser for help on using the repository browser.