sd-device: move device_action_from_string() and friends to device-private.h
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 7 Mar 2019 05:42:36 +0000 (14:42 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 7 Mar 2019 06:18:49 +0000 (15:18 +0900)
src/libsystemd/sd-device/device-internal.h
src/libsystemd/sd-device/device-private.h
src/test/test-tables.c

index 3ffca35..4d03d09 100644 (file)
@@ -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_;
index 49e02db..46e1010 100644 (file)
@@ -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_;
index 49268ea..070d1b4 100644 (file)
@@ -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"