fs/{StandardDirectory,CheckFile}: move to fs/glue/

Distangle library dependencies.
This commit is contained in:
Max Kellermann 2023-03-06 19:36:34 +01:00
parent c937a299f7
commit b5d224ce22
16 changed files with 39 additions and 26 deletions

View File

@ -425,6 +425,7 @@ subdir('src/lib/crypto')
subdir('src/zeroconf') subdir('src/zeroconf')
subdir('src/fs') subdir('src/fs')
subdir('src/fs/glue')
subdir('src/config') subdir('src/config')
subdir('src/tag') subdir('src/tag')
subdir('src/neighbor') subdir('src/neighbor')

View File

@ -20,7 +20,7 @@
#include "fs/NarrowPath.hxx" #include "fs/NarrowPath.hxx"
#include "fs/Traits.hxx" #include "fs/Traits.hxx"
#include "fs/FileSystem.hxx" #include "fs/FileSystem.hxx"
#include "fs/StandardDirectory.hxx" #include "fs/glue/StandardDirectory.hxx"
#include "event/Features.h" #include "event/Features.h"
#include "io/uring/Features.h" #include "io/uring/Features.h"
#include "cmdline/OptionDef.hxx" #include "cmdline/OptionDef.hxx"

View File

@ -17,7 +17,7 @@
#include "net/SocketUtil.hxx" #include "net/SocketUtil.hxx"
#include "system/Error.hxx" #include "system/Error.hxx"
#include "fs/AllocatedPath.hxx" #include "fs/AllocatedPath.hxx"
#include "fs/StandardDirectory.hxx" #include "fs/glue/StandardDirectory.hxx"
#include "fs/XDG.hxx" #include "fs/XDG.hxx"
#include "util/Domain.hxx" #include "util/Domain.hxx"

View File

@ -8,7 +8,7 @@
#include "config.h" #include "config.h"
#include "Mapper.hxx" #include "Mapper.hxx"
#include "fs/AllocatedPath.hxx" #include "fs/AllocatedPath.hxx"
#include "fs/CheckFile.hxx" #include "fs/glue/CheckFile.hxx"
#include "util/StringCompare.hxx" #include "util/StringCompare.hxx"
#ifdef ENABLE_DATABASE #ifdef ENABLE_DATABASE

View File

@ -5,7 +5,7 @@
#include "Data.hxx" #include "Data.hxx"
#include "fs/AllocatedPath.hxx" #include "fs/AllocatedPath.hxx"
#include "fs/Traits.hxx" #include "fs/Traits.hxx"
#include "fs/StandardDirectory.hxx" #include "fs/glue/StandardDirectory.hxx"
#include "lib/fmt/RuntimeError.hxx" #include "lib/fmt/RuntimeError.hxx"
#include "util/StringSplit.hxx" #include "util/StringSplit.hxx"

View File

@ -15,12 +15,13 @@ config = static_library(
dependencies: [ dependencies: [
log_dep, log_dep,
fmt_dep, fmt_dep,
fs_dep,
fs_glue_dep,
], ],
) )
config_dep = declare_dependency( config_dep = declare_dependency(
link_with: config, link_with: config,
dependencies: [ dependencies: [
fs_dep,
], ],
) )

View File

@ -9,7 +9,7 @@
#include "config/Block.hxx" #include "config/Block.hxx"
#include "fs/AllocatedPath.hxx" #include "fs/AllocatedPath.hxx"
#include "fs/FileSystem.hxx" #include "fs/FileSystem.hxx"
#include "fs/StandardDirectory.hxx" #include "fs/glue/StandardDirectory.hxx"
#include "lib/fmt/RuntimeError.hxx" #include "lib/fmt/RuntimeError.hxx"
DatabasePtr DatabasePtr

View File

@ -55,6 +55,7 @@ db_glue = static_library(
dependencies: [ dependencies: [
fmt_dep, fmt_dep,
log_dep, log_dep,
fs_glue_dep,
], ],
) )

View File

