From 1abc10223b37d9ead3454a06e176b4b65370a2be Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 27 Jan 2020 08:37:56 +0200 Subject: Improve process run_*() API --- libbuild2/utility.ixx | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'libbuild2/utility.ixx') diff --git a/libbuild2/utility.ixx b/libbuild2/utility.ixx index 514d4ee..4b841f7 100644 --- a/libbuild2/utility.ixx +++ b/libbuild2/utility.ixx @@ -6,6 +6,45 @@ namespace build2 { + inline bool + run_wait (cstrings& args, process& pr, const location& loc) + { + return run_wait (args.data (), pr, loc); + } + + // Note: currently this function is also used in a run() implementations. + // + LIBBUILD2_SYMEXPORT bool + run_finish_impl (const char*[], + process&, + bool error, + const string&, + const location& = location ()); + + inline void + run_finish (const char* args[], + process& pr, + const string& l, + const location& loc) + { + run_finish_impl (args, pr, true /* error */, l, loc); + } + + inline void + run_finish (cstrings& args, process& pr, const location& loc) + { + run_finish (args.data (), pr, string (), loc); + } + + inline bool + run_finish_code (const char* args[], + process& pr, + const string& l, + const location& loc) + { + return run_finish_impl (args, pr, false /* error */, l, loc); + } + inline void hash_path (sha256& cs, const path& p, const dir_path& prefix) { -- cgit v1.1