A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita
audio
rust
zig
deno
mpris
rockbox
mpd
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by 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 _FILE_H_
22#define _FILE_H_
23
24#include <sys/types.h>
25#include <stdbool.h>
26#include <fcntl.h>
27#ifdef WIN32
28/* this has SEEK_SET et al */
29#include <stdio.h>
30#endif
31#include "config.h"
32#include "fs_defines.h"
33#include "gcc_extensions.h"
34
35enum relate_result
36{
37 /* < 0 == failure */
38 RELATE_DIFFERENT = 0, /* the two paths are different objects */
39 RELATE_SAME, /* the two paths are the same object */
40 RELATE_PREFIX, /* the path2 contains path1 as a prefix */
41};
42
43#if defined(CTRU) && !defined(SIMULATOR)
44#include "filesystem-ctru.h"
45#elif defined(APPLICATION) || defined(CHECKWPS)
46#include "filesystem-app.h"
47#elif defined(SIMULATOR) || defined(DBTOOL)
48#include "../../uisimulator/common/filesystem-sim.h"
49#else
50#include "filesystem-native.h"
51#endif
52
53#ifndef FILEFUNCTIONS_DECLARED
54int fdprintf(int fildes, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3);
55#endif /* FILEFUNCTIONS_DECLARED */
56
57#ifndef FILEFUNCTIONS_DEFINED
58#ifndef open
59#define open FS_PREFIX(open)
60#endif
61#ifndef creat
62#define creat FS_PREFIX(creat)
63#endif
64#ifndef close
65#define close FS_PREFIX(close)
66#endif
67#ifndef ftruncate
68#define ftruncate FS_PREFIX(ftruncate)
69#endif
70#ifndef fsync
71#define fsync FS_PREFIX(fsync)
72#endif
73#ifndef lseek
74#define lseek FS_PREFIX(lseek)
75#endif
76#ifndef read
77#define read FS_PREFIX(read)
78#endif
79#ifndef write
80#define write FS_PREFIX(write)
81#endif
82#ifndef remove
83#define remove FS_PREFIX(remove)
84#endif
85#ifndef rename
86#define rename FS_PREFIX(rename)
87#endif
88#ifndef modtime
89#define modtime FS_PREFIX(modtime)
90#endif
91#ifndef filesize
92#define filesize FS_PREFIX(filesize)
93#endif
94#ifndef fsamefile
95#define fsamefile FS_PREFIX(fsamefile)
96#endif
97#ifndef file_exists
98#define file_exists FS_PREFIX(file_exists)
99#endif
100#ifndef relate
101#define relate FS_PREFIX(relate)
102#endif
103#ifndef readlink
104#define readlink FS_PREFIX(readlink)
105#endif
106#endif /* FILEFUNCTIONS_DEFINED */
107
108#endif /* _FILE_H_ */