@ -5,10 +5,10 @@
#include "Log.hxx" #include "Log.hxx"
#include "lib/fmt/PathFormatter.hxx" #include "lib/fmt/PathFormatter.hxx"
#include "config/Domain.hxx" #include "config/Domain.hxx"
#include "FileInfo.hxx" #include "fs/FileInfo.hxx"
#include "Path.hxx" #include "fs/Path.hxx"
#include "AllocatedPath.hxx" #include "fs/AllocatedPath.hxx"
#include "DirectoryReader.hxx" #include "fs/DirectoryReader.hxx"
#include "system/Error.hxx" #include "system/Error.hxx"
void void

View File

@ -1,8 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
// Copyright The Music Player Daemon Project // Copyright The Music Player Daemon Project
#ifndef MPD_FS_CHECK_FILE_HXX #pragma once
#define MPD_FS_CHECK_FILE_HXX
class Path; class Path;
@ -12,5 +11,3 @@ class Path;
*/ */
void void
CheckDirectoryReadable(Path path_fs); CheckDirectoryReadable(Path path_fs);
#endif

View File

@ -6,8 +6,9 @@
#endif #endif
#include "StandardDirectory.hxx" #include "StandardDirectory.hxx"
#include "FileSystem.hxx" #include "fs/AllocatedPath.hxx"
#include "XDG.hxx" #include "fs/FileSystem.hxx"
#include "fs/XDG.hxx"
#include "config.h" #include "config.h"
#include "util/StringSplit.hxx" #include "util/StringSplit.hxx"

View File

@ -1,10 +1,9 @@
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
// Copyright The Music Player Daemon Project // Copyright The Music Player Daemon Project
#ifndef MPD_FS_STANDARD_DIRECTORY_HXX #pragma once
#define MPD_FS_STANDARD_DIRECTORY_HXX
#include "AllocatedPath.hxx" class AllocatedPath;
/** /**
* Obtains configuration directory for the current user. * Obtains configuration directory for the current user.
@ -83,5 +82,3 @@ AllocatedPath
GetHomeDir(const char *user_name) noexcept; GetHomeDir(const char *user_name) noexcept;
#endif #endif
#endif

16
src/fs/glue/meson.build Normal file
View File

@ -0,0 +1,16 @@
fs_glue = static_library(
'fs_glue',
'StandardDirectory.cxx',
'CheckFile.cxx',
include_directories: inc,
dependencies: [
fs_dep,
fmt_dep,
log_dep,
util_dep,
],
)
fs_glue_dep = declare_dependency(
link_with: fs_glue,
)

View File

@ -10,8 +10,6 @@ fs_sources = [
'NarrowPath.cxx', 'NarrowPath.cxx',
'FileSystem.cxx', 'FileSystem.cxx',
'List.cxx', 'List.cxx',
'StandardDirectory.cxx',
'CheckFile.cxx',
'LookupFile.cxx', 'LookupFile.cxx',
'DirectoryReader.cxx', 'DirectoryReader.cxx',
'io/TextFile.cxx', 'io/TextFile.cxx',
@ -29,7 +27,6 @@ fs = static_library(
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
zlib_dep, zlib_dep,
log_dep,
], ],
) )

View File

@ -6,8 +6,9 @@
#include "StorageInterface.hxx" #include "StorageInterface.hxx"
#include "plugins/LocalStorage.hxx" #include "plugins/LocalStorage.hxx"
#include "config/Data.hxx" #include "config/Data.hxx"
#include "fs/StandardDirectory.hxx" #include "fs/AllocatedPath.hxx"
#include "fs/CheckFile.hxx" #include "fs/glue/StandardDirectory.hxx"
#include "fs/glue/CheckFile.hxx"
#include "lib/fmt/RuntimeError.hxx" #include "lib/fmt/RuntimeError.hxx"
#include "util/UriExtract.hxx" #include "util/UriExtract.hxx"

View File

@ -20,6 +20,7 @@ storage_glue = static_library(
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
log_dep, log_dep,
fs_glue_dep,
], ],
) )