Crinit -- Configurable Rootfs Init
Loading...
Searching...
No Matches
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
26char **crinitConfConvToStrArr(int *numElements, const char *confVal, bool doubleQuoting);
46int crinitConfConvToIoRedir(crinitIoRedir_t *ior, const char *confVal);
47
58int crinitConfConvToEnvSetMember(crinitEnvSet_t *es, const char *confVal);
59
61int crinitConfConvToIntegerI(int *x, const char *confVal, int base);
63int crinitConfConvToIntegerULL(unsigned long long *x, const char *confVal, int base);
65int crinitConfConvToIntegerUI(unsigned int *x, const char *confVal, int base);
67int crinitConfConvToIntegerLL(long long *x, const char *confVal, int base);
79// clang-format off
80// Rationale: Used version of clang-format does not format _Generic macros correctly. This is a known bug and has been
81// fixed very recently. We may remove this exemption once we are on the new clang version as standard.
82// See: https://github.com/llvm/llvm-project/issues/18080
83#define crinitConfConvToInteger(out, confVal, base) \
84 _Generic((*(out)), \
85 int : crinitConfConvToIntegerI, \
86 unsigned int : crinitConfConvToIntegerUI, \
87 long long : crinitConfConvToIntegerLL, \
88 unsigned long long : crinitConfConvToIntegerULL) \
89 (out, confVal, base)
90// clang-format on
91
102int crinitConfConvToBool(bool *b, const char *confVal);
int crinitConfConvToIntegerUI(unsigned int *x, const char *confVal, int base)
Definition confconv.c:157
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:169
int crinitConfConvToIntegerLL(long long *x, const char *confVal, int base)
Definition confconv.c:163
int crinitConfConvToIoRedir(crinitIoRedir_t *ior, const char *confVal)
Definition confconv.c:183
int crinitConfConvToEnvSetMember(crinitEnvSet_t *es, const char *confVal)
Definition confconv.c:288
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