Crinit -- Configurable Rootfs Init
confconv.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: MIT
7 #include <stdbool.h>
8 
9 #include "envset.h"
10 #include "ioredir.h"
11 
26 char **crinitConfConvToStrArr(int *numElements, const char *confVal, bool doubleQuoting);
46 int crinitConfConvToIoRedir(crinitIoRedir_t *ior, const char *confVal);
47 
58 int crinitConfConvToEnvSetMember(crinitEnvSet_t *es, const char *confVal);
59 
61 int crinitConfConvToIntegerI(int *x, const char *confVal, int base);
63 int crinitConfConvToIntegerULL(unsigned long long *x, const char *confVal, int base);
75 // clang-format off
76 // Rationale: Used version of clang-format does not format _Generic macros correctly. This is a known bug and has been
77 // fixed very recently. We may remove this exemption once we are on the new clang version as standard.
78 // See: https://github.com/llvm/llvm-project/issues/18080
79 #define crinitConfConvToInteger(out, confVal, base) \
80  _Generic((*(out)), \
81  int : crinitConfConvToIntegerI, \
82  unsigned long long : crinitConfConvToIntegerULL) \
83  (out, confVal, base)
84 // clang-format on
85 
96 int crinitConfConvToBool(bool *b, const char *confVal);
97 
int crinitConfConvToIntegerULL(unsigned long long *x, const char *confVal, int base)
Definition: confconv.c:151
int crinitConfConvToIntegerI(int *x, const char *confVal, int base)
Definition: confconv.c:145
char ** crinitConfConvToStrArr(int *numElements, const char *confVal, bool doubleQuoting)
Definition: confconv.c:29
int crinitConfConvToBool(bool *b, const char *confVal)
Definition: confconv.c:157
int crinitConfConvToIoRedir(crinitIoRedir_t *ior, const char *confVal)
Definition: confconv.c:171
int crinitConfConvToEnvSetMember(crinitEnvSet_t *es, const char *confVal)
Definition: confconv.c:276
Header defining data types and functions to work with sets of environment variables.
Header related to IO redirection types and functions.
Definition: envset.h:25
Definition: ioredir.h:14