Ticket #1530
[pantumic.git] / src / file.h
blob6e964bb14389e8d210bcd04a4c188c45b40cbffc
2 /** \file file.h
3 * \brief Header: File and directory operation routines
4 */
6 #ifndef MC_FILE_H
7 #define MC_FILE_H
9 #include "global.h"
10 #include <sys/types.h> /* off_t */
11 #include "fileopctx.h"
12 #include "dialog.h" /* Dlg_head */
13 #include "widget.h" /* WLabel */
15 struct link;
17 FileProgressStatus copy_file_file (FileOpContext *ctx, const char *s, const char *d,
18 int ask_overwrite, off_t *progress_count,
19 double *progress_bytes, int is_toplevel_file);
20 FileProgressStatus move_dir_dir (FileOpContext *ctx, const char *s, const char *d,
21 off_t *progress_count, double *progress_bytes);
22 FileProgressStatus copy_dir_dir (FileOpContext *ctx, const char *s, const char *d, int toplevel,
23 int move_over, int delete, struct link *parent_dirs,
24 off_t *progress_count, double *progress_bytes);
25 FileProgressStatus erase_dir (FileOpContext *ctx, const char *s, off_t *progress_count,
26 double *progress_bytes);
28 int panel_operate (void *source_panel, FileOperation op, int force_single);
30 extern int file_op_compute_totals;
32 /* Error reporting routines */
34 /* Report error with one file */
35 FileProgressStatus file_error (const char *format, const char *file);
37 /* Compute directory size */
38 /* callback to update status dialog */
39 typedef FileProgressStatus (*compute_dir_size_callback)(const void *ui, const char *dirname);
41 /* return value is FILE_CONT or FILE_ABORT */
42 FileProgressStatus compute_dir_size (const char *dirname, const void *ui,
43 compute_dir_size_callback cback,
44 off_t *ret_marked, double *ret_total);
46 /* status dialog of directory size computing */
47 typedef struct {
48 Dlg_head *dlg;
49 WLabel *dirname;
50 } ComputeDirSizeUI;
52 ComputeDirSizeUI *compute_dir_size_create_ui (void);
53 void compute_dir_size_destroy_ui (ComputeDirSizeUI *ui);
54 FileProgressStatus compute_dir_size_update_ui (const void *ui, const char *dirname);
57 #endif /* MC_FILE_H */