From 9815d101372ffd7386f076c1fffa6a39b15d7e51 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 5 May 2020 14:11:13 +0200 Subject: [PATCH] system/FileDescriptor: move to io/ --- meson.build | 1 + src/db/update/InotifySource.cxx | 2 +- src/fs/FileSystem.hxx | 2 +- src/fs/io/FileOutputStream.hxx | 2 +- src/fs/io/FileReader.cxx | 2 +- src/fs/io/FileReader.hxx | 2 +- src/fs/meson.build | 1 + src/input/plugins/FileInputPlugin.cxx | 2 +- src/{system => io}/FileDescriptor.cxx | 0 src/{system => io}/FileDescriptor.hxx | 0 src/{system => io}/Open.cxx | 2 +- src/{system => io}/Open.hxx | 0 src/{system => io}/UniqueFileDescriptor.hxx | 0 src/io/meson.build | 10 ++++++++++ src/mixer/plugins/OssMixerPlugin.cxx | 2 +- src/net/SocketDescriptor.hxx | 2 +- src/output/plugins/OssOutputPlugin.cxx | 2 +- src/output/plugins/SolarisOutputPlugin.cxx | 2 +- src/system/EpollFD.hxx | 4 ++-- src/system/EventFD.hxx | 2 +- src/system/EventPipe.cxx | 2 +- src/system/SignalFD.hxx | 2 +- src/system/meson.build | 3 +-- test/run_filter.cxx | 2 +- 24 files changed, 30 insertions(+), 19 deletions(-) rename src/{system => io}/FileDescriptor.cxx (100%) rename src/{system => io}/FileDescriptor.hxx (100%) rename src/{system => io}/Open.cxx (99%) rename src/{system => io}/Open.hxx (100%) rename src/{system => io}/UniqueFileDescriptor.hxx (100%) create mode 100644 src/io/meson.build diff --git a/meson.build b/meson.build index 1aef557f9..f5d7888e6 100644 --- a/meson.build +++ b/meson.build @@ -331,6 +331,7 @@ endif subdir('src/util') subdir('src/time') +subdir('src/io') subdir('src/system') subdir('src/thread') subdir('src/net') diff --git a/src/db/update/InotifySource.cxx b/src/db/update/InotifySource.cxx index e6508f463..fb35adeb5 100644 --- a/src/db/update/InotifySource.cxx +++ b/src/db/update/InotifySource.cxx @@ -19,7 +19,7 @@ #include "InotifySource.hxx" #include "InotifyDomain.hxx" -#include "system/FileDescriptor.hxx" +#include "io/FileDescriptor.hxx" #include "system/FatalError.hxx" #include "system/Error.hxx" #include "Log.hxx" diff --git a/src/fs/FileSystem.hxx b/src/fs/FileSystem.hxx index de74a7a15..04c9ecb60 100644 --- a/src/fs/FileSystem.hxx +++ b/src/fs/FileSystem.hxx @@ -21,7 +21,7 @@ #define MPD_FS_FILESYSTEM_HXX #include "Path.hxx" -#include "system/UniqueFileDescriptor.hxx" +#include "io/UniqueFileDescriptor.hxx" #ifdef _WIN32 #include diff --git a/src/fs/io/FileOutputStream.hxx b/src/fs/io/FileOutputStream.hxx index 503c6e508..d377f08ea 100644 --- a/src/fs/io/FileOutputStream.hxx +++ b/src/fs/io/FileOutputStream.hxx @@ -35,7 +35,7 @@ #include "util/Compiler.h" #ifndef _WIN32 -#include "system/FileDescriptor.hxx" +#include "io/FileDescriptor.hxx" #endif #include diff --git a/src/fs/io/FileReader.cxx b/src/fs/io/FileReader.cxx index 39bfcda95..ac474bfb7 100644 --- a/src/fs/io/FileReader.cxx +++ b/src/fs/io/FileReader.cxx @@ -30,7 +30,7 @@ #include "FileReader.hxx" #include "fs/FileInfo.hxx" #include "system/Error.hxx" -#include "system/Open.hxx" +#include "io/Open.hxx" #include diff --git a/src/fs/io/FileReader.hxx b/src/fs/io/FileReader.hxx index 579519e70..bee39cc9a 100644 --- a/src/fs/io/FileReader.hxx +++ b/src/fs/io/FileReader.hxx @@ -37,7 +37,7 @@ #ifdef _WIN32 #include #else -#include "system/UniqueFileDescriptor.hxx" +#include "io/UniqueFileDescriptor.hxx" #endif class Path; diff --git a/src/fs/meson.build b/src/fs/meson.build index 980ca6138..483df7694 100644 --- a/src/fs/meson.build +++ b/src/fs/meson.build @@ -48,6 +48,7 @@ fs = static_library( fs_dep = declare_dependency( link_with: fs, dependencies: [ + io_dep, system_dep, icu_dep, shlwapi_dep, diff --git a/src/input/plugins/FileInputPlugin.cxx b/src/input/plugins/FileInputPlugin.cxx index dfaea790f..b2991c5b8 100644 --- a/src/input/plugins/FileInputPlugin.cxx +++ b/src/input/plugins/FileInputPlugin.cxx @@ -22,7 +22,7 @@ #include "fs/Path.hxx" #include "fs/FileInfo.hxx" #include "fs/io/FileReader.hxx" -#include "system/FileDescriptor.hxx" +#include "io/FileDescriptor.hxx" #include "util/RuntimeError.hxx" #include diff --git a/src/system/FileDescriptor.cxx b/src/io/FileDescriptor.cxx similarity index 100% rename from src/system/FileDescriptor.cxx rename to src/io/FileDescriptor.cxx diff --git a/src/system/FileDescriptor.hxx b/src/io/FileDescriptor.hxx similarity index 100% rename from src/system/FileDescriptor.hxx rename to src/io/FileDescriptor.hxx diff --git a/src/system/Open.cxx b/src/io/Open.cxx similarity index 99% rename from src/system/Open.cxx rename to src/io/Open.cxx index e7bea24a2..1d5bb11f9 100644 --- a/src/system/Open.cxx +++ b/src/io/Open.cxx @@ -28,8 +28,8 @@ */ #include "Open.hxx" -#include "Error.hxx" #include "UniqueFileDescriptor.hxx" +#include "system/Error.hxx" #include diff --git a/src/system/Open.hxx b/src/io/Open.hxx similarity index 100% rename from src/system/Open.hxx rename to src/io/Open.hxx diff --git a/src/system/UniqueFileDescriptor.hxx b/src/io/UniqueFileDescriptor.hxx similarity index 100% rename from src/system/UniqueFileDescriptor.hxx rename to src/io/UniqueFileDescriptor.hxx diff --git a/src/io/meson.build b/src/io/meson.build new file mode 100644 index 000000000..22456d654 --- /dev/null +++ b/src/io/meson.build @@ -0,0 +1,10 @@ +io = static_library( + 'io', + 'FileDescriptor.cxx', + 'Open.cxx', + include_directories: inc, +) + +io_dep = declare_dependency( + link_with: io, +) diff --git a/src/mixer/plugins/OssMixerPlugin.cxx b/src/mixer/plugins/OssMixerPlugin.cxx index 92896dbef..3446d732c 100644 --- a/src/mixer/plugins/OssMixerPlugin.cxx +++ b/src/mixer/plugins/OssMixerPlugin.cxx @@ -19,7 +19,7 @@ #include "mixer/MixerInternal.hxx" #include "config/Block.hxx" -#include "system/FileDescriptor.hxx" +#include "io/FileDescriptor.hxx" #include "system/Error.hxx" #include "util/ASCII.hxx" #include "util/Domain.hxx" diff --git a/src/net/SocketDescriptor.hxx b/src/net/SocketDescriptor.hxx index d19106366..647c9bdd3 100644 --- a/src/net/SocketDescriptor.hxx +++ b/src/net/SocketDescriptor.hxx @@ -31,7 +31,7 @@ #define SOCKET_DESCRIPTOR_HXX #include "Features.hxx" -#include "system/FileDescriptor.hxx" +#include "io/FileDescriptor.hxx" #include diff --git a/src/output/plugins/OssOutputPlugin.cxx b/src/output/plugins/OssOutputPlugin.cxx index a2bb078d5..5e4fd690b 100644 --- a/src/output/plugins/OssOutputPlugin.cxx +++ b/src/output/plugins/OssOutputPlugin.cxx @@ -20,7 +20,7 @@ #include "OssOutputPlugin.hxx" #include "../OutputAPI.hxx" #include "mixer/MixerList.hxx" -#include "system/UniqueFileDescriptor.hxx" +#include "io/UniqueFileDescriptor.hxx" #include "system/Error.hxx" #include "util/ConstBuffer.hxx" #include "util/Domain.hxx" diff --git a/src/output/plugins/SolarisOutputPlugin.cxx b/src/output/plugins/SolarisOutputPlugin.cxx index 3f0390e87..6d210deff 100644 --- a/src/output/plugins/SolarisOutputPlugin.cxx +++ b/src/output/plugins/SolarisOutputPlugin.cxx @@ -19,7 +19,7 @@ #include "SolarisOutputPlugin.hxx" #include "../OutputAPI.hxx" -#include "system/FileDescriptor.hxx" +#include "io/FileDescriptor.hxx" #include "system/Error.hxx" #include diff --git a/src/system/EpollFD.hxx b/src/system/EpollFD.hxx index 4161b54f5..6349bd254 100644 --- a/src/system/EpollFD.hxx +++ b/src/system/EpollFD.hxx @@ -1,5 +1,5 @@ /* - * Copyright 2013-2019 Max Kellermann + * Copyright 2013-2020 Max Kellermann * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ #ifndef EPOLL_FD_HXX #define EPOLL_FD_HXX -#include "UniqueFileDescriptor.hxx" +#include "io/UniqueFileDescriptor.hxx" #include diff --git a/src/system/EventFD.hxx b/src/system/EventFD.hxx index 79d1af0c7..337947472 100644 --- a/src/system/EventFD.hxx +++ b/src/system/EventFD.hxx @@ -30,7 +30,7 @@ #ifndef EVENT_FD_HXX #define EVENT_FD_HXX -#include "UniqueFileDescriptor.hxx" +#include "io/UniqueFileDescriptor.hxx" /** * A class that wraps eventfd(). diff --git a/src/system/EventPipe.cxx b/src/system/EventPipe.cxx index 462cc4a1c..d388451a2 100644 --- a/src/system/EventPipe.cxx +++ b/src/system/EventPipe.cxx @@ -18,7 +18,7 @@ */ #include "EventPipe.hxx" -#include "FileDescriptor.hxx" +#include "io/FileDescriptor.hxx" #include "system/Error.hxx" #include "util/Compiler.h" diff --git a/src/system/SignalFD.hxx b/src/system/SignalFD.hxx index 6d45d060f..90d628aea 100644 --- a/src/system/SignalFD.hxx +++ b/src/system/SignalFD.hxx @@ -30,7 +30,7 @@ #ifndef SIGNAL_FD_HXX #define SIGNAL_FD_HXX -#include "UniqueFileDescriptor.hxx" +#include "io/UniqueFileDescriptor.hxx" #include diff --git a/src/system/meson.build b/src/system/meson.build index 4babb4274..509783463 100644 --- a/src/system/meson.build +++ b/src/system/meson.build @@ -1,7 +1,5 @@ system_sources = [ 'FatalError.cxx', - 'FileDescriptor.cxx', - 'Open.cxx', 'EventPipe.cxx', 'Clock.cxx', ] @@ -29,6 +27,7 @@ endif system_dep = declare_dependency( link_with: system, dependencies: [ + io_dep, winsock_dep, ], ) diff --git a/test/run_filter.cxx b/test/run_filter.cxx index 44b54b88c..0ebedde72 100644 --- a/test/run_filter.cxx +++ b/test/run_filter.cxx @@ -28,7 +28,7 @@ #include "pcm/Volume.hxx" #include "mixer/MixerControl.hxx" #include "system/Error.hxx" -#include "system/FileDescriptor.hxx" +#include "io/FileDescriptor.hxx" #include "util/ConstBuffer.hxx" #include "util/StringBuffer.hxx" #include "util/RuntimeError.hxx"