From 781716c240da330d57f27bf22f48017f9132a489 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Mon, 10 Jun 2019 00:22:48 +0200 Subject: Add pushd/popd utility Signed-off-by: David Oberhollenzer --- include/util.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/util.h b/include/util.h index f618f81..b496039 100644 --- a/include/util.h +++ b/include/util.h @@ -41,4 +41,13 @@ void print_version(void); */ int mkdir_p(const char *path); +/* Returns 0 on success. On failure, prints error message to stderr. */ +int pushd(const char *path); + +/* Same as pushd, but the string doesn't have to be null-terminated. */ +int pushdn(const char *path, size_t len); + +/* Returns 0 on success. On failure, prints error message to stderr. */ +int popd(void); + #endif /* UTIL_H */ -- cgit v1.2.3