aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/script/script.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-11-02 22:22:09 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-11-09 21:45:02 +0300
commitfca95dafaaab44d3e06e10bc9f3b45d00c82301f (patch)
tree69f59c57b0aa6100e01264a5d10e6a155ffff79e /libbuild2/script/script.hxx
parentf34dd20fb7578874925dacf21b32338af50e8c12 (diff)
Use diag_buffer in script
Diffstat (limited to 'libbuild2/script/script.hxx')
-rw-r--r--libbuild2/script/script.hxx21
1 files changed, 14 insertions, 7 deletions
diff --git a/libbuild2/script/script.hxx b/libbuild2/script/script.hxx
index aa96b7f..f9e0fa9 100644
--- a/libbuild2/script/script.hxx
+++ b/libbuild2/script/script.hxx
@@ -265,7 +265,7 @@ namespace build2
cleanup_type type;
build2::path path;
};
- using cleanups = vector<cleanup>;
+ using cleanups = vector<cleanup>; // @@ Make it small_vector<..., 1>?
// command_exit
//
@@ -318,6 +318,10 @@ namespace build2
add (string);
};
+ // @@ For better diagnostics we may want to store an individual location
+ // of each command in the pipeline (maybe we can share the file part
+ // somehow since a pipline cannot span multiple files).
+ //
struct command
{
// We use NULL initial as an indication that the path stored in recall
@@ -357,7 +361,7 @@ namespace build2
// command_pipe
//
- using command_pipe = vector<command>;
+ using command_pipe = vector<command>; // @@ Make it small_vector<..., 1>?
void
to_stream (ostream&, const command_pipe&, command_to_stream);
@@ -375,7 +379,7 @@ namespace build2
command_pipe pipe;
};
- using command_expr = vector<expr_term>;
+ using command_expr = vector<expr_term>; // @@ Make it small_vector<..., 1>?
void
to_stream (ostream&, const command_expr&, command_to_stream);
@@ -581,15 +585,18 @@ namespace build2
~environment () = default;
};
- // Custom command function that can be executed at the end of the pipe.
- // Should throw io_error on the underlying OS error.
+ // Custom command function that can be executed at the end of the
+ // pipeline. Should throw io_error on the underlying OS error.
+ //
+ // Note: the pipeline can be NULL (think of `for x <<<='foo'`).
//
+ struct pipe_command;
+
using command_function = void (environment&,
const strings& args,
auto_fd in,
- bool pipe,
+ pipe_command* pipeline,
const optional<deadline>&,
- const command& deadline_cmd,
const location&);
// Helpers.