diff options
author | William Wilgus <wilgus.william@gmail.com> | 2024-06-21 10:38:50 -0400 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2024-06-30 02:09:40 -0400 |
commit | dc7486c7de3018b78fcfeafe7a1cc5c9da168494 (patch) | |
tree | ca5326e18d88f650e8132c2b9760199701448df2 /apps/fileop.h | |
parent | c87c09658a7d65249affe3e8a814bd278998bb42 (diff) | |
download | rockbox-dc7486c7de3018b78fcfeafe7a1cc5c9da168494.tar.gz rockbox-dc7486c7de3018b78fcfeafe7a1cc5c9da168494.zip |
[Feature] onplay.c show file progress
first some clean-up of onplay.c
extend/move fileobject copy, move, delete routines in prep for other users
add error checking, better error codes
pre scan to make sure the operation doesn't exceed system resources
show progress for file and directory copies
Change-Id: Ife2e62df554892dab651bab40433bf70b27e73ff
Diffstat (limited to 'apps/fileop.h')
-rw-r--r-- | apps/fileop.h | 70 |
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 */ | ||
27 | enum 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 | |||
43 | enum 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 | |||
51 | enum 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 | |||
61 | int create_dir(void); | ||
62 | |||
63 | int rename_file(const char *selected_file); | ||
64 | |||
65 | int delete_fileobject(const char *selected_file); | ||
66 | |||
67 | int copy_move_fileobject(const char *src_path, const char *dst_path, | ||
68 | unsigned int flags); | ||
69 | |||
70 | #endif /* FILEOP_H */ | ||