]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev-ctrl: move prototypes of udev_ctrl_*() to udev-ctrl.h
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 29 Aug 2018 07:03:45 +0000 (16:03 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 10 Oct 2018 19:21:14 +0000 (04:21 +0900)
src/udev/meson.build
src/udev/udev-ctrl.c
src/udev/udev-ctrl.h [new file with mode: 0644]
src/udev/udev.h
src/udev/udevadm-control.c
src/udev/udevadm-settle.c
src/udev/udevd.c

index 0b02d838ca1e2b661fa43981e9ded5823e98b50a..726bae585ebfdabfa572d810e2274e360c0c8bc7 100644 (file)
@@ -20,6 +20,7 @@ systemd_udevd_sources = files('udevd.c')
 libudev_core_sources = '''
         udev.h
         udev-ctrl.c
+        udev-ctrl.h
         udev-event.c
         udev-node.c
         udev-node.h
index a9b19051bfd8b7cea88f7a7b016c9387f6bdff74..64024100fe89e1defa1135cadd815d0fa6760872 100644 (file)
@@ -21,7 +21,8 @@
 #include "fd-util.h"
 #include "format-util.h"
 #include "socket-util.h"
-#include "udev.h"
+#include "strxcpyx.h"
+#include "udev-ctrl.h"
 
 /* wire protocol magic must match */
 #define UDEV_CTRL_MAGIC                                0xdead1dea
diff --git a/src/udev/udev-ctrl.h b/src/udev/udev-ctrl.h
new file mode 100644 (file)
index 0000000..87021cb
--- /dev/null
@@ -0,0 +1,41 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+#pragma once
+
+#include "macro.h"
+
+struct udev_ctrl;
+struct udev_ctrl *udev_ctrl_new(void);
+struct udev_ctrl *udev_ctrl_new_from_fd(int fd);
+int udev_ctrl_enable_receiving(struct udev_ctrl *uctrl);
+struct udev_ctrl *udev_ctrl_unref(struct udev_ctrl *uctrl);
+int udev_ctrl_cleanup(struct udev_ctrl *uctrl);
+int udev_ctrl_get_fd(struct udev_ctrl *uctrl);
+int udev_ctrl_send_set_log_level(struct udev_ctrl *uctrl, int priority, int timeout);
+int udev_ctrl_send_stop_exec_queue(struct udev_ctrl *uctrl, int timeout);
+int udev_ctrl_send_start_exec_queue(struct udev_ctrl *uctrl, int timeout);
+int udev_ctrl_send_reload(struct udev_ctrl *uctrl, int timeout);
+int udev_ctrl_send_ping(struct udev_ctrl *uctrl, int timeout);
+int udev_ctrl_send_exit(struct udev_ctrl *uctrl, int timeout);
+int udev_ctrl_send_set_env(struct udev_ctrl *uctrl, const char *key, int timeout);
+int udev_ctrl_send_set_children_max(struct udev_ctrl *uctrl, int count, int timeout);
+
+struct udev_ctrl_connection;
+struct udev_ctrl_connection *udev_ctrl_get_connection(struct udev_ctrl *uctrl);
+struct udev_ctrl_connection *udev_ctrl_connection_ref(struct udev_ctrl_connection *conn);
+struct udev_ctrl_connection *udev_ctrl_connection_unref(struct udev_ctrl_connection *conn);
+
+struct udev_ctrl_msg;
+struct udev_ctrl_msg *udev_ctrl_receive_msg(struct udev_ctrl_connection *conn);
+struct udev_ctrl_msg *udev_ctrl_msg_unref(struct udev_ctrl_msg *ctrl_msg);
+int udev_ctrl_get_set_log_level(struct udev_ctrl_msg *ctrl_msg);
+int udev_ctrl_get_stop_exec_queue(struct udev_ctrl_msg *ctrl_msg);
+int udev_ctrl_get_start_exec_queue(struct udev_ctrl_msg *ctrl_msg);
+int udev_ctrl_get_reload(struct udev_ctrl_msg *ctrl_msg);
+int udev_ctrl_get_ping(struct udev_ctrl_msg *ctrl_msg);
+int udev_ctrl_get_exit(struct udev_ctrl_msg *ctrl_msg);
+const char *udev_ctrl_get_set_env(struct udev_ctrl_msg *ctrl_msg);
+int udev_ctrl_get_set_children_max(struct udev_ctrl_msg *ctrl_msg);
+
+DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_ctrl*, udev_ctrl_unref);
+DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_ctrl_connection*, udev_ctrl_connection_unref);
+DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_ctrl_msg*, udev_ctrl_msg_unref);
index 2ba407d7a56460538067d60ff3c260b606f448ac..ac71a2c163d863326a3fa9e83f3da062a1214454 100644 (file)
@@ -77,38 +77,6 @@ void udev_event_execute_rules(struct udev_event *event,
                               struct udev_rules *rules);
 void udev_event_execute_run(struct udev_event *event, usec_t timeout_usec, usec_t timeout_warn_usec);
 
-/* udev-ctrl.c */
-struct udev_ctrl;
-struct udev_ctrl *udev_ctrl_new(void);
-struct udev_ctrl *udev_ctrl_new_from_fd(int fd);
-int udev_ctrl_enable_receiving(struct udev_ctrl *uctrl);
-struct udev_ctrl *udev_ctrl_unref(struct udev_ctrl *uctrl);
-int udev_ctrl_cleanup(struct udev_ctrl *uctrl);
-int udev_ctrl_get_fd(struct udev_ctrl *uctrl);
-int udev_ctrl_send_set_log_level(struct udev_ctrl *uctrl, int priority, int timeout);
-int udev_ctrl_send_stop_exec_queue(struct udev_ctrl *uctrl, int timeout);
-int udev_ctrl_send_start_exec_queue(struct udev_ctrl *uctrl, int timeout);
-int udev_ctrl_send_reload(struct udev_ctrl *uctrl, int timeout);
-int udev_ctrl_send_ping(struct udev_ctrl *uctrl, int timeout);
-int udev_ctrl_send_exit(struct udev_ctrl *uctrl, int timeout);
-int udev_ctrl_send_set_env(struct udev_ctrl *uctrl, const char *key, int timeout);
-int udev_ctrl_send_set_children_max(struct udev_ctrl *uctrl, int count, int timeout);
-struct udev_ctrl_connection;
-struct udev_ctrl_connection *udev_ctrl_get_connection(struct udev_ctrl *uctrl);
-struct udev_ctrl_connection *udev_ctrl_connection_ref(struct udev_ctrl_connection *conn);
-struct udev_ctrl_connection *udev_ctrl_connection_unref(struct udev_ctrl_connection *conn);
-struct udev_ctrl_msg;
-struct udev_ctrl_msg *udev_ctrl_receive_msg(struct udev_ctrl_connection *conn);
-struct udev_ctrl_msg *udev_ctrl_msg_unref(struct udev_ctrl_msg *ctrl_msg);
-int udev_ctrl_get_set_log_level(struct udev_ctrl_msg *ctrl_msg);
-int udev_ctrl_get_stop_exec_queue(struct udev_ctrl_msg *ctrl_msg);
-int udev_ctrl_get_start_exec_queue(struct udev_ctrl_msg *ctrl_msg);
-int udev_ctrl_get_reload(struct udev_ctrl_msg *ctrl_msg);
-int udev_ctrl_get_ping(struct udev_ctrl_msg *ctrl_msg);
-int udev_ctrl_get_exit(struct udev_ctrl_msg *ctrl_msg);
-const char *udev_ctrl_get_set_env(struct udev_ctrl_msg *ctrl_msg);
-int udev_ctrl_get_set_children_max(struct udev_ctrl_msg *ctrl_msg);
-
 /* built-in commands */
 enum udev_builtin_cmd {
 #if HAVE_BLKID
@@ -169,6 +137,3 @@ int udev_builtin_hwdb_lookup(struct udev_device *dev, const char *prefix, const
 /* Cleanup functions */
 DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_event*, udev_event_unref);
 DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_rules*, udev_rules_unref);
-DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_ctrl*, udev_ctrl_unref);
-DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_ctrl_connection*, udev_ctrl_connection_unref);
-DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_ctrl_msg*, udev_ctrl_msg_unref);
index 3125a18088ef06e0482a93a19e48e2c243a2eead..22ac4962eddc4f3d6d51b91a9c63e25a18e3c73d 100644 (file)
 #include <string.h>
 #include <unistd.h>
 
+#include "libudev-private.h"
 #include "parse-util.h"
 #include "process-util.h"
 #include "time-util.h"
-#include "udev.h"
 #include "udevadm.h"
+#include "udev-ctrl.h"
+#include "util.h"
 
 static int help(void) {
         printf("%s control OPTION\n\n"
index 7e02275ba4e5fe9a49156bccef8d4ed02b25afd4..6960324516bbb2d8d380c3b933ef5dc7b532fc8c 100644 (file)
 #include <string.h>
 #include <unistd.h>
 
+#include "libudev-private.h"
 #include "time-util.h"
 #include "udevadm.h"
-#include "udev.h"
+#include "udev-ctrl.h"
+#include "util.h"
 
 static usec_t arg_timeout = 120 * USEC_PER_SEC;
 static const char *arg_exists = NULL;
index 3259d45c10d0c988a5233a488415173b6671f152..8f8a2fcaa86cf46f00906bb3373a0a79b6c2f5e4 100644 (file)
@@ -52,6 +52,7 @@
 #include "socket-util.h"
 #include "string-util.h"
 #include "terminal-util.h"
+#include "udev-ctrl.h"
 #include "udev-util.h"
 #include "udev-watch.h"
 #include "udev.h"