summaryrefslogtreecommitdiff
path: root/src/execute.hpp
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2020-07-28 20:06:36 +0200
committerJoel Rosdahl <joel@rosdahl.net>2020-07-29 16:43:59 +0200
commit227426ae7b205153d968058881070e65cec808f0 (patch)
tree19ac4067e091a93b329c9604f37448198057c7c8 /src/execute.hpp
parent21480ca438456ff7010a309f24ffdcd12aec83f3 (diff)
downloadccache-227426ae7b205153d968058881070e65cec808f0.tar.gz
C++-ify execute functions
Diffstat (limited to 'src/execute.hpp')
-rw-r--r--src/execute.hpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/execute.hpp b/src/execute.hpp
index e66f73a2..5bcff8cc 100644
--- a/src/execute.hpp
+++ b/src/execute.hpp
@@ -27,11 +27,16 @@
class Context;
int execute(const char* const* argv, Fd&& fd_out, Fd&& fd_err, pid_t* pid);
-std::string
-find_executable(const Context& ctx, const char* name, const char* exclude_name);
-std::string find_executable_in_path(const char* name,
- const char* exclude_name,
- const char* path);
+
+// Find an executable named `name` in `$PATH`. Exclude any executables that are
+// links to `exclude_name`.
+std::string find_executable(const Context& ctx,
+ const std::string& name,
+ const std::string& exclude_name);
+
+std::string find_executable_in_path(const std::string& name,
+ const std::string& exclude_name,
+ const std::string& path);
#ifdef _WIN32
char* win32argvtos(const char* prefix, const char* const* argv, int* length);