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
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
#ifndef MC__FILE_H
|
|
|
|
#define MC__FILE_H
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2011-09-27 23:13:50 +04:00
|
|
|
#include <inttypes.h> /* off_t, uintmax_t */
|
2009-10-11 20:18:54 +04:00
|
|
|
|
2010-01-20 18:11:52 +03:00
|
|
|
#include "lib/global.h"
|
2010-11-12 11:03:57 +03:00
|
|
|
#include "lib/widget.h"
|
2010-11-10 22:45:56 +03:00
|
|
|
|
2009-10-11 20:18:54 +04:00
|
|
|
#include "fileopctx.h"
|
1998-11-18 05:31:23 +03:00
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/*** typedefs(not structures) and defined constants **********************************************/
|
|
|
|
|
|
|
|
/* Compute directory size */
|
|
|
|
/* callback to update status dialog */
|
2013-01-17 17:13:50 +04:00
|
|
|
typedef FileProgressStatus (*compute_dir_size_callback) (void *ui, const vfs_path_t * dirname_vpath,
|
|
|
|
size_t dir_count, uintmax_t total_size);
|
2010-11-10 14:09:42 +03:00
|
|
|
|
|
|
|
/*** enums ***************************************************************************************/
|
|
|
|
|
|
|
|
/*** structures declarations (and typedefs of structures)*****************************************/
|
|
|
|
|
|
|
|
/* status dialog of directory size computing */
|
|
|
|
typedef struct
|
|
|
|
{
|
2012-09-28 11:18:45 +04:00
|
|
|
WDialog *dlg;
|
2010-11-10 14:09:42 +03:00
|
|
|
WLabel *dirname;
|
|
|
|
} ComputeDirSizeUI;
|
|
|
|
|
|
|
|
/*** global variables defined in .c file *********************************************************/
|
|
|
|
|
|
|
|
/*** declarations of public functions ************************************************************/
|
|
|
|
|
2010-04-06 09:50:33 +04: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,
|
2012-01-24 18:33:37 +04:00
|
|
|
GSList * parent_dirs);
|
2011-11-30 01:20:26 +04:00
|
|
|
FileProgressStatus erase_dir (FileOpTotalContext * tctx, FileOpContext * ctx,
|
|
|
|
const vfs_path_t * vpath);
|
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-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
|
|
|
/* return value is FILE_CONT or FILE_ABORT */
|
2013-01-17 17:13:50 +04:00
|
|
|
FileProgressStatus compute_dir_size (const vfs_path_t * dirname_vpath, void *ui,
|
2010-04-06 09:50:33 +04:00
|
|
|
compute_dir_size_callback cback,
|
2013-09-08 16:50:29 +04:00
|
|
|
size_t * ret_count, uintmax_t * ret_total,
|
2010-04-06 09:50:33 +04:00
|
|
|
gboolean compute_symlinks);
|
2009-04-12 18:17:08 +04:00
|
|
|
|
2013-01-15 12:14:00 +04:00
|
|
|
ComputeDirSizeUI *compute_dir_size_create_ui (gboolean allow_skip);
|
2010-04-06 09:50:33 +04:00
|
|
|
void compute_dir_size_destroy_ui (ComputeDirSizeUI * ui);
|
2013-01-17 17:13:50 +04:00
|
|
|
FileProgressStatus compute_dir_size_update_ui (void *ui, const vfs_path_t * dirname_vpath,
|
|
|
|
size_t dir_count, uintmax_t total_size);
|
1998-12-05 02:39:41 +03:00
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/*** inline functions ****************************************************************************/
|
|
|
|
#endif /* MC__FILE_H */
|