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 *
9 * Copyright © 2013 by Thomas Martitz
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
15 *
16 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 * KIND, either express or implied.
18 *
19 ****************************************************************************/
20
21/* hosted storage driver
22 *
23 * Small functions to support storage_* api on hosted targets
24 * where we don't use raw access to storage devices but run on OS-mounted
25 * file systems */
26
27#ifndef HOSTFS_H
28#define HOSTFS_H
29
30#include <stdbool.h>
31#ifdef __unix__
32#include <unistd.h>
33#endif
34#include "config.h"
35
36extern int hostfs_init(void);
37extern int hostfs_flush(void);
38
39#ifdef HAVE_HOTSWAP
40extern bool hostfs_removable(IF_MD_NONVOID(int drive));
41extern bool hostfs_present(IF_MD_NONVOID(int drive));
42#endif
43
44/* This has to be repeated here for now for sim's sake since HAVE_HOSTFS
45 eats all the other stuff in storage.h. The sim probably shouldn't use
46 this. */
47#ifdef CONFIG_STORAGE_MULTI
48extern int hostfs_driver_type(int drive);
49#else
50# ifdef APPLICATION
51# define hostfs_driver_type(drive) (STORAGE_HOSTFS_NUM)
52# else /* !APPLICATION */
53# if (CONFIG_STORAGE & STORAGE_ATA)
54# define hostfs_driver_type(drive) (STORAGE_ATA_NUM)
55# elif (CONFIG_STORAGE & STORAGE_SD)
56# define hostfs_driver_type(drive) (STORAGE_SD_NUM)
57# elif (CONFIG_STORAGE & STORAGE_USB)
58# define hostfs_driver_type(drive) (STORAGE_USB_NUM)
59# elif (CONFIG_STORAGE & STORAGE_MMC)
60# define hostfs_driver_type(drive) (STORAGE_MMC_NUM)
61# elif (CONFIG_STORAGE & STORAGE_NAND)
62# define hostfs_driver_type(drive) (STORAGE_NAND_NUM)
63# elif (CONFIG_STORAGE & STORAGE_RAMDISK)
64# define hostfs_driver_type(drive) (STORAGE_RAMDISK_NUM)
65/* we may have hostfs without application when building sims for applications! */
66# elif (CONFIG_STORAGE & STORAGE_HOSTFS)
67# define hostfs_driver_type(drive) (STORAGE_HOSTFS_NUM)
68# else
69# error Unknown storage driver
70# endif /* CONFIG_STORAGE */
71# endif /* APPLICATION */
72#endif /* CONFIG_STORAGE_MULTI */
73
74#endif /* HOSTFS_H */