]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
dca59f62 LP |
2 | #pragma once |
3 | ||
4 | /*** | |
5 | This file is part of systemd. | |
6 | ||
7 | Copyright 2014 Lennart Poettering | |
dca59f62 LP |
8 | ***/ |
9 | ||
10 | #define VERB_ANY ((unsigned) -1) | |
0c63eb71 LP |
11 | |
12 | typedef enum VerbFlags { | |
c56d1e2c CW |
13 | VERB_DEFAULT = 1 << 0, |
14 | VERB_ONLINE_ONLY = 1 << 1, | |
15 | VERB_MUST_BE_ROOT = 1 << 2, | |
0c63eb71 | 16 | } VerbFlags; |
dca59f62 LP |
17 | |
18 | typedef struct { | |
19 | const char *verb; | |
20 | unsigned min_args, max_args; | |
0c63eb71 | 21 | VerbFlags flags; |
dca59f62 LP |
22 | int (* const dispatch)(int argc, char *argv[], void *userdata); |
23 | } Verb; | |
24 | ||
f38951a6 CW |
25 | bool running_in_chroot_or_offline(void); |
26 | ||
dca59f62 | 27 | int dispatch_verb(int argc, char *argv[], const Verb verbs[], void *userdata); |