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