diff options
author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2024-12-11 10:28:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-11 10:28:47 -0500 |
commit | 3078519379ffcdc45811431336547d7df31a24ee (patch) | |
tree | 2b5be989ca839bd97f55f40605e23d7019397be7 /include/envctl.h | |
parent | 456c5a481a7dabb53434a696488ac6eecb962d5b (diff) | |
parent | 4fd92ec6b203d6b94b9e9f9531fd60a65736e810 (diff) | |
download | stasis-3078519379ffcdc45811431336547d7df31a24ee.tar.gz |
Merge pull request #75 from jhunkeler/delivery-lib
Move delivery_*.c sources into their own library
Diffstat (limited to 'include/envctl.h')
-rw-r--r-- | include/envctl.h | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/include/envctl.h b/include/envctl.h deleted file mode 100644 index 659cae3..0000000 --- a/include/envctl.h +++ /dev/null @@ -1,39 +0,0 @@ -//! @file envctl.h -#ifndef STASIS_ENVCTL_H -#define STASIS_ENVCTL_H - -#include <stdlib.h> -#include "core.h" - -#define STASIS_ENVCTL_PASSTHRU 0 -#define STASIS_ENVCTL_REQUIRED 1 << 1 -#define STASIS_ENVCTL_REDACT 1 << 2 -#define STASIS_ENVCTL_DEFAULT_ALLOC 100 - -#define STASIS_ENVCTL_RET_FAIL (-1) -#define STASIS_ENVCTL_RET_SUCCESS 1 -#define STASIS_ENVCTL_RET_IGNORE 2 -typedef int (envctl_except_fn)(const void *, const void *); - -struct EnvCtl_Item { - unsigned flags; //<! One or more STASIS_ENVCTL_* flags - const char *name; //<! Environment variable name - envctl_except_fn *callback; -}; - -struct EnvCtl { - size_t num_alloc; - size_t num_used; - struct EnvCtl_Item **item; -}; - -struct EnvCtl *envctl_init(); -int envctl_register(struct EnvCtl **envctl, unsigned flags, envctl_except_fn *callback, const char *name); -unsigned envctl_get_flags(const struct EnvCtl *envctl, const char *name); -unsigned envctl_check_required(unsigned flags); -unsigned envctl_check_redact(unsigned flags); -int envctl_check_present(const struct EnvCtl_Item *item, const char *name); -void envctl_do_required(const struct EnvCtl *envctl, int verbose); -void envctl_free(struct EnvCtl **envctl); - -#endif // STASIS_ENVCTL_H
\ No newline at end of file |