From: Yu Watanabe Date: Thu, 7 Mar 2019 05:42:36 +0000 (+0900) Subject: sd-device: move device_action_from_string() and friends to device-private.h X-Git-Tag: v242-rc1~183^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=08caaee0ac6b1c7c2d89a699b44307cbb7440c10;p=thirdparty%2Fsystemd.git sd-device: move device_action_from_string() and friends to device-private.h --- diff --git a/src/libsystemd/sd-device/device-internal.h b/src/libsystemd/sd-device/device-internal.h index 3ffca35cbef..4d03d09cd68 100644 --- a/src/libsystemd/sd-device/device-internal.h +++ b/src/libsystemd/sd-device/device-internal.h @@ -81,19 +81,6 @@ struct sd_device { bool db_persist:1; /* don't clean up the db when switching from initrd to real root */ }; -typedef enum DeviceAction { - DEVICE_ACTION_ADD, - DEVICE_ACTION_REMOVE, - DEVICE_ACTION_CHANGE, - DEVICE_ACTION_MOVE, - DEVICE_ACTION_ONLINE, - DEVICE_ACTION_OFFLINE, - DEVICE_ACTION_BIND, - DEVICE_ACTION_UNBIND, - _DEVICE_ACTION_MAX, - _DEVICE_ACTION_INVALID = -1, -} DeviceAction; - int device_new_aux(sd_device **ret); int device_add_property_aux(sd_device *device, const char *key, const char *value, bool db); int device_add_property_internal(sd_device *device, const char *key, const char *value); @@ -108,6 +95,3 @@ int device_set_devnum(sd_device *device, const char *major, const char *minor); int device_set_subsystem(sd_device *device, const char *_subsystem); int device_set_driver(sd_device *device, const char *_driver); int device_set_usec_initialized(sd_device *device, usec_t when); - -DeviceAction device_action_from_string(const char *s) _pure_; -const char *device_action_to_string(DeviceAction a) _const_; diff --git a/src/libsystemd/sd-device/device-private.h b/src/libsystemd/sd-device/device-private.h index 49e02db81ed..46e10105c98 100644 --- a/src/libsystemd/sd-device/device-private.h +++ b/src/libsystemd/sd-device/device-private.h @@ -8,6 +8,8 @@ #include "sd-device.h" +#include "macro.h" + int device_new_from_nulstr(sd_device **ret, uint8_t *nulstr, size_t len); int device_new_from_strv(sd_device **ret, char **strv); int device_new_from_stat_rdev(sd_device **ret, const struct stat *st); @@ -55,3 +57,19 @@ int device_read_db_internal(sd_device *device, bool force); static inline int device_read_db(sd_device *device) { return device_read_db_internal(device, false); } + +typedef enum DeviceAction { + DEVICE_ACTION_ADD, + DEVICE_ACTION_REMOVE, + DEVICE_ACTION_CHANGE, + DEVICE_ACTION_MOVE, + DEVICE_ACTION_ONLINE, + DEVICE_ACTION_OFFLINE, + DEVICE_ACTION_BIND, + DEVICE_ACTION_UNBIND, + _DEVICE_ACTION_MAX, + _DEVICE_ACTION_INVALID = -1, +} DeviceAction; + +DeviceAction device_action_from_string(const char *s) _pure_; +const char *device_action_to_string(DeviceAction a) _const_; diff --git a/src/test/test-tables.c b/src/test/test-tables.c index 49268eae227..070d1b4fe09 100644 --- a/src/test/test-tables.c +++ b/src/test/test-tables.c @@ -5,7 +5,7 @@ #include "cgroup.h" #include "compress.h" #include "condition.h" -#include "device-internal.h" +#include "device-private.h" #include "device.h" #include "execute.h" #include "import-util.h"