mirror of
https://github.com/systemd/systemd.git
synced 2025-03-09 12:58:26 +03:00
udev: move enums to udev-def.h
No functional change, just refactoring and preparation for later commits.
This commit is contained in:
parent
a2840b9599
commit
0bdcca5aee
@ -25,6 +25,7 @@
|
||||
#include "string-util.h"
|
||||
#include "tests.h"
|
||||
#include "udev-event.h"
|
||||
#include "udev-rules.h"
|
||||
#include "udev-spawn.h"
|
||||
#include "version.h"
|
||||
|
||||
|
@ -7,31 +7,9 @@
|
||||
#include "sd-netlink.h"
|
||||
|
||||
#include "macro.h"
|
||||
#include "udev-def.h"
|
||||
#include "udev-event.h"
|
||||
|
||||
typedef enum UdevBuiltinCommand {
|
||||
#if HAVE_BLKID
|
||||
UDEV_BUILTIN_BLKID,
|
||||
#endif
|
||||
UDEV_BUILTIN_BTRFS,
|
||||
UDEV_BUILTIN_HWDB,
|
||||
UDEV_BUILTIN_INPUT_ID,
|
||||
UDEV_BUILTIN_KEYBOARD,
|
||||
#if HAVE_KMOD
|
||||
UDEV_BUILTIN_KMOD,
|
||||
#endif
|
||||
UDEV_BUILTIN_NET_DRIVER,
|
||||
UDEV_BUILTIN_NET_ID,
|
||||
UDEV_BUILTIN_NET_LINK,
|
||||
UDEV_BUILTIN_PATH_ID,
|
||||
UDEV_BUILTIN_USB_ID,
|
||||
#if HAVE_ACL
|
||||
UDEV_BUILTIN_UACCESS,
|
||||
#endif
|
||||
_UDEV_BUILTIN_MAX,
|
||||
_UDEV_BUILTIN_INVALID = -EINVAL,
|
||||
} UdevBuiltinCommand;
|
||||
|
||||
typedef struct UdevBuiltin {
|
||||
const char *name;
|
||||
int (*cmd)(UdevEvent *event, int argc, char *argv[]);
|
||||
|
57
src/udev/udev-def.h
Normal file
57
src/udev/udev-def.h
Normal file
@ -0,0 +1,57 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
#pragma once
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#define UDEV_NAME_SIZE 512
|
||||
#define UDEV_PATH_SIZE 1024
|
||||
#define UDEV_LINE_SIZE 16384
|
||||
|
||||
typedef enum EventMode {
|
||||
EVENT_UDEV_WORKER,
|
||||
EVENT_UDEVADM_TEST,
|
||||
EVENT_UDEVADM_TEST_BUILTIN,
|
||||
EVENT_TEST_RULE_RUNNER,
|
||||
EVENT_TEST_SPAWN,
|
||||
_EVENT_MODE_MAX,
|
||||
_EVENT_MODE_INVALID = -EINVAL,
|
||||
} EventMode;
|
||||
|
||||
typedef enum UdevRuleEscapeType {
|
||||
ESCAPE_UNSET,
|
||||
ESCAPE_NONE, /* OPTIONS="string_escape=none" */
|
||||
ESCAPE_REPLACE, /* OPTIONS="string_escape=replace" */
|
||||
_ESCAPE_TYPE_MAX,
|
||||
_ESCAPE_TYPE_INVALID = -EINVAL,
|
||||
} UdevRuleEscapeType;
|
||||
|
||||
typedef enum ResolveNameTiming {
|
||||
RESOLVE_NAME_NEVER,
|
||||
RESOLVE_NAME_LATE,
|
||||
RESOLVE_NAME_EARLY,
|
||||
_RESOLVE_NAME_TIMING_MAX,
|
||||
_RESOLVE_NAME_TIMING_INVALID = -EINVAL,
|
||||
} ResolveNameTiming;
|
||||
|
||||
typedef enum UdevBuiltinCommand {
|
||||
#if HAVE_BLKID
|
||||
UDEV_BUILTIN_BLKID,
|
||||
#endif
|
||||
UDEV_BUILTIN_BTRFS,
|
||||
UDEV_BUILTIN_HWDB,
|
||||
UDEV_BUILTIN_INPUT_ID,
|
||||
UDEV_BUILTIN_KEYBOARD,
|
||||
#if HAVE_KMOD
|
||||
UDEV_BUILTIN_KMOD,
|
||||
#endif
|
||||
UDEV_BUILTIN_NET_DRIVER,
|
||||
UDEV_BUILTIN_NET_ID,
|
||||
UDEV_BUILTIN_NET_LINK,
|
||||
UDEV_BUILTIN_PATH_ID,
|
||||
UDEV_BUILTIN_USB_ID,
|
||||
#if HAVE_ACL
|
||||
UDEV_BUILTIN_UACCESS,
|
||||
#endif
|
||||
_UDEV_BUILTIN_MAX,
|
||||
_UDEV_BUILTIN_INVALID = -EINVAL,
|
||||
} UdevBuiltinCommand;
|
@ -12,8 +12,10 @@
|
||||
#include "strv.h"
|
||||
#include "udev-event.h"
|
||||
#include "udev-node.h"
|
||||
#include "udev-rules.h"
|
||||
#include "udev-trace.h"
|
||||
#include "udev-util.h"
|
||||
#include "udev-worker.h"
|
||||
#include "user-util.h"
|
||||
|
||||
UdevEvent* udev_event_new(sd_device *dev, UdevWorker *worker, EventMode mode) {
|
||||
|
@ -14,17 +14,11 @@
|
||||
#include "hashmap.h"
|
||||
#include "macro.h"
|
||||
#include "time-util.h"
|
||||
#include "udev-rules.h"
|
||||
#include "udev-worker.h"
|
||||
#include "udev-def.h"
|
||||
#include "user-util.h"
|
||||
|
||||
typedef enum EventMode {
|
||||
EVENT_UDEV_WORKER,
|
||||
EVENT_UDEVADM_TEST,
|
||||
EVENT_UDEVADM_TEST_BUILTIN,
|
||||
EVENT_TEST_RULE_RUNNER,
|
||||
EVENT_TEST_SPAWN,
|
||||
} EventMode;
|
||||
typedef struct UdevRules UdevRules;
|
||||
typedef struct UdevWorker UdevWorker;
|
||||
|
||||
typedef struct UdevEvent {
|
||||
UdevWorker *worker;
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "udev-event.h"
|
||||
#include "udev-format.h"
|
||||
#include "udev-util.h"
|
||||
#include "udev-worker.h"
|
||||
|
||||
typedef enum {
|
||||
FORMAT_SUBST_DEVNODE,
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "udev-event.h"
|
||||
#include "udev-manager.h"
|
||||
#include "udev-node.h"
|
||||
#include "udev-rules.h"
|
||||
#include "udev-spawn.h"
|
||||
#include "udev-trace.h"
|
||||
#include "udev-util.h"
|
||||
|
@ -10,9 +10,10 @@
|
||||
#include "macro.h"
|
||||
#include "time-util.h"
|
||||
#include "udev-ctrl.h"
|
||||
#include "udev-rules.h"
|
||||
#include "udev-def.h"
|
||||
|
||||
typedef struct Event Event;
|
||||
typedef struct UdevRules UdevRules;
|
||||
typedef struct Worker Worker;
|
||||
|
||||
typedef struct Manager {
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include "udev-spawn.h"
|
||||
#include "udev-trace.h"
|
||||
#include "udev-util.h"
|
||||
#include "udev-worker.h"
|
||||
#include "user-util.h"
|
||||
#include "virt.h"
|
||||
|
||||
|
@ -4,31 +4,12 @@
|
||||
#include "alloc-util.h"
|
||||
#include "hashmap.h"
|
||||
#include "time-util.h"
|
||||
|
||||
#define UDEV_NAME_SIZE 512
|
||||
#define UDEV_PATH_SIZE 1024
|
||||
#define UDEV_LINE_SIZE 16384
|
||||
#include "udev-def.h"
|
||||
|
||||
typedef struct UdevRuleFile UdevRuleFile;
|
||||
typedef struct UdevRules UdevRules;
|
||||
typedef struct UdevEvent UdevEvent;
|
||||
|
||||
typedef enum {
|
||||
ESCAPE_UNSET,
|
||||
ESCAPE_NONE, /* OPTIONS="string_escape=none" */
|
||||
ESCAPE_REPLACE, /* OPTIONS="string_escape=replace" */
|
||||
_ESCAPE_TYPE_MAX,
|
||||
_ESCAPE_TYPE_INVALID = -EINVAL,
|
||||
} UdevRuleEscapeType;
|
||||
|
||||
typedef enum ResolveNameTiming {
|
||||
RESOLVE_NAME_NEVER,
|
||||
RESOLVE_NAME_LATE,
|
||||
RESOLVE_NAME_EARLY,
|
||||
_RESOLVE_NAME_TIMING_MAX,
|
||||
_RESOLVE_NAME_TIMING_INVALID = -EINVAL,
|
||||
} ResolveNameTiming;
|
||||
|
||||
int udev_rule_parse_value(char *str, char **ret_value, char **ret_endpos, bool *ret_is_case_insensitive);
|
||||
int udev_rules_parse_file(UdevRules *rules, const char *filename, bool extra_checks, UdevRuleFile **ret);
|
||||
unsigned udev_rule_file_get_issues(UdevRuleFile *rule_file);
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "udev-event.h"
|
||||
#include "udev-spawn.h"
|
||||
#include "udev-trace.h"
|
||||
#include "udev-worker.h"
|
||||
|
||||
typedef struct Spawn {
|
||||
sd_device *device;
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "signal-util.h"
|
||||
#include "string-util.h"
|
||||
#include "udev-event.h"
|
||||
#include "udev-rules.h"
|
||||
#include "udev-spawn.h"
|
||||
#include "udev-trace.h"
|
||||
#include "udev-util.h"
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "udev-builtin.h"
|
||||
#include "udev-event.h"
|
||||
#include "udev-format.h"
|
||||
#include "udev-rules.h"
|
||||
#include "udevadm-util.h"
|
||||
#include "udevadm.h"
|
||||
#include "user-util.h"
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "signal-util.h"
|
||||
#include "syslog-util.h"
|
||||
#include "udev-manager.h"
|
||||
#include "udev-rules.h"
|
||||
#include "udev-util.h"
|
||||
#include "udevd.h"
|
||||
#include "version.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user