Ticket #2384: allow rebind Fx keys in the file manager.
[midnight-commander.git] / src / filemanager / file.h
blob35a72a4fdf61ef6208bcd5e7d76e0fca7ce18fd1
1 /** \file file.h
2 * \brief Header: File and directory operation routines
3 */
5 #ifndef MC__FILE_H
6 #define MC__FILE_H
8 #include <inttypes.h> /* off_t, uintmax_t */
10 #include "lib/global.h"
11 #include "lib/widget.h"
13 #include "fileopctx.h"
15 /*** typedefs(not structures) and defined constants **********************************************/
17 /* Compute directory size */
18 /* callback to update status dialog */
19 typedef FileProgressStatus (*compute_dir_size_callback) (const void *ui,
20 const vfs_path_t * dirname_vpath);
22 /*** enums ***************************************************************************************/
24 /*** structures declarations (and typedefs of structures)*****************************************/
26 /* status dialog of directory size computing */
27 typedef struct
29 Dlg_head *dlg;
30 WLabel *dirname;
31 } ComputeDirSizeUI;
33 /*** global variables defined in .c file *********************************************************/
35 /*** declarations of public functions ************************************************************/
37 FileProgressStatus copy_file_file (FileOpTotalContext * tctx, FileOpContext * ctx,
38 const char *src_path, const char *dst_path);
39 FileProgressStatus move_dir_dir (FileOpTotalContext * tctx, FileOpContext * ctx,
40 const char *s, const char *d);
41 FileProgressStatus copy_dir_dir (FileOpTotalContext * tctx, FileOpContext * ctx,
42 const char *s, const char *d,
43 gboolean toplevel, gboolean move_over, gboolean do_delete,
44 GSList * parent_dirs);
45 FileProgressStatus erase_dir (FileOpTotalContext * tctx, FileOpContext * ctx,
46 const vfs_path_t * vpath);
48 gboolean panel_operate (void *source_panel, FileOperation op, gboolean force_single);
50 /* Error reporting routines */
52 /* Report error with one file */
53 FileProgressStatus file_error (const char *format, const char *file);
55 /* return value is FILE_CONT or FILE_ABORT */
56 FileProgressStatus compute_dir_size (const vfs_path_t * dirname_vpath, const void *ui,
57 compute_dir_size_callback cback,
58 size_t * ret_marked, uintmax_t * ret_total,
59 gboolean compute_symlinks);
61 ComputeDirSizeUI *compute_dir_size_create_ui (void);
62 void compute_dir_size_destroy_ui (ComputeDirSizeUI * ui);
63 FileProgressStatus compute_dir_size_update_ui (const void *ui, const vfs_path_t * dirname_vpath);
65 /*** inline functions ****************************************************************************/
66 #endif /* MC__FILE_H */