diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-11-30 22:08:41 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-12-02 13:22:29 +0100 |
commit | 686d13b9f247f4d113e93f0997b9365a3e6b264b (patch) | |
tree | 35a45766e342e2b70d6bf5cf17d3c8c7dc397983 /src/basic/env-file.h | |
parent | util-lib: move open_serialization_fd() to serialize.c (diff) | |
download | systemd-686d13b9f247f4d113e93f0997b9365a3e6b264b.tar.xz systemd-686d13b9f247f4d113e93f0997b9365a3e6b264b.zip |
util-lib: split out env file parsing code into env-file.c
It's quite complex, let's split this out.
No code changes, just some file rearranging.
Diffstat (limited to 'src/basic/env-file.h')
-rw-r--r-- | src/basic/env-file.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/basic/env-file.h b/src/basic/env-file.h new file mode 100644 index 0000000000..e1ca195ff0 --- /dev/null +++ b/src/basic/env-file.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#include <stdarg.h> +#include <stdio.h> + +#include "macro.h" + +int parse_env_filev(FILE *f, const char *fname, va_list ap); +int parse_env_file_sentinel(FILE *f, const char *fname, ...) _sentinel_; +#define parse_env_file(f, fname, ...) parse_env_file_sentinel(f, fname, __VA_ARGS__, NULL) +int load_env_file(FILE *f, const char *fname, char ***l); +int load_env_file_pairs(FILE *f, const char *fname, char ***l); + +int merge_env_file(char ***env, FILE *f, const char *fname); + +int write_env_file(const char *fname, char **l); |