diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2025-05-26 15:46:13 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska@appnovation.com> | 2025-05-26 15:46:13 +0000 |
| commit | deccf98369a77c3fab8be3b26bab7c0c7f04bca3 (patch) | |
| tree | e7f1ecd1764a1657bc83b6f860a24592d8a2b42b /src/s6/s6-internal.h | |
| parent | 31c208b970599588b00837294871fa4e4eeb01de (diff) | |
| download | s6-frontend-deccf98369a77c3fab8be3b26bab7c0c7f04bca3.tar.gz | |
Boilerplate for main command
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/s6/s6-internal.h')
| -rw-r--r-- | src/s6/s6-internal.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/s6/s6-internal.h b/src/s6/s6-internal.h new file mode 100644 index 0000000..216d666 --- /dev/null +++ b/src/s6/s6-internal.h @@ -0,0 +1,48 @@ +/* ISC license. */ + +#ifndef S6_INTERNAL_H +#define S6_INTERNAL_H + +#include <stdlib.h> + +#include <skalibs/functypes.h> +#include <s6-frontend/config.h> + + + /* util */ + +extern int keycmp (void const *, void const *) ; +#define BSEARCH(type, key, array) bsearch(key, (array), sizeof(array)/sizeof(type), sizeof(type), &keycmp) + + + /* help */ + +extern int help (char const *const *) ; + + + /* version */ + +extern int version (char const *const *) ; + + + /* main */ + +struct global_s +{ + unsigned int verbosity ; +} ; +#define GLOBAL_ZERO \ +{ \ + .verbosity = 1, \ +} + +extern struct global_s *g ; + +struct command_s +{ + char const *s ; + main_func_ref f ; +} ; +#define COMMAND_ZERO { .s = 0, .f = 0 } + +#endif |
