Added two macro examples:
[zuwinko.git] / src / filemanager / file.h
bloba6cc6567b932374e2b24e02a9f648e31715faa3d
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, const char *dirname);
21 /*** enums ***************************************************************************************/
23 /*** structures declarations (and typedefs of structures)*****************************************/
25 struct link;
27 /* status dialog of directory size computing */
28 typedef struct
30 Dlg_head *dlg;
31 WLabel *dirname;
32 } ComputeDirSizeUI;
34 /*** global variables defined in .c file *********************************************************/
36 /*** declarations of public functions ************************************************************/
38 FileProgressStatus copy_file_file (FileOpTotalContext * tctx, FileOpContext * ctx,
39 const char *src_path, const char *dst_path);
40 FileProgressStatus move_dir_dir (FileOpTotalContext * tctx, FileOpContext * ctx,
41 const char *s, const char *d);
42 FileProgressStatus copy_dir_dir (FileOpTotalContext * tctx, FileOpContext * ctx,
43 const char *s, const char *d,
44 gboolean toplevel, gboolean move_over, gboolean do_delete,
45 struct link *parent_dirs);
46 FileProgressStatus erase_dir (FileOpTotalContext * tctx, FileOpContext * ctx, const char *s);
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 char *dirname, 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 char *dirname);
65 /*** inline functions ****************************************************************************/
66 #endif /* MC__FILE_H */