Changed src/filemanager/file.c to handle vfs_path_t objects.
[midnight-commander.git] / src / filemanager / file.h
blobb15ba706006067c451d4e14860bd359db96cac35
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,
48 const vfs_path_t * vpath);
50 gboolean panel_operate (void *source_panel, FileOperation op, gboolean force_single);
52 /* Error reporting routines */
54 /* Report error with one file */
55 FileProgressStatus file_error (const char *format, const char *file);
57 /* return value is FILE_CONT or FILE_ABORT */
58 FileProgressStatus compute_dir_size (const vfs_path_t * dirname_vpath, const void *ui,
59 compute_dir_size_callback cback,
60 size_t * ret_marked, uintmax_t * ret_total,
61 gboolean compute_symlinks);
63 ComputeDirSizeUI *compute_dir_size_create_ui (void);
64 void compute_dir_size_destroy_ui (ComputeDirSizeUI * ui);
65 FileProgressStatus compute_dir_size_update_ui (const void *ui, const vfs_path_t * dirname_vpath);
67 /*** inline functions ****************************************************************************/
68 #endif /* MC__FILE_H */