Changes to handle vfs_path_t object:
[midnight-commander.git] / src / filemanager / file.h
blob4a1d63b7a297b736c2334e16a5d57bce70193934
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 struct link;
28 /* status dialog of directory size computing */
29 typedef struct
31 Dlg_head *dlg;
32 WLabel *dirname;
33 } ComputeDirSizeUI;
35 /*** global variables defined in .c file *********************************************************/
37 /*** declarations of public functions ************************************************************/
39 FileProgressStatus copy_file_file (FileOpTotalContext * tctx, FileOpContext * ctx,
40 const char *src_path, const char *dst_path);
41 FileProgressStatus move_dir_dir (FileOpTotalContext * tctx, FileOpContext * ctx,
42 const char *s, const char *d);
43 FileProgressStatus copy_dir_dir (FileOpTotalContext * tctx, FileOpContext * ctx,
44 const char *s, const char *d,
45 gboolean toplevel, gboolean move_over, gboolean do_delete,
46 struct link *parent_dirs);
47 FileProgressStatus erase_dir (FileOpTotalContext * tctx, FileOpContext * ctx, const char *s);
49 gboolean panel_operate (void *source_panel, FileOperation op, gboolean force_single);
51 /* Error reporting routines */
53 /* Report error with one file */
54 FileProgressStatus file_error (const char *format, const char *file);
56 /* return value is FILE_CONT or FILE_ABORT */
57 FileProgressStatus compute_dir_size (const vfs_path_t * dirname_vpath, const void *ui,
58 compute_dir_size_callback cback,
59 size_t * ret_marked, uintmax_t * ret_total,
60 gboolean compute_symlinks);
62 ComputeDirSizeUI *compute_dir_size_create_ui (void);
63 void compute_dir_size_destroy_ui (ComputeDirSizeUI * ui);
64 FileProgressStatus compute_dir_size_update_ui (const void *ui, const vfs_path_t * dirname_vpath);
66 /*** inline functions ****************************************************************************/
67 #endif /* MC__FILE_H */