aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/operation.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-10-20 15:16:28 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-10-20 15:16:28 +0200
commit51666badaa58d1cc70a05b362dbf9fbef64a7296 (patch)
tree2919f013c9c1c12c7d31ee0b60eb0fbcb4130558 /libbuild2/operation.hxx
parentecc0f934eff0443490202b614a73097e75b1e3db (diff)
Add operation callback for adhoc rule match and apply
Diffstat (limited to 'libbuild2/operation.hxx')
-rw-r--r--libbuild2/operation.hxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/libbuild2/operation.hxx b/libbuild2/operation.hxx
index b1cdf21..cfd6a95 100644
--- a/libbuild2/operation.hxx
+++ b/libbuild2/operation.hxx
@@ -11,6 +11,7 @@
#include <libbuild2/utility.hxx>
#include <libbuild2/action.hxx>
+#include <libbuild2/recipe.hxx>
#include <libbuild2/target-state.hxx>
#include <libbuild2/export.hxx>
@@ -67,7 +68,7 @@ namespace build2
//
const bool bootstrap_outer;
- // The first argument in all the callback is the meta-operation
+ // The first argument in all the callbacks is the meta-operation
// parameters.
//
// If the meta-operation expects parameters, then it should have a
@@ -215,7 +216,7 @@ namespace build2
//
const size_t concurrency;
- // The first argument in all the callback is the operation parameters.
+ // The first argument in all the callbacks is the operation parameters.
//
// If the operation expects parameters, then it should have a non-NULL
// pre(). Failed that, any parameters will be diagnosed as unexpected.
@@ -226,6 +227,16 @@ namespace build2
//
operation_id (*pre) (const values&, meta_operation_id, const location&);
operation_id (*post) (const values&, meta_operation_id);
+
+ // Operation-specific ad hoc rule callbacks. Essentially, if not NULL,
+ // then every ad hoc rule match and apply call for this operation is
+ // proxied through these functions.
+ //
+ bool (*adhoc_match) (const adhoc_rule&,
+ action, target&, const string&, match_extra&,
+ optional<action>);
+
+ recipe (*adhoc_apply) (const adhoc_rule&, action, target&, match_extra&);
};
// Built-in operations.