2009-02-05 21:28:18 +03:00
|
|
|
|
|
|
|
/** \file file.h
|
2009-04-16 09:26:52 +04:00
|
|
|
* \brief Header: File and directory operation routines
|
2009-02-05 21:28:18 +03:00
|
|
|
*/
|
2009-04-12 18:17:08 +04:00
|
|
|
|
2004-12-03 22:17:46 +03:00
|
|
|
#ifndef MC_FILE_H
|
|
|
|
#define MC_FILE_H
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2009-04-12 18:17:08 +04:00
|
|
|
#include "global.h"
|
2009-03-07 15:23:15 +03:00
|
|
|
#include <sys/types.h> /* off_t */
|
1999-01-14 04:10:32 +03:00
|
|
|
#include "fileopctx.h"
|
2009-04-12 18:17:08 +04:00
|
|
|
#include "dialog.h" /* Dlg_head */
|
|
|
|
#include "widget.h" /* WLabel */
|
1998-11-18 05:31:23 +03:00
|
|
|
|
1998-04-17 04:21:53 +04:00
|
|
|
struct link;
|
|
|
|
|
2009-03-08 12:49:28 +03:00
|
|
|
FileProgressStatus copy_file_file (FileOpContext *ctx, const char *s, const char *d,
|
|
|
|
int ask_overwrite, off_t *progress_count,
|
|
|
|
double *progress_bytes, int is_toplevel_file);
|
|
|
|
FileProgressStatus move_dir_dir (FileOpContext *ctx, const char *s, const char *d,
|
|
|
|
off_t *progress_count, double *progress_bytes);
|
|
|
|
FileProgressStatus copy_dir_dir (FileOpContext *ctx, const char *s, const char *d, int toplevel,
|
|
|
|
int move_over, int delete, struct link *parent_dirs,
|
|
|
|
off_t *progress_count, double *progress_bytes);
|
|
|
|
FileProgressStatus erase_dir (FileOpContext *ctx, const char *s, off_t *progress_count,
|
|
|
|
double *progress_bytes);
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2003-08-18 08:35:28 +04:00
|
|
|
int panel_operate (void *source_panel, FileOperation op, int force_single);
|
1998-11-18 05:31:23 +03:00
|
|
|
|
1998-12-05 02:39:41 +03:00
|
|
|
extern int file_op_compute_totals;
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
/* Error reporting routines */
|
|
|
|
|
2003-08-18 08:35:28 +04:00
|
|
|
/* Report error with one file */
|
2009-03-08 12:49:28 +03:00
|
|
|
FileProgressStatus file_error (const char *format, const char *file);
|
2003-08-18 08:35:28 +04:00
|
|
|
|
2009-04-12 18:17:08 +04:00
|
|
|
/* Compute directory size */
|
|
|
|
/* callback to update status dialog */
|
|
|
|
typedef FileProgressStatus (*compute_dir_size_callback)(const void *ui, const char *dirname);
|
|
|
|
|
|
|
|
/* return value is FILE_CONT or FILE_ABORT */
|
|
|
|
FileProgressStatus compute_dir_size (const char *dirname, const void *ui,
|
|
|
|
compute_dir_size_callback cback,
|
|
|
|
off_t *ret_marked, double *ret_total);
|
|
|
|
|
2009-04-13 20:26:01 +04:00
|
|
|
/* status dialog of directory size computing */
|
2009-04-12 18:17:08 +04:00
|
|
|
typedef struct {
|
|
|
|
Dlg_head *dlg;
|
|
|
|
WLabel *dirname;
|
|
|
|
} ComputeDirSizeUI;
|
|
|
|
|
|
|
|
ComputeDirSizeUI *compute_dir_size_create_ui (void);
|
|
|
|
void compute_dir_size_destroy_ui (ComputeDirSizeUI *ui);
|
|
|
|
FileProgressStatus compute_dir_size_update_ui (const void *ui, const char *dirname);
|
1998-12-05 02:39:41 +03:00
|
|
|
|
1998-11-18 05:31:23 +03:00
|
|
|
|
2009-04-12 18:17:08 +04:00
|
|
|
#endif /* MC_FILE_H */
|