mirror of
https://github.com/systemd/systemd.git
synced 2024-10-28 11:55:44 +03:00
udev-ctrl: move prototypes of udev_ctrl_*() to udev-ctrl.h
This commit is contained in:
parent
a2554acec6
commit
7d68eb1bdf
@ -20,6 +20,7 @@ systemd_udevd_sources = files('udevd.c')
|
|||||||
libudev_core_sources = '''
|
libudev_core_sources = '''
|
||||||
udev.h
|
udev.h
|
||||||
udev-ctrl.c
|
udev-ctrl.c
|
||||||
|
udev-ctrl.h
|
||||||
udev-event.c
|
udev-event.c
|
||||||
udev-node.c
|
udev-node.c
|
||||||
udev-node.h
|
udev-node.h
|
||||||
|
@ -21,7 +21,8 @@
|
|||||||
#include "fd-util.h"
|
#include "fd-util.h"
|
||||||
#include "format-util.h"
|
#include "format-util.h"
|
||||||
#include "socket-util.h"
|
#include "socket-util.h"
|
||||||
#include "udev.h"
|
#include "strxcpyx.h"
|
||||||
|
#include "udev-ctrl.h"
|
||||||
|
|
||||||
/* wire protocol magic must match */
|
/* wire protocol magic must match */
|
||||||
#define UDEV_CTRL_MAGIC 0xdead1dea
|
#define UDEV_CTRL_MAGIC 0xdead1dea
|
||||||
|
41
src/udev/udev-ctrl.h
Normal file
41
src/udev/udev-ctrl.h
Normal file
@ -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);
|
@ -77,38 +77,6 @@ void udev_event_execute_rules(struct udev_event *event,
|
|||||||
struct udev_rules *rules);
|
struct udev_rules *rules);
|
||||||
void udev_event_execute_run(struct udev_event *event, usec_t timeout_usec, usec_t timeout_warn_usec);
|
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 */
|
/* built-in commands */
|
||||||
enum udev_builtin_cmd {
|
enum udev_builtin_cmd {
|
||||||
#if HAVE_BLKID
|
#if HAVE_BLKID
|
||||||
@ -169,6 +137,3 @@ int udev_builtin_hwdb_lookup(struct udev_device *dev, const char *prefix, const
|
|||||||
/* Cleanup functions */
|
/* Cleanup functions */
|
||||||
DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_event*, udev_event_unref);
|
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_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);
|
|
||||||
|
@ -19,11 +19,13 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "libudev-private.h"
|
||||||
#include "parse-util.h"
|
#include "parse-util.h"
|
||||||
#include "process-util.h"
|
#include "process-util.h"
|
||||||
#include "time-util.h"
|
#include "time-util.h"
|
||||||
#include "udev.h"
|
|
||||||
#include "udevadm.h"
|
#include "udevadm.h"
|
||||||
|
#include "udev-ctrl.h"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
static int help(void) {
|
static int help(void) {
|
||||||
printf("%s control OPTION\n\n"
|
printf("%s control OPTION\n\n"
|
||||||
|
@ -13,9 +13,11 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "libudev-private.h"
|
||||||
#include "time-util.h"
|
#include "time-util.h"
|
||||||
#include "udevadm.h"
|
#include "udevadm.h"
|
||||||
#include "udev.h"
|
#include "udev-ctrl.h"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
static usec_t arg_timeout = 120 * USEC_PER_SEC;
|
static usec_t arg_timeout = 120 * USEC_PER_SEC;
|
||||||
static const char *arg_exists = NULL;
|
static const char *arg_exists = NULL;
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
#include "socket-util.h"
|
#include "socket-util.h"
|
||||||
#include "string-util.h"
|
#include "string-util.h"
|
||||||
#include "terminal-util.h"
|
#include "terminal-util.h"
|
||||||
|
#include "udev-ctrl.h"
|
||||||
#include "udev-util.h"
|
#include "udev-util.h"
|
||||||
#include "udev-watch.h"
|
#include "udev-watch.h"
|
||||||
#include "udev.h"
|
#include "udev.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user