env-util.h revision 43d03a83766a0d63f535e2afa6aeb6e6acbe83b2
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering#pragma once
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering/***
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering This file is part of systemd.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering Copyright 2013 Lennart Poettering
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering systemd is free software; you can redistribute it and/or modify it
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering under the terms of the GNU Lesser General Public License as published by
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering (at your option) any later version.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering systemd is distributed in the hope that it will be useful, but
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering Lesser General Public License for more details.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering You should have received a copy of the GNU Lesser General Public License
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering***/
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering#include <stdbool.h>
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering#include <sys/types.h>
c335068380fe8c9d843cdb2cf8a00f822cfabed3Lennart Poettering
c335068380fe8c9d843cdb2cf8a00f822cfabed3Lennart Poetteringbool env_name_is_valid(const char *e);
c335068380fe8c9d843cdb2cf8a00f822cfabed3Lennart Poetteringbool env_value_is_valid(const char *e);
c335068380fe8c9d843cdb2cf8a00f822cfabed3Lennart Poetteringbool env_assignment_is_valid(const char *e);
c34255bdb217c2a1d3ac6348252437ab8be9ca46Lennart Poettering
24882e06c135584f16f31ba8a00fecde8b7f6fadLennart Poetteringbool strv_env_is_valid(char **e);
24882e06c135584f16f31ba8a00fecde8b7f6fadLennart Poetteringchar **strv_env_clean(char **l);
1ddb263d21099ae42195c2bc382bdf72a7f24f82Lennart Poetteringchar **strv_env_clean_log(char **e, const char *message);
ebeccf9eecf5939a2ef772c3160e89efcad96194Lennart Poettering
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poetteringbool strv_env_name_or_assignment_is_valid(char **l);
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poetteringchar **strv_env_merge(unsigned n_lists, ...);
c335068380fe8c9d843cdb2cf8a00f822cfabed3Lennart Poetteringchar **strv_env_delete(char **x, unsigned n_lists, ...); /* New copy */
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poetteringchar **strv_env_set(char **x, const char *p); /* New copy ... */
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poetteringchar **strv_env_unset(char **l, const char *p); /* In place ... */
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poetteringchar **strv_env_unset_many(char **l, ...) _sentinel_;
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering
d5099efc47d4e6ac60816b5381a5f607ab03f06eMichal Schmidtchar *strv_env_get_n(char **l, const char *name, size_t k) _pure_;
d5099efc47d4e6ac60816b5381a5f607ab03f06eMichal Schmidtchar *strv_env_get(char **x, const char *n) _pure_;
d5099efc47d4e6ac60816b5381a5f607ab03f06eMichal Schmidt