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-03-07 15:23:15 +03:00
|
|
|
#include <sys/types.h> /* off_t */
|
2010-02-19 16:05:56 +03:00
|
|
|
#include <sys/time.h>
|
2009-10-11 20:18:54 +04:00
|
|
|
|
2010-01-20 18:11:52 +03:00
|
|
|
#include "lib/global.h"
|
2009-04-12 18:17:08 +04:00
|
|
|
#include "dialog.h" /* Dlg_head */
|
|
|
|
#include "widget.h" /* WLabel */
|
2009-10-11 20:18:54 +04:00
|
|
|
#include "fileopctx.h"
|
1998-11-18 05:31:23 +03:00
|
|
|
|
1998-04-17 04:21:53 +04:00
|
|
|
struct link;
|
|
|
|
|
2010-02-19 16:05:56 +03:00
|
|
|
FileProgressStatus copy_file_file (FileOpTotalContext *tctx, FileOpContext *ctx,
|
|
|
|
const char *src_path, const char *dst_path);
|
|
|
|
FileProgressStatus move_dir_dir (FileOpTotalContext *tctx, FileOpContext *ctx,
|
|
|
|
const char *s, const char *d);
|
|
|
|
FileProgressStatus copy_dir_dir (FileOpTotalContext *tctx, FileOpContext *ctx,
|
|
|
|
const char *s, const char *d,
|
|
|
|
gboolean toplevel, gboolean move_over, gboolean do_delete,
|
|
|
|
struct link *parent_dirs);
|
|
|
|
FileProgressStatus erase_dir (FileOpTotalContext *tctx, FileOpContext *ctx,
|
|
|
|
const char *s);
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2010-02-14 17:09:51 +03:00
|
|
|
gboolean panel_operate (void *source_panel, FileOperation op, gboolean 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,
|
2010-04-01 12:58:53 +04:00
|
|
|
off_t *ret_marked, double *ret_total, gboolean compute_symlinks);
|
2009-04-12 18:17:08 +04:00
|
|
|
|
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
|
|
|
|
2009-04-12 18:17:08 +04:00
|
|
|
#endif /* MC_FILE_H */
|