]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/verbs.h
hibernate-resume: add resumeflags= kernel option
[thirdparty/systemd.git] / src / shared / verbs.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 #include <stdbool.h>
5
6 #define VERB_ANY ((unsigned) -1)
7
8 typedef enum VerbFlags {
9 VERB_DEFAULT = 1 << 0,
10 VERB_ONLINE_ONLY = 1 << 1,
11 VERB_MUST_BE_ROOT = 1 << 2,
12 } VerbFlags;
13
14 typedef struct {
15 const char *verb;
16 unsigned min_args, max_args;
17 VerbFlags flags;
18 int (* const dispatch)(int argc, char *argv[], void *userdata);
19 } Verb;
20
21 bool running_in_chroot_or_offline(void);
22
23 int dispatch_verb(int argc, char *argv[], const Verb verbs[], void *userdata);