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