From: Yu Watanabe Date: Sat, 27 Aug 2022 18:22:02 +0000 (+0900) Subject: sd-device: rename device-util.c -> device-filter.c X-Git-Tag: v252-rc1~308^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a2ded81f73a90fa98a9bf6abb91b2455f79e2ec1;p=thirdparty%2Fsystemd.git sd-device: rename device-util.c -> device-filter.c The functions provided by the file are only used in sd-device. --- diff --git a/src/libsystemd/meson.build b/src/libsystemd/meson.build index 2b288ccb288..7f10e87d6c1 100644 --- a/src/libsystemd/meson.build +++ b/src/libsystemd/meson.build @@ -121,12 +121,13 @@ libsystemd_sources = files( 'sd-bus/sd-bus.c', 'sd-device/device-enumerator-private.h', 'sd-device/device-enumerator.c', + 'sd-device/device-filter.c', + 'sd-device/device-filter.h', 'sd-device/device-internal.h', 'sd-device/device-monitor-private.h', 'sd-device/device-monitor.c', 'sd-device/device-private.c', 'sd-device/device-private.h', - 'sd-device/device-util.c', 'sd-device/device-util.h', 'sd-device/sd-device.c', 'sd-hwdb/hwdb-internal.h', diff --git a/src/libsystemd/sd-device/device-enumerator.c b/src/libsystemd/sd-device/device-enumerator.c index 30f2520b724..ffed6fef9b4 100644 --- a/src/libsystemd/sd-device/device-enumerator.c +++ b/src/libsystemd/sd-device/device-enumerator.c @@ -7,6 +7,7 @@ #include "alloc-util.h" #include "device-enumerator-private.h" +#include "device-filter.h" #include "device-util.h" #include "dirent-util.h" #include "fd-util.h" diff --git a/src/libsystemd/sd-device/device-util.c b/src/libsystemd/sd-device/device-filter.c similarity index 99% rename from src/libsystemd/sd-device/device-util.c rename to src/libsystemd/sd-device/device-filter.c index 3b8689e0d65..4101e7d2baa 100644 --- a/src/libsystemd/sd-device/device-util.c +++ b/src/libsystemd/sd-device/device-filter.c @@ -2,7 +2,7 @@ #include -#include "device-util.h" +#include "device-filter.h" #include "path-util.h" int update_match_strv(Hashmap **match_strv, const char *key, const char *value, bool clear_on_null) { diff --git a/src/libsystemd/sd-device/device-filter.h b/src/libsystemd/sd-device/device-filter.h new file mode 100644 index 00000000000..0c5f34e242d --- /dev/null +++ b/src/libsystemd/sd-device/device-filter.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once + +#include + +#include "sd-device.h" + +#include "hashmap.h" +#include "set.h" + +int update_match_strv(Hashmap **match_strv, const char *key, const char *value, bool clear_on_null); +bool device_match_sysattr(sd_device *device, Hashmap *match_sysattr, Hashmap *nomatch_sysattr); +bool device_match_parent(sd_device *device, Set *match_parent, Set *nomatch_parent); diff --git a/src/libsystemd/sd-device/device-monitor.c b/src/libsystemd/sd-device/device-monitor.c index 566280d66f3..ba997b7f2c3 100644 --- a/src/libsystemd/sd-device/device-monitor.c +++ b/src/libsystemd/sd-device/device-monitor.c @@ -12,6 +12,7 @@ #include "MurmurHash2.h" #include "alloc-util.h" +#include "device-filter.h" #include "device-monitor-private.h" #include "device-private.h" #include "device-util.h" diff --git a/src/libsystemd/sd-device/device-util.h b/src/libsystemd/sd-device/device-util.h index d9e9f1e8c4a..d92cbd6cc74 100644 --- a/src/libsystemd/sd-device/device-util.h +++ b/src/libsystemd/sd-device/device-util.h @@ -5,10 +5,8 @@ #include "sd-device.h" -#include "hashmap.h" #include "log.h" #include "macro.h" -#include "set.h" #define device_unref_and_replace(a, b) \ unref_and_replace_full(a, b, sd_device_ref, sd_device_unref) @@ -81,7 +79,3 @@ #define log_device_notice_errno(device, error, ...) log_device_full_errno(device, LOG_NOTICE, error, __VA_ARGS__) #define log_device_warning_errno(device, error, ...) log_device_full_errno(device, LOG_WARNING, error, __VA_ARGS__) #define log_device_error_errno(device, error, ...) log_device_full_errno(device, LOG_ERR, error, __VA_ARGS__) - -int update_match_strv(Hashmap **match_strv, const char *key, const char *value, bool clear_on_null); -bool device_match_sysattr(sd_device *device, Hashmap *match_sysattr, Hashmap *nomatch_sysattr); -bool device_match_parent(sd_device *device, Set *match_parent, Set *nomatch_parent);