got a lot of crypt32 stuff working
[reactos.git] / rosapps / mc / src / main.h
1 #ifndef __MAIN_H
2 #define __MAIN_H
3 /* Toggling functions */
4 void toggle_eight_bit (void);
5 void toggle_clean_exec (void);
6 void toggle_show_backup (void);
7 void toggle_show_hidden (void);
8 void toggle_show_mini_status (void);
9 void toggle_align_extensions (void);
10 void toggle_mix_all_files (void);
11 void toggle_fast_reload (void);
12 void toggle_confirm_delete (void);
13
14 enum {
15 RP_NOCLEAR,
16 RP_CLEAR
17 };
18
19 #define UP_OPTIMIZE 0
20 #define UP_RELOAD 1
21 #define UP_ONLY_CURRENT 2
22
23 #define UP_KEEPSEL (char *) -1
24
25 extern int quote;
26 extern volatile int quit;
27
28 /* Execute functions: the base and the routines that use it */
29 void do_execute (const char *shell, const char *command, int internal_command);
30 #define execute_internal(command,args) do_execute (command, args, 1)
31
32 /* Execute functions that use the shell to execute */
33 void shell_execute (char *command, int flags);
34 void execute (char *command);
35
36 /* This one executes a shell */
37 void exec_shell ();
38
39 void subshell_chdir (char *command);
40
41 /* See main.c for details on these variables */
42 extern int mark_moves_down;
43 extern int auto_menu;
44 extern int pause_after_run;
45 extern int auto_save_setup;
46 extern int use_internal_view;
47 extern int use_internal_edit;
48 #ifdef USE_INTERNAL_EDIT
49 extern int option_word_wrap_line_length;
50 extern int edit_key_emulation;
51 extern int option_tab_spacing;
52 extern int option_fill_tabs_with_spaces;
53 extern int option_return_does_auto_indent;
54 extern int option_backspace_through_tabs;
55 extern int option_fake_half_tabs;
56 extern int option_save_mode;
57 extern int option_backup_ext_int;
58 extern int option_auto_para_formatting;
59 extern int option_typewriter_wrap;
60 extern int edit_confirm_save;
61 extern int option_syntax_highlighting;
62 #endif /* ! USE_INTERNAL_EDIT */
63 extern int fast_reload_w;
64 extern int clear_before_exec;
65 extern int mou_auto_repeat;
66 extern char *other_dir;
67 extern int mouse_move_pages;
68 extern int mouse_move_pages_viewer;
69 extern int eight_bit_clean;
70 extern int full_eight_bits;
71 extern int confirm_view_dir;
72 extern int fast_refresh;
73 extern int navigate_with_arrows;
74 extern int advanced_chfns;
75 extern int drop_menus;
76 extern int cd_symlinks;
77 extern int show_all_if_ambiguous;
78 extern int slow_terminal;
79 extern int update_prompt; /* To comunicate with subshell */
80 extern int confirm_delete;
81 extern int confirm_execute;
82 extern int confirm_exit;
83 extern int confirm_overwrite;
84 extern int iconify_on_exec;
85 extern int force_colors;
86 extern int boot_current_is_left;
87 extern int acs_vline;
88 extern int acs_hline;
89 extern int use_file_to_check_type;
90 extern int searching;
91 extern int vfs_use_limit;
92 extern int alternate_plus_minus;
93 extern int only_leading_plus_minus;
94 extern int ftpfs_directory_timeout;
95 extern int output_starts_shell;
96 extern int midnight_shutdown;
97 extern char search_buffer [256];
98 extern char cmd_buf [512];
99
100 #if HAVE_GNOME
101 #define MENU_PANEL get_current_panel ()
102 #define SELECTED_IS_PANEL 1
103 #else
104 /* The menu panels */
105 extern int is_right; /* If the selected menu was the right */
106 #define MENU_PANEL (is_right ? right_panel : left_panel)
107 #define SELECTED_IS_PANEL (get_display_type (is_right ? 1 : 0) == view_listing)
108 #endif
109
110 /* Useful macros to avoid too much typing */
111 #define cpanel get_current_panel()
112 #define opanel get_other_panel()
113
114 typedef void (*key_callback) ();
115 /* FIXME: We have to leave this type ambiguous, because `key_callback'
116 is used both for functions that take an argument and ones that don't.
117 That ought to be cleared up. */
118
119 /* The keymaps are of this type */
120 typedef struct {
121 int key_code;
122 key_callback fn;
123 } key_map;
124
125 void update_panels (int force_update, char *current_file);
126 void create_panels (void);
127 void repaint_screen (void);
128 void outrefresh_screen (void);
129 void suspend_cmd (void);
130 void do_update_prompt (void);
131
132 extern char control_file [];
133 extern char *shell;
134
135 /* FIXME: remove this when using slang */
136 extern const int status_using_ncurses;
137
138 void clr_scr (void);
139 void restore_console (void);
140
141 enum cd_enum {
142 cd_parse_command,
143 cd_exact
144 };
145
146 int do_cd (char *new_dir, enum cd_enum cd_type); /* For find.c */
147 void change_panel (void);
148 void init_sigchld (void); /* For subshell.c */
149 int load_prompt (int fd, void *unused);
150 void save_cwds_stat (void);
151 void copy_prog_name (void);
152 int quiet_quit_cmd (void); /* For cmd.c and command.c */
153 int quit_cmd (void);
154
155 void untouch_bar (void);
156 void touch_bar (void);
157 void load_hint (void);
158
159 void print_vfs_message(char *msg, ...);
160
161 extern char *prompt;
162 extern char *mc_home;
163
164 int maybe_cd (int char_code, int move_up_dir);
165 void do_possible_cd (char *dir);
166
167 #ifdef WANT_WIDGETS
168 extern WButtonBar *the_bar;
169 extern WLabel *the_prompt;
170 extern WLabel *the_hint;
171 extern Dlg_head *midnight_dlg;
172 extern WLabel *process_status;
173 #include "menu.h"
174 extern WMenu *the_menubar;
175
176 extern Dlg_head *midnight_dlg;
177
178 /* Back hack to define the following routines only if the client code
179 * has included panel.h
180 */
181 #ifdef __PANEL_H
182 void directory_history_add (WPanel *panel, char *s);
183 int do_panel_cd (WPanel *panel, char *new_dir, enum cd_enum cd_type);
184 void update_one_panel_widget (WPanel *panel, int force_update, char *current_file);
185 #endif
186
187 #endif
188
189 void edition_pre_exec (void);
190 void edition_post_exec (void);
191
192 #ifdef OS2_NT
193 # define MC_BASE ""
194 #else
195 # define MC_BASE "/.mc/"
196 #endif
197 #endif