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