diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-01-27 08:37:56 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-01-27 08:39:31 +0200 |
commit | 1abc10223b37d9ead3454a06e176b4b65370a2be (patch) | |
tree | 2d30c9130bb7acf2968078ed408e1d36b70c22b0 /libbuild2/utility.ixx | |
parent | ba637925b32e85c22c9dc81820e407ebdacfe5f7 (diff) |
Improve process run_*() API
Diffstat (limited to 'libbuild2/utility.ixx')
-rw-r--r-- | libbuild2/utility.ixx | 39 |
1 files changed, 39 insertions, 0 deletions
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) { |