STASIS
A pipeline delivery generator
Loading...
Searching...
No Matches
src
lib
core
include
envctl.h
Go to the documentation of this file.
1
2
#ifndef STASIS_ENVCTL_H
3
#define STASIS_ENVCTL_H
4
5
#include <stdlib.h>
6
#include "
core.h
"
7
8
#define STASIS_ENVCTL_PASSTHRU 0
9
#define STASIS_ENVCTL_REQUIRED 1 << 1
10
#define STASIS_ENVCTL_REDACT 1 << 2
11
#define STASIS_ENVCTL_DEFAULT_ALLOC 100
12
13
#define STASIS_ENVCTL_RET_FAIL (-1)
14
#define STASIS_ENVCTL_RET_SUCCESS 1
15
#define STASIS_ENVCTL_RET_IGNORE 2
16
typedef
int (envctl_except_fn)(
const
void
*,
const
void
*);
17
18
struct
EnvCtl_Item
{
19
unsigned
flags;
//<! One or more STASIS_ENVCTL_* flags
20
const
char
*name;
//<! Environment variable name
21
envctl_except_fn *callback;
22
};
23
24
struct
EnvCtl
{
25
size_t
num_alloc;
26
size_t
num_used;
27
struct
EnvCtl_Item
**item;
28
};
29
30
struct
EnvCtl
*envctl_init();
31
int
envctl_register(
struct
EnvCtl
**envctl,
unsigned
flags, envctl_except_fn *callback,
const
char
*name);
32
unsigned
envctl_get_flags(
const
struct
EnvCtl
*envctl,
const
char
*name);
33
unsigned
envctl_check_required(
unsigned
flags);
34
unsigned
envctl_check_redact(
unsigned
flags);
35
int
envctl_check_present(
const
struct
EnvCtl_Item
*item,
const
char
*name);
36
void
envctl_do_required(
const
struct
EnvCtl
*envctl,
int
verbose);
37
void
envctl_free(
struct
EnvCtl
**envctl);
38
39
#endif
// STASIS_ENVCTL_H
core.h
EnvCtl_Item
Definition
envctl.h:18
EnvCtl
Definition
envctl.h:24
Generated by
1.13.2