From 3074c5e1409ad49c0793db6384ecbc6ac4ed33a9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 11 Dec 2020 07:07:36 +0200 Subject: Add search_locked() versions of search() functions --- libbuild2/algorithm.hxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'libbuild2/algorithm.hxx') diff --git a/libbuild2/algorithm.hxx b/libbuild2/algorithm.hxx index 34e844c..aa1336c 100644 --- a/libbuild2/algorithm.hxx +++ b/libbuild2/algorithm.hxx @@ -39,6 +39,12 @@ namespace build2 LIBBUILD2_SYMEXPORT const target& search (const target&, const prerequisite_key&); + // As above but return the lock if the target was newly created. Note that + // this version can only be used on project-unqualified prerequisites. + // + LIBBUILD2_SYMEXPORT pair + search_locked (const target&, const prerequisite_key&); + // Note that unlike the above version, this one can be called during the // load and execute phases. // @@ -57,6 +63,9 @@ namespace build2 const target& search (const target&, const target_type&, const prerequisite_key&); + pair + search_locked (const target&, const target_type&, const prerequisite_key&); + // As above but specify the prerequisite to search as individual key // components. Scope can be NULL if the directory is absolute. // @@ -70,6 +79,15 @@ namespace build2 const scope* = nullptr, // NULL means dir is absolute. const optional& proj = nullopt); + pair + search_locked (const target&, + const target_type&, + const dir_path& dir, + const dir_path& out, + const string& name, + const string* ext = nullptr, // NULL means unspecified. + const scope* = nullptr); // NULL means dir is absolute. + const target* search_existing (context&, const target_type&, -- cgit v1.1