diff options
Diffstat (limited to 'firmware/target/hosted/filesystem-hosted.h')
-rw-r--r-- | firmware/target/hosted/filesystem-hosted.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/firmware/target/hosted/filesystem-hosted.h b/firmware/target/hosted/filesystem-hosted.h new file mode 100644 index 0000000000..3d979eb19d --- /dev/null +++ b/firmware/target/hosted/filesystem-hosted.h | |||
@@ -0,0 +1,74 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2014 by Michael Sevakis | ||
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 _FILESYSTEM_HOSTED_H_ | ||
22 | #define _FILESYSTEM_HOSTED_H_ | ||
23 | |||
24 | #include "mv.h" | ||
25 | |||
26 | int os_volume_path(IF_MV(int volume, ) char *buffer, size_t bufsize); | ||
27 | void * os_lc_open(const char *ospath); | ||
28 | |||
29 | #endif /* _FILESYSTEM_HOSTED_H_ */ | ||
30 | |||
31 | #ifdef _FILE_H_ | ||
32 | #ifndef _FILESYSTEM_HOSTED__FILE_H_ | ||
33 | #define _FILESYSTEM_HOSTED__FILE_H_ | ||
34 | |||
35 | #ifndef OSFUNCTIONS_DECLARED | ||
36 | off_t os_filesize(int osfd); | ||
37 | int os_fsamefile(int osfd1, int osfd2); | ||
38 | int os_relate(const char *path1, const char *path2); | ||
39 | bool os_file_exists(const char *ospath); | ||
40 | |||
41 | #define __OPEN_MODE_ARG \ | ||
42 | , ({ \ | ||
43 | mode_t mode = 0; \ | ||
44 | if (oflag & O_CREAT) \ | ||
45 | { \ | ||
46 | va_list ap; \ | ||
47 | va_start(ap, oflag); \ | ||
48 | mode = va_arg(ap, unsigned int); \ | ||
49 | va_end(ap); \ | ||
50 | } \ | ||
51 | mode; }) | ||
52 | |||
53 | #define __CREAT_MODE_ARG \ | ||
54 | , mode | ||
55 | |||
56 | #endif /* OSFUNCTIONS_DECLARED */ | ||
57 | |||
58 | #endif /* _FILESYSTEM_HOSTED__FILE_H_ */ | ||
59 | #endif /* _FILE_H_ */ | ||
60 | |||
61 | #ifdef _DIR_H_ | ||
62 | #ifndef _FILESYSTEM_HOSTED__DIR_H_ | ||
63 | #define _FILESYSTEM_HOSTED__DIR_H_ | ||
64 | |||
65 | #ifndef OSFUNCTIONS_DECLARED | ||
66 | int os_opendir_and_fd(const char *osdirname, OS_DIR_T **osdirpp, | ||
67 | int *osfdp); | ||
68 | |||
69 | #define __MKDIR_MODE_ARG \ | ||
70 | , 0777 | ||
71 | #endif /* OSFUNCTIONS_DECLARED */ | ||
72 | |||
73 | #endif /* _FILESYSTEM_HOSTED__DIR_H_ */ | ||
74 | #endif /* _DIR_H_ */ | ||