Crinit -- Configurable Rootfs Init
envset.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: MIT
6 #ifndef __ENVSET_H__
7 #define __ENVSET_H__
8 
9 #include <stddef.h>
10 
11 #include "confparse.h"
12 
16 #define CRINIT_ENVSET_INITIAL_SIZE 128uL
20 #define CRINIT_ENVSET_SIZE_INCREMENT 64uL
21 
25 typedef struct crinitEnvSet_t {
26  char **envp;
28  size_t allocSz;
29  size_t allocInc;
31 
42 int crinitEnvSetInit(crinitEnvSet_t *es, size_t initSize, size_t sizeIncrement);
63 int crinitEnvSetDup(crinitEnvSet_t *copy, const crinitEnvSet_t *orig);
79  const char *restrict key);
89 const char *crinitEnvSetGet(const crinitEnvSet_t *es, const char *envName);
99 const char *crinitEnvSetEntry(const crinitEnvSet_t *es, const size_t idx);
115 int crinitEnvSetSet(crinitEnvSet_t *es, const char *envName, const char *envVal);
116 
117 #endif /* __ENVSET_H__ */
Header related to the Config Parser.
int crinitEnvSetSet(crinitEnvSet_t *es, const char *envName, const char *envVal)
Definition: envset.c:117
const char * crinitEnvSetEntry(const crinitEnvSet_t *es, const size_t idx)
const char * crinitEnvSetGet(const crinitEnvSet_t *es, const char *envName)
Definition: envset.c:106
int crinitEnvSetInit(crinitEnvSet_t *es, size_t initSize, size_t sizeIncrement)
Definition: envset.c:36
int crinitEnvSetCreateFromConfKvList(crinitEnvSet_t *newSet, const crinitEnvSet_t *baseSet, const crinitConfKvList_t *c, const char *restrict key)
struct crinitEnvSet_t crinitEnvSet_t
int crinitEnvSetDestroy(crinitEnvSet_t *es)
Definition: envset.c:51
int crinitEnvSetDup(crinitEnvSet_t *copy, const crinitEnvSet_t *orig)
Definition: envset.c:70
Definition: confparse.h:96
Definition: envset.h:25
size_t allocSz
Currently allocated size of envp, may be larger than the number of initialized elements.
Definition: envset.h:28
size_t allocInc
Increment to add to envp's size in case we run out of space.
Definition: envset.h:29
char ** envp
Definition: envset.h:26