summaryrefslogtreecommitdiff
path: root/apps/fileop.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/fileop.h')
-rw-r--r--apps/fileop.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/apps/fileop.h b/apps/fileop.h
new file mode 100644
index 0000000000..f8237dc64f
--- /dev/null
+++ b/apps/fileop.h
@@ -0,0 +1,70 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 Björn Stenberg
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef FILEOP_H
22#define FILEOP_H
23
24#include "file.h"
25
26/* result codes of various file operations */
27enum fileop_result_code
28{
29 FORC_READ_FAILURE = -7,
30 FORC_WRITE_FAILURE = -6,
31 FORC_NO_BUFFER_AVAIL = -5,
32 FORC_TOO_MANY_SUBDIRS = -4,
33 FORC_PATH_TOO_LONG = -3,
34 FORC_PATH_NOT_EXIST = -2,
35 FORC_UNKNOWN_FAILURE = -1,
36 /* Anything < 0 is failure */
37 FORC_SUCCESS = 0, /* All operations completed successfully */
38 FORC_NOOP = 1, /* Operation didn't need to do anything */
39 FORC_CANCELLED = 2, /* Operation was cancelled by user */
40 FORC_NOOVERWRT = 3,
41};
42
43enum file_op_flags
44{
45 PASTE_CUT = 0x00, /* Is a move (cut) operation (default) */
46 PASTE_COPY = 0x01, /* Is a copy operation */
47 PASTE_OVERWRITE = 0x02, /* Overwrite destination */
48 PASTE_EXDEV = 0x04, /* Actually copy/move across volumes */
49};
50
51enum file_op_current
52{
53 FOC_NONE = 0,
54 FOC_COUNT,
55 FOC_MOVE,
56 FOC_COPY,
57 FOC_DELETE,
58 FOC_CREATE,
59};
60
61int create_dir(void);
62
63int rename_file(const char *selected_file);
64
65int delete_fileobject(const char *selected_file);
66
67int copy_move_fileobject(const char *src_path, const char *dst_path,
68 unsigned int flags);
69
70#endif /* FILEOP_H */