2
0
mirror of https://github.com/boostorg/process.git synced 2026-01-19 04:22:15 +00:00

moved v1 to v1 inline namespace.

This commit is contained in:
Klemens Morgenstern
2024-06-04 11:54:29 +08:00
committed by Klemens Morgenstern
parent bcdd91188c
commit 55e2460967
150 changed files with 1002 additions and 933 deletions

View File

@@ -75,9 +75,9 @@ but the one of the launching process, not the one passed to the child process.]
The simplest form to extend functionality is to provide another handler, which
will be called on the respective events on process launching. The names are:
*`boost::process::on_setup`
*`boost::process::on_error`
*`boost::process::on_success`
*`boost::process::v1::on_setup`
*`boost::process::v1::on_error`
*`boost::process::v1::on_success`
As an example:

View File

@@ -1,14 +1,14 @@
[def __on_exit__ [globalref boost::process::on_exit on_exit]]
[def __on_success__ [globalref boost::process::extend::on_success ex::on_success]]
[def __child__ [classref boost::process::child child]]
[def __handler__ [classref boost::process::extend::handler handler]]
[def __on_success__ [memberref boost::process::extend::handler::on_success on_success]]
[def __posix_executor__ [classref boost::process::extend::posix_executor ex::posix_executor]]
[def __windows_executor__ [classref boost::process::extend::windows_executor ex::windows_executor]]
[def __on_exit__ [globalref boost::process::v1::on_exit on_exit]]
[def __on_success__ [globalref boost::process::v1::extend::on_success ex::on_success]]
[def __child__ [classref boost::process::v1::child child]]
[def __handler__ [classref boost::process::v1::extend::handler handler]]
[def __on_success__ [memberref boost::process::v1::extend::handler::on_success on_success]]
[def __posix_executor__ [classref boost::process::v1::extend::posix_executor ex::posix_executor]]
[def __windows_executor__ [classref boost::process::v1::extend::windows_executor ex::windows_executor]]
[def __io_context__ [@http://www.boost.org/doc/libs/release/doc/html/boost_asio/reference/io_context.html boost::asio::io_context]]
[def __require_io_context__ [classref boost::process::extend::require_io_context ex::require_io_context]]
[def __async_handler__ [classref boost::process::extend::async_handler ex::async_handler]]
[def __get_io_context__ [funcref boost::process::extend::get_io_context ex::get_io_context]]
[def __require_io_context__ [classref boost::process::v1::extend::require_io_context ex::require_io_context]]
[def __async_handler__ [classref boost::process::v1::extend::async_handler ex::async_handler]]
[def __get_io_context__ [funcref boost::process::v1::extend::get_io_context ex::get_io_context]]
[section:extend Extensions]
To extend the library, the header [headerref boost/process/extend.hpp extend] is provided.
@@ -16,7 +16,7 @@ To extend the library, the header [headerref boost/process/extend.hpp extend] is
It only provides the explicit style for custom properties, but no implicit style.
What this means is, that a custom initializer can be implemented, a reference which can be passed to one of the launching functions.
If a class inherits [classref boost::process::extend::handler] it will be regarded as an initializer and thus directly put into the sequence
If a class inherits [classref boost::process::v1::extend::handler] it will be regarded as an initializer and thus directly put into the sequence
the executor gets passed.
[section:structure Structure]
@@ -24,9 +24,9 @@ the executor gets passed.
The executor calls different handlers of the initializers during the process launch.
The basic structure consists of three functions, as given below:
* [globalref boost::process::extend::on_setup on_setup]
* [globalref boost::process::extend::on_error on_error]
* [globalref boost::process::extend::on_success on_success]
* [globalref boost::process::v1::extend::on_setup on_setup]
* [globalref boost::process::v1::extend::on_error on_error]
* [globalref boost::process::v1::extend::on_success on_success]
'''
<imagedata fileref="boost_process/windows_exec.svg"/>
@@ -34,11 +34,11 @@ The basic structure consists of three functions, as given below:
Additionally posix provides three more handlers, listed below:
* [globalref boost::process::extend::on_fork_error on_fork_error]
* [globalref boost::process::extend::on_exec_setup on_exec_setup]
* [globalref boost::process::extend::on_exec_error on_exec_error]
* [globalref boost::process::v1::extend::on_fork_error on_fork_error]
* [globalref boost::process::v1::extend::on_exec_setup on_exec_setup]
* [globalref boost::process::v1::extend::on_exec_error on_exec_error]
For more information see the reference of [classref boost::process::extend::posix_executor posix_executor].
For more information see the reference of [classref boost::process::v1::extend::posix_executor posix_executor].
[endsect]
[section:simple Simple extensions]
@@ -55,8 +55,8 @@ __child__ c("foo", __on_success__=[](auto & exec) {std::cout << "hello world" <<
Considering that lambdas can also capture values, data can easily be shared between handlers.
To see which members the executor has, refer to [classref boost::process::extend::windows_executor windows_executor]
and [classref boost::process::extend::posix_executor posix_executor].
To see which members the executor has, refer to [classref boost::process::v1::extend::windows_executor windows_executor]
and [classref boost::process::v1::extend::posix_executor posix_executor].
[note Combined with __on_exit__ this can also handle the process exit.]
@@ -67,7 +67,7 @@ and [classref boost::process::extend::posix_executor posix_executor].
[section:handler Handler Types]
Since the previous example is in a functional style, it is not very reusable.
To solve that problem, the [classref boost::process::extend::handler handler] has an alias in the `boost::process::extend` namespace, to be inherited.
To solve that problem, the [classref boost::process::v1::extend::handler handler] has an alias in the `boost::process::v1::extend` namespace, to be inherited.
So let's implement the hello world example in a class.
```
@@ -86,7 +86,7 @@ __child__ c("foo", hello_world());
[note The implementation is done via overloading, not overriding.]
Every handler not implemented defaults to [classref boost::process::extend::handler handler], where an empty handler is defined for each event.
Every handler not implemented defaults to [classref boost::process::v1::extend::handler handler], where an empty handler is defined for each event.
[endsect]
@@ -108,11 +108,11 @@ struct async_foo : __handler__, __require_io_context__
}
};
```
[note Inheriting [globalref boost::process::extend::require_io_context require_io_context] is necessary, so [funcref boost::process::system system] provides one.]
[note Inheriting [globalref boost::process::v1::extend::require_io_context require_io_context] is necessary, so [funcref boost::process::v1::system system] provides one.]
Additionally the handler can provide a function that is invoked when the child process exits. This is done through __async_handler__.
[note [globalref boost::process::extend::async_handler async_handler] implies [globalref boost::process::extend::require_io_context require_io_context] .]
[note [globalref boost::process::v1::extend::async_handler async_handler] implies [globalref boost::process::v1::extend::require_io_context require_io_context] .]
```
struct async_bar : __handler, __async_handler__
@@ -131,7 +131,7 @@ struct async_bar : __handler, __async_handler__
```
[caution `on_exit_handler` does not default and is always required when [classref boost::process::extend::async_handler async_handler] is inherited. ]
[caution `on_exit_handler` does not default and is always required when [classref boost::process::v1::extend::async_handler async_handler] is inherited. ]
[caution `on_exit_handler` uses `boost::asio::signal_set` to listen for SIGCHLD on posix. The application must not also register a signal handler for SIGCHLD using functions such as `signal()` or `sigaction()` (but using `boost::asio::signal_set` is fine). ]
@@ -156,7 +156,7 @@ auto set_error = [](auto & exec)
__child__ c("foo", on_setup=set_error);
```
Since we do not specify the error-handling mode in this example, this will throw [classref boost::process::process_error process_error].
Since we do not specify the error-handling mode in this example, this will throw [classref boost::process::v1::process_error process_error].
[endsect]

View File

@@ -10,10 +10,10 @@ Boost.Process is a library to manage system processes. It can be used to:
Here's a simple example of how to start a program with Boost.Process:
[def ipstream [classref boost::process::ipstream ipstream]]
[def system [funcref boost::process::system system]]
[def std_out [globalref boost::process::std_out std_out]]
[def child [globalref boost::process::child child]]
[def ipstream [classref boost::process::v1::ipstream ipstream]]
[def system [funcref boost::process::v1::system system]]
[def std_out [globalref boost::process::v1::std_out std_out]]
[def child [globalref boost::process::v1::child child]]
[def boost/process.hpp [headerref boost/process.hpp boost/process.hpp]]
[def std::string [@http://en.cppreference.com/w/cpp/string/basic_string std::string]]
[def std::getline [@http://en.cppreference.com/w/cpp/string/basic_string/getline std::getline]]

View File

@@ -1,59 +1,59 @@
<?xml version="1.0" standalone="yes"?>
<programlisting>
for (auto &amp; s : seq)
s.<methodname alt="boost::process::extend::handler::on_setup">on_setup</methodname>(*this);
s.<methodname alt="boost::process::v1::extend::handler::on_setup">on_setup</methodname>(*this);
if (<methodname alt="boost::process::extend::posix_executor::error">error</methodname>())
if (<methodname alt="boost::process::v1::extend::posix_executor::error">error</methodname>())
{
for (auto &amp; s : seq)
s.<methodname alt="boost::process::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::extend::posix_executor::error">error</methodname>());
return <classname alt="boost::process::child">child</classname>();
s.<methodname alt="boost::process::v1::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::v1::extend::posix_executor::error">error</methodname>());
return <classname alt="boost::process::v1::child">child</classname>();
}
pid = <ulink url="http://pubs.opengroup.org/onlinepubs/009695399/functions/fork.html">fork()</ulink>
<methodname alt="boost::process::extend::handler::on_setup">on_setup</methodname>(*this);
<methodname alt="boost::process::v1::extend::handler::on_setup">on_setup</methodname>(*this);
if (pid == -1) //fork error
{
<methodname alt="boost::process::extend::posix_executor::set_error">set_error</methodname>(<functionname alt="boost::process::extend::get_last_error">get_last_error</functionname>());
<methodname alt="boost::process::v1::extend::posix_executor::set_error">set_error</methodname>(<functionname alt="boost::process::v1::extend::get_last_error">get_last_error</functionname>());
for (auto &amp; s : seq)
s.<methodname alt="boost::process::extend::handler::on_fork_error">on_fork_error</methodname>(*this, <methodname alt="boost::process::extend::posix_executor::error">error</methodname>());
s.<methodname alt="boost::process::v1::extend::handler::on_fork_error">on_fork_error</methodname>(*this, <methodname alt="boost::process::v1::extend::posix_executor::error">error</methodname>());
for (auto &amp; s : seq)
s.<methodname alt="boost::process::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::extend::posix_executor::error">error</methodname>());
return <classname alt="boost::process::child">child</classname>()
s.<methodname alt="boost::process::v1::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::v1::extend::posix_executor::error">error</methodname>());
return <classname alt="boost::process::v1::child">child</classname>()
}
else if (pid == 0) //child process
{
for (auto &amp; s : seq)
s.<methodname alt="boost::process::extend::handler::on_exec_setup">on_exec_setup</methodname>(*this);
s.<methodname alt="boost::process::v1::extend::handler::on_exec_setup">on_exec_setup</methodname>(*this);
<ulink url="http://pubs.opengroup.org/onlinepubs/009695399/functions/exec.html">execve</ulink>(exe, cmd_line, env);
auto ec = <functionname alt="boost::process::extend::get_last_error">get_last_error</functionname>();
auto ec = <functionname alt="boost::process::v1::extend::get_last_error">get_last_error</functionname>();
for (auto &amp; s : seq)
s.<methodname alt="boost::process::extend::handler::on_exec_error">on_exec_error</methodname>(*this);
s.<methodname alt="boost::process::v1::extend::handler::on_exec_error">on_exec_error</methodname>(*this);
<emphasis>unspecified();</emphasis>//here the error is sent to the father process internally
<ulink url="http://en.cppreference.com/w/cpp/utility/program/exit">std::exit</ulink>(<ulink url="http://en.cppreference.com/w/c/program/EXIT_status">EXIT_FAILURE</ulink>);
return <classname alt="boost::process::child">child</classname>(); //for C++ compliance
return <classname alt="boost::process::v1::child">child</classname>(); //for C++ compliance
}
<classname alt="boost::process::child">child</classname> c(pid, exit_code);
<classname alt="boost::process::v1::child">child</classname> c(pid, exit_code);
<emphasis>unspecified();</emphasis>//here, we read the error from the child process
if (<methodname alt="boost::process::extend::posix_executor::error">error</methodname>())
if (<methodname alt="boost::process::v1::extend::posix_executor::error">error</methodname>())
for (auto &amp; s : seq)
s.<methodname alt="boost::process::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::extend::posix_executor::error">error</methodname>());
s.<methodname alt="boost::process::v1::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::v1::extend::posix_executor::error">error</methodname>());
else
for (auto &amp; s : seq)
s.<methodname alt="boost::process::extend::handler::on_error">on_success</methodname>(*this);
s.<methodname alt="boost::process::v1::extend::handler::on_error">on_success</methodname>(*this);
//now we check again, because an on_success handler might've errored.
if (<methodname alt="boost::process::extend::posix_executor::error">error</methodname>())
if (<methodname alt="boost::process::v1::extend::posix_executor::error">error</methodname>())
{
for (auto &amp; s : seq)
s.<methodname alt="boost::process::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::extend::posix_executor::error">error</methodname>());
return <classname alt="boost::process::child">child</classname>();
s.<methodname alt="boost::process::v1::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::v1::extend::posix_executor::error">error</methodname>());
return <classname alt="boost::process::v1::child">child</classname>();
}
else
return c;

View File

@@ -1,49 +1,49 @@
[def bp::system [funcref boost::process::system bp::system]]
[def bp::async_system [funcref boost::process::async_system bp::async_system]]
[def bp::spawn [funcref boost::process::spawn bp::spawn]]
[def bp::child [classref boost::process::child bp::child]]
[def bp::cmd [classref boost::process::cmd bp::cmd]]
[def bp::group [classref boost::process::group bp::group]]
[def bp::ipstream [classref boost::process::ipstream bp::ipstream]]
[def bp::opstream [classref boost::process::opstream bp::opstream]]
[def bp::pstream [classref boost::process::pstream bp::pstream]]
[def bp::pipe [classref boost::process::pipe bp::pipe]]
[def bp::async_pipe [classref boost::process::async_pipe bp::async_pipe]]
[def bp::search_path [funcref boost::process::search_path bp::search_path]]
[def bp::system [funcref boost::process::v1::system bp::system]]
[def bp::async_system [funcref boost::process::v1::async_system bp::async_system]]
[def bp::spawn [funcref boost::process::v1::spawn bp::spawn]]
[def bp::child [classref boost::process::v1::child bp::child]]
[def bp::cmd [classref boost::process::v1::cmd bp::cmd]]
[def bp::group [classref boost::process::v1::group bp::group]]
[def bp::ipstream [classref boost::process::v1::ipstream bp::ipstream]]
[def bp::opstream [classref boost::process::v1::opstream bp::opstream]]
[def bp::pstream [classref boost::process::v1::pstream bp::pstream]]
[def bp::pipe [classref boost::process::v1::pipe bp::pipe]]
[def bp::async_pipe [classref boost::process::v1::async_pipe bp::async_pipe]]
[def bp::search_path [funcref boost::process::v1::search_path bp::search_path]]
[def boost_org [@www.boost.org "www.boost.org"]]
[def std::system [@http://en.cppreference.com/w/cpp/utility/program/system std::system]]
[def child_running [memberref boost::process::child::running running]]
[def child_wait [memberref boost::process::child::wait wait]]
[def child_wait_for [memberref boost::process::child::wait_for wait_for]]
[def child_exit_code [memberref boost::process::child::exit_code exit_code]]
[def group_wait_for [memberref boost::process::group::wait_for wait_for]]
[def bp::on_exit [globalref boost::process::on_exit bp::on_exit]]
[def bp::null [globalref boost::process::null bp::null]]
[def child_terminate [memberref boost::process::child::terminate terminate]]
[def group_terminate [memberref boost::process::group::terminate terminate]]
[def group_wait [memberref boost::process::group::wait wait]]
[def bp::std_in [globalref boost::process::std_in bp::std_in]]
[def bp::std_out [globalref boost::process::std_out bp::std_out]]
[def bp::std_err [globalref boost::process::std_err bp::std_err]]
[def child_running [memberref boost::process::v1::child::running running]]
[def child_wait [memberref boost::process::v1::child::wait wait]]
[def child_wait_for [memberref boost::process::v1::child::wait_for wait_for]]
[def child_exit_code [memberref boost::process::v1::child::exit_code exit_code]]
[def group_wait_for [memberref boost::process::v1::group::wait_for wait_for]]
[def bp::on_exit [globalref boost::process::v1::on_exit bp::on_exit]]
[def bp::null [globalref boost::process::v1::null bp::null]]
[def child_terminate [memberref boost::process::v1::child::terminate terminate]]
[def group_terminate [memberref boost::process::v1::group::terminate terminate]]
[def group_wait [memberref boost::process::v1::group::wait wait]]
[def bp::std_in [globalref boost::process::v1::std_in bp::std_in]]
[def bp::std_out [globalref boost::process::v1::std_out bp::std_out]]
[def bp::std_err [globalref boost::process::v1::std_err bp::std_err]]
[def io_service [@http://www.boost.org/doc/libs/release/doc/html/boost_asio/reference/io_service.html boost::asio::io_service]]
[def asio_buffer [@http://www.boost.org/doc/libs/release/doc/html/boost_asio/reference/buffer.html boost::asio::buffer]]
[def asio_async_read [@http://www.boost.org/doc/libs/release/doc/html/boost_asio/reference/async_read.html boost::asio::async_read]]
[def bp::environment [classref boost::process::basic_environment bp::environment]]
[def bp::native_environment [classref boost::process::basic_native_environment bp::native_environment]]
[def bp::environment [classref boost::process::v1::basic_environment bp::environment]]
[def bp::native_environment [classref boost::process::v1::basic_native_environment bp::native_environment]]
[def boost::this_process::environment [funcref boost::this_process::environment boost::this_process::environment]]
[def std::chrono::seconds [@http://en.cppreference.com/w/cpp/chrono/duration std::chrono::seconds]]
[def std::vector [@http://en.cppreference.com/w/cpp/container/vector std::vector]]
[def __wait_for__ [memberref boost::process::child::wait_for wait_for]]
[def __wait_until__ [memberref boost::process::child::wait_until wait_until]]
[def __detach__ [memberref boost::process::child::detach detach]]
[def __wait_for__ [memberref boost::process::v1::child::wait_for wait_for]]
[def __wait_until__ [memberref boost::process::v1::child::wait_until wait_until]]
[def __detach__ [memberref boost::process::v1::child::detach detach]]
[def __reference__ [link process.reference reference]]
[def __concepts__ [link boost_process.concepts concepts]]
[def boost::asio::yield_context [@http://www.boost.org/doc/libs/release/doc/html/boost_asio/reference/yield_context.html boost::asio::yield_context]]
[def boost::asio::coroutine [@http://www.boost.org/doc/libs/release/doc/html/boost_asio/reference/coroutine.html boost::asio::coroutine]]
[def bp::env [globalref boost::process::env bp::env]]
[def bp::env [globalref boost::process::v1::env bp::env]]
[section:tutorial Tutorial]
@@ -82,10 +82,10 @@ int result = bp::system("/usr/bin/g++", "main.cpp");
```
With that syntax we still have "g++" hard-coded, so let's assume we get the string
from an external source as `boost::process::filesystem::path`, we can do this too.
from an external source as `boost::process::v1::filesystem::path`, we can do this too.
```
boost::process::filesystem::path p = "/usr/bin/g++"; //or get it from somewhere else.
boost::process::v1::filesystem::path p = "/usr/bin/g++"; //or get it from somewhere else.
int result = bp::system(p, "main.cpp");
```
@@ -93,28 +93,28 @@ Now we might want to find the `g++` executable in the `PATH`-variable, as the `c
`Boost.process` provides a function to this end: bp::search_path.
```
boost::process::filesystem::path p = bp::search_path("g++"); //or get it from somewhere else.
boost::process::v1::filesystem::path p = bp::search_path("g++"); //or get it from somewhere else.
int result = bp::system(p, "main.cpp");
```
[note [funcref boost::process::search_path search_path] will search for any executable with that name.
[note [funcref boost::process::v1::search_path search_path] will search for any executable with that name.
This also includes to add a file suffix on windows, such as `.exe` or `.bat`.]
[endsect]
[section:launch_mode Launch functions]
Given that our example used the [funcref boost::process::system system] function,
Given that our example used the [funcref boost::process::v1::system system] function,
our program will wait until the child process is completed. This may be unwanted,
especially since compiling can take a while.
In order to avoid that, boost.process provides several ways to launch a process.
Besides the already mentioned [funcref boost::process::system system] function and its
asynchronous version [funcref boost::process::async_system async_system],
we can also use the [funcref boost::process::spawn spawn] function or the
[classref boost::process::child child] class.
Besides the already mentioned [funcref boost::process::v1::system system] function and its
asynchronous version [funcref boost::process::v1::async_system async_system],
we can also use the [funcref boost::process::v1::spawn spawn] function or the
[classref boost::process::v1::child child] class.
The [funcref boost::process::spawn spawn] function launches a process and
The [funcref boost::process::v1::spawn spawn] function launches a process and
immediately detaches it, so no handle will be returned and the process will be ignored.
This is not what we need for compiling, but maybe we want to entertain the user,
while compiling:
@@ -124,7 +124,7 @@ bp::spawn(bp::search_path("chrome"), boost_org);
```
Now for the more sensible approach for compiling: a non-blocking execution.
To implement that, we directly call the constructor of [classref boost::process::child child].
To implement that, we directly call the constructor of [classref boost::process::v1::child child].
```
bp::child c(bp::search_path("g++"), "main.cpp");
@@ -189,9 +189,9 @@ Now, let's take a more visual example for reading data.
which reads the outline, i.e. a list of all entry points, of a binary.
Every entry point will be put into a single line, and we will use a pipe to read it.
At the end an empty line is appended, which we use as the indication to stop reading.
Boost.process provides the pipestream ([classref boost::process::ipstream ipstream],
[classref boost::process::opstream opstream], [classref boost::process::pstream pstream]) to
wrap around the [classref boost::process::pipe pipe] and provide an implementation of the
Boost.process provides the pipestream ([classref boost::process::v1::ipstream ipstream],
[classref boost::process::v1::opstream opstream], [classref boost::process::v1::pstream pstream]) to
wrap around the [classref boost::process::v1::pipe pipe] and provide an implementation of the
[@http://en.cppreference.com/w/cpp/io/basic_istream std::istream],
[@http://en.cppreference.com/w/cpp/io/basic_ostream std::ostream] and
[@http://en.cppreference.com/w/cpp/io/basic_iostream std::iostream] interface.
@@ -217,7 +217,7 @@ std::vector<std::string> read_outline(std::string & file)
What this does is redirect the `stdout` of the process into a pipe and we read this
synchronously.
[note You can do the same thing with [globalref boost::process::std_err std_err].]
[note You can do the same thing with [globalref boost::process::v1::std_err std_err].]
Now we get the name from `nm` and we might want to demangle it, so we use input and output.
`nm` has a demangle option, but for the sake of the example, we'll use
@@ -267,8 +267,8 @@ This forwards the data from `nm` to `c++filt` without your process needing to do
Boost.process allows the usage of boost.asio to implement asynchronous I/O.
If you are familiar with [@http://www.boost.org/doc/libs/release/libs/asio/ boost.asio] (which we highly recommend),
you can use [classref boost::process::async_pipe async_pipe] which is implemented
as an I/O-Object and can be used like [classref boost::process::pipe pipe] as shown above.
you can use [classref boost::process::v1::async_pipe async_pipe] which is implemented
as an I/O-Object and can be used like [classref boost::process::v1::pipe pipe] as shown above.
Now we get back to our compiling example. For `nm` we might analyze the output line by line,
but the compiler output will just be put into one large buffer.
@@ -304,7 +304,7 @@ int result = c.exit_code();
```
[note Passing an instance of io_service to the launching function automatically cause it to wait asynchronously for the exit, so no call of
[memberref boost::process::child::wait wait] is needed.]
[memberref boost::process::v1::child::wait wait] is needed.]
To make it even easier, you can use [@http://en.cppreference.com/w/cpp/thread/future std::future] for asynchronous operations
(you will still need to pass a reference to a io_service) to the launching function, unless you use bp::system or bp::async_system.
@@ -364,7 +364,7 @@ c.child_wait(); //to avoid a zombie process & get the exit code
```
Now given the example, we still call child_wait to avoid a zombie process.
An easier solution for that might be to use [funcref boost::process::spawn spawn].
An easier solution for that might be to use [funcref boost::process::v1::spawn spawn].
To put two processes into one group, the following code suffices. Spawn already
@@ -412,7 +412,7 @@ bp::system("stuff", env_);
```
A more convenient way to modify the environment for the child is the
[globalref boost::process::env env] property, which can be used in the example as following:
[globalref boost::process::v1::env env] property, which can be used in the example as following:
```
bp::system("stuff", bp::env["VALUE_1"]="foo", bp::env["VALUE_2"]+={"bar1", "bar2"});

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" standalone="yes"?>
<programlisting>
for (auto &amp; s : seq)
s.<methodname alt="boost::process::extend::handler::on_setup">on_setup</methodname>(*this);
s.<methodname alt="boost::process::v1::extend::handler::on_setup">on_setup</methodname>(*this);
if (<methodname alt="boost::process::extend::windows_executor::error">error</methodname>())
if (<methodname alt="boost::process::v1::extend::windows_executor::error">error</methodname>())
{
for (auto &amp; s : seq)
s.<methodname alt="boost::process::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::extend::windows_executor::error">error</methodname>());
return <classname alt="boost::process::child">child</classname>();
s.<methodname alt="boost::process::v1::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::v1::extend::windows_executor::error">error</methodname>());
return <classname alt="boost::process::v1::child">child</classname>();
}
int err_code = <ulink url="https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425.aspx">CreateProcess</ulink>(
exe,
@@ -20,21 +20,21 @@ int err_code = <ulink url="https://msdn.microsoft.com/en-us/library/windows/desk
startup_info,
proc_info);
<classname alt="boost::process::child">child</classname> c(proc_info, exit_code);
<classname alt="boost::process::v1::child">child</classname> c(proc_info, exit_code);
if (<methodname alt="boost::process::extend::windows_executor::error">error</methodname>())
if (<methodname alt="boost::process::v1::extend::windows_executor::error">error</methodname>())
for (auto &amp; s : seq)
s.<methodname alt="boost::process::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::extend::windows_executor::error">error</methodname>());
s.<methodname alt="boost::process::v1::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::v1::extend::windows_executor::error">error</methodname>());
else
for (auto &amp; s : seq)
s.<methodname alt="boost::process::extend::handler::on_error">on_success</methodname>(*this);
s.<methodname alt="boost::process::v1::extend::handler::on_error">on_success</methodname>(*this);
//now we check again, because an on_success handler might've errored.
if (<methodname alt="boost::process::extend::windows_executor::error">error</methodname>())
if (<methodname alt="boost::process::v1::extend::windows_executor::error">error</methodname>())
{
for (auto &amp; s : seq)
s.<methodname alt="boost::process::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::extend::windows_executor::error">error</methodname>());
return <classname alt="boost::process::child">child</classname>();
s.<methodname alt="boost::process::v1::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::v1::extend::windows_executor::error">error</methodname>());
return <classname alt="boost::process::v1::child">child</classname>();
}
else
return c;

View File

@@ -22,7 +22,7 @@ int main()
bp::std_in < bp::null //null in
);
boost::process::filesystem::path p = "input.txt";
boost::process::v1::filesystem::path p = "input.txt";
bp::system(
"test.exe",

View File

@@ -19,9 +19,9 @@ int main()
bp::start_dir="../foo"
);
boost::process::filesystem::path exe = "test.exe";
boost::process::v1::filesystem::path exe = "test.exe";
bp::system(
boost::process::filesystem::absolute(exe),
boost::process::v1::filesystem::absolute(exe),
bp::start_dir="../foo"
);
}

View File

@@ -13,16 +13,16 @@
/** \file boost/process/args.hpp
*
* This header provides the \xmlonly <globalname alt="boost::process::args">args</globalname>\endxmlonly property. It also provides the
* alternative name \xmlonly <globalname alt="boost::process::argv">argv</globalname>\endxmlonly .
* This header provides the \xmlonly <globalname alt="boost::process::v1::args">args</globalname>\endxmlonly property. It also provides the
* alternative name \xmlonly <globalname alt="boost::process::v1::argv">argv</globalname>\endxmlonly .
*
*
\xmlonly
<programlisting>
namespace boost {
namespace process {
<emphasis>unspecified</emphasis> <globalname alt="boost::process::args">args</globalname>;
<emphasis>unspecified</emphasis> <globalname alt="boost::process::argv">argv</globalname>;
namespace process { BOOST_PROCESS_V1_INLINE namespace v1 {
<emphasis>unspecified</emphasis> <globalname alt="boost::process::v1::args">args</globalname>;
<emphasis>unspecified</emphasis> <globalname alt="boost::process::v1::argv">argv</globalname>;
}
}
</programlisting>
@@ -33,7 +33,7 @@ namespace boost {
#include <boost/process/v1/detail/basic_cmd.hpp>
#include <iterator>
namespace boost { namespace process { namespace detail {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail {
struct args_
{
@@ -268,12 +268,12 @@ spawn("gcc", args+={"--version"});
*/
constexpr boost::process::detail::args_ args{};
constexpr boost::process::v1::detail::args_ args{};
///Alias for \xmlonly <globalname alt="boost::process::args">args</globalname> \endxmlonly .
constexpr boost::process::detail::args_ argv{};
///Alias for \xmlonly <globalname alt="boost::process::v1::args">args</globalname> \endxmlonly .
constexpr boost::process::v1::detail::args_ argv{};
}}
}}}
#endif

View File

@@ -17,8 +17,10 @@ into the boost::process namespace for convenience.
<programlisting>
namespace boost {
namespace process {
<emphasis>unspecified</emphasis> <ulink url="http://www.boost.org/doc/libs/1_61_0/doc/html/boost_asio/reference/buffer.html">buffer</ulink>;
<emphasis>unspecified</emphasis> <globalname alt="boost::process::on_exit">on_exit</globalname>;
namespace v1 {
<emphasis>unspecified</emphasis> <ulink url="http://www.boost.org/doc/libs/1_61_0/doc/html/boost_asio/reference/buffer.html">buffer</ulink>;
<emphasis>unspecified</emphasis> <globalname alt="boost::process::v1::on_exit">on_exit</globalname>;
}
}
}
</programlisting>
@@ -51,7 +53,7 @@ namespace boost {
#include <boost/process/v1/detail/windows/on_exit.hpp>
#endif
namespace boost { namespace process { namespace detail {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail {
struct async_tag;
@@ -122,10 +124,10 @@ chlid c2("ls", ios, on_exit=exit_code);
same restrictions as that class (do not register a handler for `SIGCHLD` except by using
`boost::asio::signal_set`).
*/
constexpr static ::boost::process::detail::on_exit_ on_exit{};
constexpr static ::boost::process::v1::detail::on_exit_ on_exit{};
#endif
}}
}}}

View File

@@ -20,7 +20,7 @@
#include <boost/process/v1/detail/windows/async_pipe.hpp>
#endif
namespace boost { namespace process {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 {
#if defined(BOOST_PROCESS_DOXYGEN)
@@ -206,11 +206,11 @@ public:
};
#else
using ::boost::process::detail::api::async_pipe;
using ::boost::process::v1::detail::api::async_pipe;
#endif
}}
}}}

View File

@@ -34,12 +34,12 @@
#endif
namespace boost {
namespace process {
namespace process { BOOST_PROCESS_V1_INLINE namespace v1 {
namespace detail
{
template<typename Handler>
struct async_system_handler : ::boost::process::detail::api::async_handler
struct async_system_handler : ::boost::process::v1::detail::api::async_handler
{
boost::asio::io_context & ios;
Handler handler;
@@ -108,7 +108,7 @@ the return value (from the second parameter, `exit_handler`).
*/
#if defined(BOOST_PROCESS_DOXYGEN)
template<typename ExitHandler, typename ...Args>
inline boost::process::detail::dummy
inline boost::process::v1::detail::dummy
async_system(boost::asio::io_context & ios, ExitHandler && exit_handler, Args && ...args);
#endif
@@ -134,7 +134,7 @@ inline BOOST_ASIO_INITFN_RESULT_TYPE(ExitHandler, void (boost::system::error_cod
async_system(boost::asio::io_context & ios, ExitHandler && exit_handler, Args && ...args)
{
typedef typename ::boost::process::detail::has_error_handler<boost::fusion::tuple<Args...>>::type
typedef typename ::boost::process::v1::detail::has_error_handler<boost::fusion::tuple<Args...>>::type
has_err_handling;
static_assert(!has_err_handling::value, "async_system cannot have custom error handling");
@@ -146,6 +146,6 @@ inline BOOST_ASIO_INITFN_RESULT_TYPE(ExitHandler, void (boost::system::error_cod
}}
#endif
}}}
#endif

View File

@@ -28,15 +28,15 @@
namespace boost {
///The main namespace of boost.process.
namespace process {
namespace process { BOOST_PROCESS_V1_INLINE namespace v1 {
template<typename ...Args>
child::child(Args&&...args)
: child(::boost::process::detail::execute_impl(std::forward<Args>(args)...)) {}
: child(::boost::process::v1::detail::execute_impl(std::forward<Args>(args)...)) {}
///Typedef for the type of an pid_t
typedef ::boost::process::detail::api::pid_t pid_t;
typedef ::boost::process::v1::detail::api::pid_t pid_t;
#if defined(BOOST_PROCESS_DOXYGEN)
/** The main class to hold a child process. It is simliar to [std::thread](http://en.cppreference.com/w/cpp/thread/thread),
@@ -149,6 +149,6 @@ class child
#endif
}}
}}}
#endif

View File

@@ -25,20 +25,20 @@
/** \file boost/process/cmd.hpp
*
* This header provides the \xmlonly <globalname alt="boost::process::cmd">cmd</globalname>\endxmlonly property.
* This header provides the \xmlonly <globalname alt="boost::process::v1::cmd">cmd</globalname>\endxmlonly property.
*
\xmlonly
<programlisting>
namespace boost {
namespace process {
<emphasis>unspecified</emphasis> <globalname alt="boost::process::cmd">cmd</globalname>;
namespace process { BOOST_PROCESS_V1_INLINE namespace v1 {
<emphasis>unspecified</emphasis> <globalname alt="boost::process::v1::cmd">cmd</globalname>;
}
}
</programlisting>
\endxmlonly
*/
namespace boost { namespace process { namespace detail {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail {
struct cmd_
@@ -47,8 +47,7 @@ struct cmd_
template<typename Char>
inline api::cmd_setter_<Char> operator()(const Char *s) const
{
return api::cmd_setter_<Char>(s);
{ return api::cmd_setter_<Char>(s);
}
template<typename Char>
inline api::cmd_setter_<Char> operator= (const Char *s) const
@@ -77,7 +76,7 @@ struct char_converter<char, api::cmd_setter_<wchar_t>>
{
static api::cmd_setter_<char> conv(const api::cmd_setter_<wchar_t> & in)
{
return { ::boost::process::detail::convert(in.str()) };
return { ::boost::process::v1::detail::convert(in.str()) };
}
};
@@ -86,7 +85,7 @@ struct char_converter<wchar_t, api::cmd_setter_<char>>
{
static api::cmd_setter_<wchar_t> conv(const api::cmd_setter_<char> & in)
{
return { ::boost::process::detail::convert(in.str()) };
return { ::boost::process::v1::detail::convert(in.str()) };
}
};
@@ -115,8 +114,8 @@ The property can only be used for assignments.
*/
constexpr static ::boost::process::detail::cmd_ cmd;
constexpr static ::boost::process::v1::detail::cmd_ cmd;
}}
}}}
#endif

View File

@@ -21,16 +21,16 @@
namespace boost {
namespace process {
namespace process { BOOST_PROCESS_V1_INLINE namespace v1 {
namespace detail {
#if defined(BOOST_POSIX_API)
using ::boost::process::detail::posix::is_async_handler;
using ::boost::process::detail::posix::does_require_io_context;
using ::boost::process::v1::detail::posix::is_async_handler;
using ::boost::process::v1::detail::posix::does_require_io_context;
#else
using ::boost::process::detail::windows::is_async_handler;
using ::boost::process::detail::windows::does_require_io_context;
using ::boost::process::v1::detail::windows::is_async_handler;
using ::boost::process::v1::detail::windows::does_require_io_context;
#endif
template<typename ...Args>
@@ -112,6 +112,7 @@ boost::asio::io_context &get_io_context_var(First&, Args&...args)
}
}
}
}
#endif /* BOOST_PROCESS_DETAIL_ASYNC_HANDLER_HPP_ */

View File

@@ -26,7 +26,7 @@
#include <iterator>
namespace boost { namespace process { namespace detail {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail {
template<typename Char>
struct exe_setter_
@@ -47,7 +47,7 @@ struct char_converter<char, exe_setter_<wchar_t>>
{
static exe_setter_<char> conv(const exe_setter_<wchar_t> & in)
{
return {::boost::process::detail::convert(in.exe_)};
return {::boost::process::v1::detail::convert(in.exe_)};
}
};
@@ -56,7 +56,7 @@ struct char_converter<wchar_t, exe_setter_<char>>
{
static exe_setter_<wchar_t> conv(const exe_setter_<char> & in)
{
return {::boost::process::detail::convert(in.exe_)};
return {::boost::process::v1::detail::convert(in.exe_)};
}
};
@@ -105,7 +105,7 @@ struct char_converter<char, arg_setter_<wchar_t, true>>
std::transform(in._args.begin(), in._args.end(), vec.begin(),
[](const std::wstring & ws)
{
return ::boost::process::detail::convert(ws);
return ::boost::process::v1::detail::convert(ws);
});
return {vec};
}
@@ -120,7 +120,7 @@ struct char_converter<wchar_t, arg_setter_<char, true>>
std::transform(in._args.begin(), in._args.end(), vec.begin(),
[](const std::string & ws)
{
return ::boost::process::detail::convert(ws);
return ::boost::process::v1::detail::convert(ws);
});
return {vec};
@@ -136,7 +136,7 @@ struct char_converter<char, arg_setter_<wchar_t, false>>
std::transform(in._args.begin(), in._args.end(), vec.begin(),
[](const std::wstring & ws)
{
return ::boost::process::detail::convert(ws);
return ::boost::process::v1::detail::convert(ws);
});
return {vec}; }
};
@@ -150,7 +150,7 @@ struct char_converter<wchar_t, arg_setter_<char, false>>
std::transform(in._args.begin(), in._args.end(), vec.begin(),
[](const std::string & ws)
{
return ::boost::process::detail::convert(ws);
return ::boost::process::v1::detail::convert(ws);
});
return {vec};
}
@@ -168,7 +168,7 @@ struct exe_builder
string_type exe;
std::vector<string_type> args;
void operator()(const boost::process::filesystem::path & data)
void operator()(const boost::process::v1::filesystem::path & data)
{
not_cmd = true;
if (exe.empty())
@@ -285,7 +285,7 @@ struct initializer_builder<cmd_or_exe_tag<wchar_t>>
typedef exe_builder<wchar_t> type;
};
}}}
}}}}

View File

@@ -38,23 +38,23 @@
#endif
namespace boost {
namespace process {
namespace process { BOOST_PROCESS_V1_INLINE namespace v1 {
using ::boost::process::detail::api::pid_t;
using ::boost::process::v1::detail::api::pid_t;
class child
{
::boost::process::detail::api::child_handle _child_handle;
std::shared_ptr<std::atomic<int>> _exit_status = std::make_shared<std::atomic<int>>(::boost::process::detail::api::still_active);
::boost::process::v1::detail::api::child_handle _child_handle;
std::shared_ptr<std::atomic<int>> _exit_status = std::make_shared<std::atomic<int>>(::boost::process::v1::detail::api::still_active);
bool _attached = true;
bool _terminated = false;
bool _exited()
{
return _terminated || !::boost::process::detail::api::is_running(_exit_status->load());
return _terminated || !::boost::process::v1::detail::api::is_running(_exit_status->load());
};
public:
typedef ::boost::process::detail::api::child_handle child_handle;
typedef ::boost::process::v1::detail::api::child_handle child_handle;
typedef child_handle::process_handle_t native_handle_t;
explicit child(child_handle &&ch, std::shared_ptr<std::atomic<int>> &ptr) : _child_handle(std::move(ch)), _exit_status(ptr) {}
explicit child(child_handle &&ch, const std::shared_ptr<std::atomic<int>> &ptr) : _child_handle(std::move(ch)), _exit_status(ptr) {}
@@ -98,7 +98,7 @@ public:
native_handle_t native_handle() const { return _child_handle.process_handle(); }
int exit_code() const {return ::boost::process::detail::api::eval_exit_status(_exit_status->load());}
int exit_code() const {return ::boost::process::v1::detail::api::eval_exit_status(_exit_status->load());}
pid_t id() const {return _child_handle.id(); }
int native_exit_code() const {return _exit_status->load();}
@@ -107,7 +107,7 @@ public:
{
std::error_code ec;
bool b = running(ec);
boost::process::detail::throw_error(ec, "running error");
boost::process::v1::detail::throw_error(ec, "running error");
return b;
}
@@ -115,14 +115,14 @@ public:
{
std::error_code ec;
terminate(ec);
boost::process::detail::throw_error(ec, "terminate error");
boost::process::v1::detail::throw_error(ec, "terminate error");
}
void wait()
{
std::error_code ec;
wait(ec);
boost::process::detail::throw_error(ec, "wait error");
boost::process::v1::detail::throw_error(ec, "wait error");
}
#if !defined(BOOST_PROCESS_NO_DEPRECATED)
@@ -133,7 +133,7 @@ public:
{
std::error_code ec;
bool b = wait_for(rel_time, ec);
boost::process::detail::throw_error(ec, "wait_for error");
boost::process::v1::detail::throw_error(ec, "wait_for error");
return b;
}
@@ -143,7 +143,7 @@ public:
{
std::error_code ec;
bool b = wait_until(timeout_time, ec);
boost::process::detail::throw_error(ec, "wait_until error");
boost::process::v1::detail::throw_error(ec, "wait_until error");
return b;
}
#endif
@@ -154,7 +154,7 @@ public:
if (valid() && !_exited() && !ec)
{
int exit_code = 0;
auto res = boost::process::detail::api::is_running(_child_handle, exit_code, ec);
auto res = boost::process::v1::detail::api::is_running(_child_handle, exit_code, ec);
if (!ec && !res && !_exited())
_exit_status->store(exit_code);
@@ -166,7 +166,7 @@ public:
void terminate(std::error_code & ec) noexcept
{
if (valid() && running(ec) && !ec)
boost::process::detail::api::terminate(_child_handle, ec);
boost::process::v1::detail::api::terminate(_child_handle, ec);
if (!ec)
_terminated = true;
@@ -177,7 +177,7 @@ public:
if (!_exited() && valid())
{
int exit_code = 0;
boost::process::detail::api::wait(_child_handle, exit_code, ec);
boost::process::v1::detail::api::wait(_child_handle, exit_code, ec);
if (!ec)
_exit_status->store(exit_code);
}
@@ -198,7 +198,7 @@ public:
if (!_exited())
{
int exit_code = 0;
auto b = boost::process::detail::api::wait_until(_child_handle, exit_code, timeout_time, ec);
auto b = boost::process::v1::detail::api::wait_until(_child_handle, exit_code, timeout_time, ec);
if (!b || ec)
return false;
_exit_status->store(exit_code);
@@ -225,6 +225,7 @@ public:
}}
}}}
#endif

View File

@@ -21,6 +21,16 @@
#include <system_error>
#include <boost/system/api_config.hpp>
#if !defined(BOOST_PROCESS_VERSION)
#define BOOST_PROCESS_VERSION 1
#endif
#if BOOST_PROCESS_VERSION == 1
#define BOOST_PROCESS_V1_INLINE inline
#else
#define BOOST_PROCESS_V1_INLINE
#endif
#include <boost/throw_exception.hpp>
#include <boost/process/v1/exception.hpp>
#include <boost/assert/source_location.hpp>
@@ -38,7 +48,9 @@ extern char **environ;
#error "System API not supported by boost.process"
#endif
namespace boost { namespace process { namespace detail
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail
{
#if !defined(BOOST_PROCESS_PIPE_SIZE)
@@ -121,5 +133,7 @@ template<> constexpr wchar_t space_sign<wchar_t> () {return L' '; }
}
}
}
}
#endif

View File

@@ -40,7 +40,7 @@
#include <type_traits>
#include <utility>
namespace boost { namespace process {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 {
class child;
@@ -228,7 +228,7 @@ inline child basic_execute_impl(Args && ... args)
boost::fusion::tuple<typename std::remove_reference<Args>::type&...> tup(args...);
auto inits = boost::fusion::filter_if<
boost::process::detail::is_initializer<
boost::process::v1::detail::is_initializer<
typename std::remove_reference<
boost::mpl::_
>::type
@@ -237,7 +237,7 @@ inline child basic_execute_impl(Args && ... args)
auto others = boost::fusion::filter_if<
boost::mpl::not_<
boost::process::detail::is_initializer<
boost::process::v1::detail::is_initializer<
typename std::remove_reference<
boost::mpl::_
>::type
@@ -250,20 +250,20 @@ inline child basic_execute_impl(Args && ... args)
//typedef typename boost::fusion::result_of::as_vector<decltype(inits)>::type inits_t;
typedef typename boost::fusion::result_of::as_vector<decltype(others)>::type others_t;
// typedef decltype(others) others_t;
typedef typename ::boost::process::detail::make_builders_from_view<
typedef typename ::boost::process::v1::detail::make_builders_from_view<
typename boost::fusion::result_of::begin<others_t>::type,
typename boost::fusion::result_of::end <others_t>::type>::type builder_t;
builder_t builders;
::boost::process::detail::builder_ref<builder_t> builder_ref(builders);
::boost::process::v1::detail::builder_ref<builder_t> builder_ref(builders);
boost::fusion::for_each(others, builder_ref);
auto other_inits = ::boost::process::detail::get_initializers(builders);
auto other_inits = ::boost::process::v1::detail::get_initializers(builders);
boost::fusion::joint_view<decltype(other_inits), decltype(inits)> complete_inits(other_inits, inits);
auto exec = boost::process::detail::api::make_executor<Char>(complete_inits);
auto exec = boost::process::v1::detail::api::make_executor<Char>(complete_inits);
return exec();
}
@@ -273,12 +273,11 @@ inline child execute_impl(Args&& ... args)
typedef required_char_type_t<Args...> req_char_type;
return basic_execute_impl<req_char_type>(
boost::process::detail::char_converter_t<req_char_type, Args>::conv(
boost::process::v1::detail::char_converter_t<req_char_type, Args>::conv(
std::forward<Args>(args))...
);
}
}}}
}}}}
#endif

View File

@@ -16,7 +16,7 @@
#endif
namespace boost { namespace process { namespace detail {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail {
//extended handler base.
typedef api::handler_base_ext handler;
@@ -68,8 +68,6 @@ private:
}}
}}}
#endif /* BOOST_PROCESS_DETAIL_HANDLER_HPP_ */

View File

@@ -11,9 +11,10 @@
#ifndef BOOST_PROCESS_DETAIL_HANDLER_BASE_HPP
#define BOOST_PROCESS_DETAIL_HANDLER_BASE_HPP
#include <boost/process/v1/detail/config.hpp>
#include <system_error>
namespace boost { namespace process { namespace detail {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail {
template<template <class> class Template>
struct make_handler_t
@@ -44,6 +45,6 @@ struct handler_base
};
}}}
}}}}
#endif

View File

@@ -17,7 +17,7 @@
#include <future>
#include <memory>
namespace boost { namespace process { namespace detail {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail {
inline std::function<void(int, const std::error_code &)> on_exit_from_future(std::future<int> &f)
{
@@ -46,8 +46,9 @@ struct on_exit_
}
constexpr static ::boost::process::detail::on_exit_ on_exit{};
constexpr static ::boost::process::v1::detail::on_exit_ on_exit{};
}}
}}}
#endif /* INCLUDE_BOOST_PROCESS_WINDOWS_ON_EXIT_HPP_ */

View File

@@ -38,7 +38,7 @@ typedef basic_stream_descriptor<any_io_executor> stream_descriptor;
} //posix
} //asio
namespace process { namespace detail { namespace posix {
namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
class async_pipe;
@@ -54,8 +54,9 @@ struct async_out_future;
} // posix
} // detail
using ::boost::process::detail::posix::async_pipe;
using ::boost::process::v1::detail::posix::async_pipe;
} // v1
} // process
} // boost

View File

@@ -10,7 +10,7 @@
#include <boost/process/v1/detail/posix/handler.hpp>
#include <type_traits>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
struct require_io_context {};
@@ -35,6 +35,6 @@ template<typename T>
struct does_require_io_context<const T&> : std::is_base_of<require_io_context, T> {};
}}}}
}}}}}
#endif /* BOOST_PROCESS_WINDOWS_ASYNC_HANDLER_HPP_ */

View File

@@ -19,13 +19,13 @@
#include <boost/process/v1/detail/used_handles.hpp>
#include <array>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
template<typename Buffer>
struct async_in_buffer : ::boost::process::detail::posix::handler_base_ext,
::boost::process::detail::posix::require_io_context,
::boost::process::detail::uses_handles
struct async_in_buffer : ::boost::process::v1::detail::posix::handler_base_ext,
::boost::process::v1::detail::posix::require_io_context,
::boost::process::v1::detail::uses_handles
{
Buffer & buf;
@@ -37,7 +37,7 @@ struct async_in_buffer : ::boost::process::detail::posix::handler_base_ext,
}
std::shared_ptr<boost::process::async_pipe> pipe;
std::shared_ptr<boost::process::v1::async_pipe> pipe;
async_in_buffer(Buffer & buf) : buf(buf)
{
@@ -81,7 +81,7 @@ struct async_in_buffer : ::boost::process::detail::posix::handler_base_ext,
void on_setup(Executor & exec)
{
if (!pipe)
pipe = std::make_shared<boost::process::async_pipe>(get_io_context(exec.seq));
pipe = std::make_shared<boost::process::v1::async_pipe>(get_io_context(exec.seq));
}
std::array<int, 3> get_used_handles()
@@ -97,7 +97,7 @@ struct async_in_buffer : ::boost::process::detail::posix::handler_base_ext,
void on_exec_setup(Executor &exec)
{
if (::dup2(pipe->native_source(), STDIN_FILENO) == -1)
exec.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
exec.set_error(::boost::process::v1::detail::get_last_error(), "dup2() failed");
if (pipe->native_source() != STDIN_FILENO)
::close(pipe->native_source());
@@ -106,6 +106,6 @@ struct async_in_buffer : ::boost::process::detail::posix::handler_base_ext,
};
}}}}
}}}}}
#endif

View File

@@ -22,7 +22,7 @@
#include <array>
#include <boost/process/v1/detail/used_handles.hpp>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
inline int apply_out_handles(int handle, std::integral_constant<int, 1>, std::integral_constant<int, -1>)
@@ -46,13 +46,13 @@ inline int apply_out_handles(int handle, std::integral_constant<int, 1>, std::in
}
template<int p1, int p2, typename Buffer>
struct async_out_buffer : ::boost::process::detail::posix::handler_base_ext,
::boost::process::detail::posix::require_io_context,
::boost::process::detail::uses_handles
struct async_out_buffer : ::boost::process::v1::detail::posix::handler_base_ext,
::boost::process::v1::detail::posix::require_io_context,
::boost::process::v1::detail::uses_handles
{
Buffer & buf;
std::shared_ptr<boost::process::async_pipe> pipe;
std::shared_ptr<boost::process::v1::async_pipe> pipe;
std::array<int, 4> get_used_handles()
{
@@ -90,7 +90,7 @@ struct async_out_buffer : ::boost::process::detail::posix::handler_base_ext,
template<typename Executor>
void on_setup(Executor & exec)
{
pipe = std::make_shared<boost::process::async_pipe>(get_io_context(exec.seq));
pipe = std::make_shared<boost::process::v1::async_pipe>(get_io_context(exec.seq));
}
@@ -100,7 +100,7 @@ struct async_out_buffer : ::boost::process::detail::posix::handler_base_ext,
int res = apply_out_handles(pipe->native_sink(),
std::integral_constant<int, p1>(), std::integral_constant<int, p2>());
if (res == -1)
exec.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
exec.set_error(::boost::process::v1::detail::get_last_error(), "dup2() failed");
::close(pipe->native_sink());
::close(pipe->native_source());
@@ -112,14 +112,14 @@ struct async_out_buffer : ::boost::process::detail::posix::handler_base_ext,
template<int p1, int p2, typename Type>
struct async_out_future : ::boost::process::detail::posix::handler_base_ext,
::boost::process::detail::posix::require_io_context
struct async_out_future : ::boost::process::v1::detail::posix::handler_base_ext,
::boost::process::v1::detail::posix::require_io_context
{
std::shared_ptr<std::promise<Type>> promise = std::make_shared<std::promise<Type>>();
std::shared_ptr<boost::asio::streambuf> buffer = std::make_shared<boost::asio::streambuf>();
std::shared_ptr<boost::process::async_pipe> pipe;
std::shared_ptr<boost::process::v1::async_pipe> pipe;
async_out_future(std::future<Type> & fut)
{
@@ -167,7 +167,7 @@ struct async_out_future : ::boost::process::detail::posix::handler_base_ext,
template<typename Executor>
void on_setup(Executor & exec)
{
pipe = std::make_shared<boost::process::async_pipe>(get_io_context(exec.seq));
pipe = std::make_shared<boost::process::v1::async_pipe>(get_io_context(exec.seq));
}
template <typename Executor>
@@ -177,7 +177,7 @@ struct async_out_future : ::boost::process::detail::posix::handler_base_ext,
int res = apply_out_handles(pipe->native_sink(),
std::integral_constant<int, p1>(), std::integral_constant<int, p2>());
if (res == -1)
exec.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
exec.set_error(::boost::process::v1::detail::get_last_error(), "dup2() failed");
::close(pipe->native_sink());
::close(pipe->native_source());
@@ -185,6 +185,6 @@ struct async_out_future : ::boost::process::detail::posix::handler_base_ext,
};
}}}}
}}}}}
#endif

View File

@@ -14,7 +14,7 @@
#include <string>
#include <utility>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
class async_pipe
{
@@ -37,7 +37,7 @@ public:
{
int fds[2];
if (::pipe(fds) == -1)
boost::process::detail::throw_last_error("pipe(2) failed");
boost::process::v1::detail::throw_last_error("pipe(2) failed");
_source.assign(fds[0]);
_sink .assign(fds[1]);
@@ -205,18 +205,18 @@ async_pipe::async_pipe(boost::asio::io_context & ios_source,
auto fifo = mkfifo(name.c_str(), 0666 );
if (fifo != 0)
boost::process::detail::throw_last_error("mkfifo() failed");
boost::process::v1::detail::throw_last_error("mkfifo() failed");
int read_fd = open(name.c_str(), O_RDWR);
if (read_fd == -1)
boost::process::detail::throw_last_error();
boost::process::v1::detail::throw_last_error();
int write_fd = dup(read_fd);
if (write_fd == -1)
boost::process::detail::throw_last_error();
boost::process::v1::detail::throw_last_error();
_source.assign(read_fd);
_sink .assign(write_fd);
@@ -236,7 +236,7 @@ async_pipe::async_pipe(const async_pipe & p) :
{
_source.assign(::dup(source_in));
if (_source.native_handle()== -1)
::boost::process::detail::throw_last_error("dup()");
::boost::process::v1::detail::throw_last_error("dup()");
}
if (sink_in == -1)
@@ -245,7 +245,7 @@ async_pipe::async_pipe(const async_pipe & p) :
{
_sink.assign(::dup(sink_in));
if (_sink.native_handle() == -1)
::boost::process::detail::throw_last_error("dup()");
::boost::process::v1::detail::throw_last_error("dup()");
}
}
@@ -263,7 +263,7 @@ async_pipe& async_pipe::operator=(const async_pipe & p)
{
source = ::dup(source_in);
if (source == -1)
::boost::process::detail::throw_last_error("dup()");
::boost::process::v1::detail::throw_last_error("dup()");
}
if (sink_in == -1)
@@ -272,7 +272,7 @@ async_pipe& async_pipe::operator=(const async_pipe & p)
{
sink = ::dup(sink_in);
if (sink == -1)
::boost::process::detail::throw_last_error("dup()");
::boost::process::v1::detail::throw_last_error("dup()");
}
_source.assign(source);
_sink. assign(sink);
@@ -304,7 +304,7 @@ async_pipe::operator basic_pipe<CharT, Traits>() const
{
source = ::dup(source_in);
if (source == -1)
::boost::process::detail::throw_last_error("dup()");
::boost::process::v1::detail::throw_last_error("dup()");
}
if (sink_in == -1)
@@ -313,7 +313,7 @@ async_pipe::operator basic_pipe<CharT, Traits>() const
{
sink = ::dup(sink_in);
if (sink == -1)
::boost::process::detail::throw_last_error("dup()");
::boost::process::v1::detail::throw_last_error("dup()");
}
return basic_pipe<CharT, Traits>{source, sink};
@@ -360,6 +360,6 @@ inline bool operator!=(const basic_pipe<Char, Traits> & lhs, const async_pipe &
!compare_handles(lhs.native_sink(), rhs.native_sink());
}
}}}}
}}}}}
#endif /* INCLUDE_BOOST_PIPE_DETAIL_WINDOWS_ASYNC_PIPE_HPP_ */

View File

@@ -7,6 +7,7 @@
#ifndef BOOST_PROCESS_DETAIL_POSIX_BASIC_CMD_HPP_
#define BOOST_PROCESS_DETAIL_POSIX_BASIC_CMD_HPP_
#include <boost/process/v1/detail/config.hpp>
#include <boost/process/v1/detail/posix/handler.hpp>
#include <boost/process/v1/detail/posix/cmd.hpp>
#include <boost/algorithm/string/replace.hpp>
@@ -20,12 +21,13 @@ namespace boost
{
namespace process
{
BOOST_PROCESS_V1_INLINE namespace v1
{
namespace detail
{
namespace posix
{
inline std::string build_cmd_shell(const std::string & exe, std::vector<std::string> && data)
{
std::string st = exe;
@@ -101,7 +103,7 @@ template<typename Char>
struct exe_cmd_init;
template<>
struct exe_cmd_init<char> : boost::process::detail::api::handler_base_ext
struct exe_cmd_init<char> : boost::process::v1::detail::api::handler_base_ext
{
exe_cmd_init(const exe_cmd_init & ) = delete;
exe_cmd_init(exe_cmd_init && ) = default;
@@ -175,6 +177,6 @@ std::vector<char*> exe_cmd_init<char>::make_cmd()
}
}}}}
}}}}}
#endif

View File

@@ -19,7 +19,7 @@
#include <fcntl.h>
#include <memory>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
template<class CharT, class Traits = std::char_traits<CharT>>
@@ -41,7 +41,7 @@ public:
{
int fds[2];
if (::pipe(fds) == -1)
boost::process::detail::throw_last_error("pipe(2) failed");
boost::process::v1::detail::throw_last_error("pipe(2) failed");
_source = fds[0];
_sink = fds[1];
@@ -85,7 +85,7 @@ public:
//Try again if interrupted
auto err = errno;
if (err != EINTR)
::boost::process::detail::throw_last_error();
::boost::process::v1::detail::throw_last_error();
}
return static_cast<int_type>(write_len);
}
@@ -97,7 +97,7 @@ public:
//Try again if interrupted
auto err = errno;
if (err != EINTR)
::boost::process::detail::throw_last_error();
::boost::process::v1::detail::throw_last_error();
}
return static_cast<int_type>(read_len);
}
@@ -126,13 +126,13 @@ basic_pipe<CharT, Traits>::basic_pipe(const basic_pipe & rhs)
{
_source = ::dup(rhs._source);
if (_source == -1)
::boost::process::detail::throw_last_error("dup() failed");
::boost::process::v1::detail::throw_last_error("dup() failed");
}
if (rhs._sink != -1)
{
_sink = ::dup(rhs._sink);
if (_sink == -1)
::boost::process::detail::throw_last_error("dup() failed");
::boost::process::v1::detail::throw_last_error("dup() failed");
}
}
@@ -144,13 +144,13 @@ basic_pipe<CharT, Traits> &basic_pipe<CharT, Traits>::operator=(const basic_pipe
{
_source = ::dup(rhs._source);
if (_source == -1)
::boost::process::detail::throw_last_error("dup() failed");
::boost::process::v1::detail::throw_last_error("dup() failed");
}
if (rhs._sink != -1)
{
_sink = ::dup(rhs._sink);
if (_sink == -1)
::boost::process::detail::throw_last_error("dup() failed");
::boost::process::v1::detail::throw_last_error("dup() failed");
}
return *this;
@@ -163,18 +163,18 @@ basic_pipe<CharT, Traits>::basic_pipe(const std::string & name)
auto fifo = mkfifo(name.c_str(), 0666 );
if (fifo != 0)
boost::process::detail::throw_last_error("mkfifo() failed");
boost::process::v1::detail::throw_last_error("mkfifo() failed");
int read_fd = open(name.c_str(), O_RDWR);
if (read_fd == -1)
boost::process::detail::throw_last_error();
boost::process::v1::detail::throw_last_error();
int write_fd = dup(read_fd);
if (write_fd == -1)
boost::process::detail::throw_last_error();
boost::process::v1::detail::throw_last_error();
_sink = write_fd;
_source = read_fd;
@@ -195,6 +195,6 @@ inline bool operator!=(const basic_pipe<Char, Traits> & lhs, const basic_pipe<Ch
!compare_handles(lhs.native_sink(), rhs.native_sink());
}
}}}}
}}}}}
#endif

View File

@@ -13,7 +13,7 @@
#include <utility>
#include <system_error>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
typedef ::pid_t pid_t;
@@ -55,6 +55,6 @@ struct child_handle
}
};
}}}}
}}}}}
#endif

View File

@@ -14,21 +14,21 @@
#include <boost/process/v1/detail/posix/handler.hpp>
#include <boost/process/v1/detail/used_handles.hpp>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
struct close_in : handler_base_ext, ::boost::process::detail::uses_handles
struct close_in : handler_base_ext, ::boost::process::v1::detail::uses_handles
{
template <class Executor>
void on_exec_setup(Executor &e) const
{
if (::close(STDIN_FILENO) == -1)
e.set_error(::boost::process::detail::get_last_error(), "close() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "close() failed");
}
int get_used_handles() {return STDIN_FILENO;}
};
}}}}
}}}}}
#endif

View File

@@ -14,7 +14,7 @@
#include <boost/process/v1/detail/posix/handler.hpp>
#include <array>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
template<int p1, int p2>
struct close_out : handler_base_ext
@@ -30,7 +30,7 @@ template<typename Executor>
void close_out<1,-1>::on_exec_setup(Executor &e) const
{
if (::close(STDOUT_FILENO) == -1)
e.set_error(::boost::process::detail::get_last_error(), "close() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "close() failed");
}
@@ -39,7 +39,7 @@ template<typename Executor>
void close_out<2,-1>::on_exec_setup(Executor &e) const
{
if (::close(STDERR_FILENO) == -1)
e.set_error(::boost::process::detail::get_last_error(), "close() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "close() failed");
}
template<>
@@ -47,12 +47,12 @@ template<typename Executor>
void close_out<1,2>::on_exec_setup(Executor &e) const
{
if (::close(STDOUT_FILENO) == -1)
e.set_error(::boost::process::detail::get_last_error(), "close() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "close() failed");
if (::close(STDERR_FILENO) == -1)
e.set_error(::boost::process::detail::get_last_error(), "close() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "close() failed");
}
}}}}
}}}}}
#endif

View File

@@ -16,6 +16,8 @@ namespace boost
{
namespace process
{
BOOST_PROCESS_V1_INLINE namespace v1
{
namespace detail
{
namespace posix
@@ -99,6 +101,6 @@ std::vector<Char*> cmd_setter_<Char>::make_cmd(std::vector<std::basic_string<Cha
return vec;
}
}}}}
}}}}}
#endif

View File

@@ -12,7 +12,7 @@
#include <sys/stat.h>
#include <unistd.h>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
inline bool compare_handles(int lhs, int rhs)
@@ -25,8 +25,8 @@ inline bool compare_handles(int lhs, int rhs)
return true;
struct stat stat1, stat2;
if(fstat(lhs, &stat1) < 0) ::boost::process::detail::throw_last_error("fstat() failed");
if(fstat(rhs, &stat2) < 0) ::boost::process::detail::throw_last_error("fstat() failed");
if(fstat(lhs, &stat1) < 0) ::boost::process::v1::detail::throw_last_error("fstat() failed");
if(fstat(rhs, &stat2) < 0) ::boost::process::v1::detail::throw_last_error("fstat() failed");
return (stat1.st_dev == stat2.st_dev) && (stat1.st_ino == stat2.st_ino);
}
@@ -35,7 +35,7 @@ inline bool compare_handles(int lhs, int rhs)
}}}}
}}}}}

View File

@@ -12,7 +12,7 @@
#include <boost/process/v1/detail/posix/handler.hpp>
#include <boost/process/v1/environment.hpp>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
template<typename Char>
struct env_init;
@@ -20,10 +20,10 @@ struct env_init;
template<>
struct env_init<char> : handler_base_ext
{
boost::process::environment env;
boost::process::v1::environment env;
env_init(boost::process::environment && env) : env(std::move(env)) {};
env_init(const boost::process::environment & env) : env(env) {};
env_init(boost::process::v1::environment && env) : env(std::move(env)) {};
env_init(const boost::process::v1::environment & env) : env(env) {};
template <class Executor>
@@ -34,7 +34,7 @@ struct env_init<char> : handler_base_ext
};
}}}}
}}}}}

View File

@@ -15,7 +15,7 @@
#include <boost/process/v1/locale.hpp>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
template<typename Char>
class native_environment_impl
@@ -27,7 +27,7 @@ class native_environment_impl
while (*p != nullptr)
{
std::string str = *p;
val.push_back(::boost::process::detail::convert(str));
val.push_back(::boost::process::v1::detail::convert(str));
p++;
}
return val;
@@ -68,24 +68,24 @@ public:
string_type get(const string_type & id)
{
std::string id_c = ::boost::process::detail::convert(id);
std::string id_c = ::boost::process::v1::detail::convert(id);
std::string g = ::getenv(id_c.c_str());
return ::boost::process::detail::convert(g.c_str());
return ::boost::process::v1::detail::convert(g.c_str());
}
void set(const string_type & id, const string_type & value)
{
std::string id_c = ::boost::process::detail::convert(id.c_str());
std::string value_c = ::boost::process::detail::convert(value.c_str());
std::string id_c = ::boost::process::v1::detail::convert(id.c_str());
std::string value_c = ::boost::process::v1::detail::convert(value.c_str());
auto res = ::setenv(id_c.c_str(), value_c.c_str(), true);
if (res != 0)
boost::process::detail::throw_last_error();
boost::process::v1::detail::throw_last_error();
}
void reset(const string_type & id)
{
std::string id_c = ::boost::process::detail::convert(id.c_str());
std::string id_c = ::boost::process::v1::detail::convert(id.c_str());
auto res = ::unsetenv(id_c.c_str());
if (res != 0)
::boost::process::detail::throw_last_error();
::boost::process::v1::detail::throw_last_error();
}
native_environment_impl() = default;
@@ -114,14 +114,14 @@ public:
{
auto res = ::setenv(id, value, 1);
if (res != 0)
boost::process::detail::throw_last_error();
boost::process::v1::detail::throw_last_error();
reload();
}
void reset(const pointer_type id)
{
auto res = ::unsetenv(id);
if (res != 0)
boost::process::detail::throw_last_error();
boost::process::v1::detail::throw_last_error();
reload();
}
@@ -186,13 +186,13 @@ public:
template<typename CharR>
explicit inline basic_environment_impl(
const basic_environment_impl<CharR>& rhs,
const ::boost::process::codecvt_type & cv = ::boost::process::codecvt())
const ::boost::process::v1::codecvt_type & cv = ::boost::process::v1::codecvt())
: _data(rhs._data.size())
{
std::transform(rhs._data.begin(), rhs._data.end(), _data.begin(),
[&](const std::basic_string<CharR> & st)
{
return ::boost::process::detail::convert(st, cv);
return ::boost::process::v1::detail::convert(st, cv);
}
);
@@ -202,7 +202,7 @@ public:
template<typename CharR>
basic_environment_impl & operator=(const basic_environment_impl<CharR>& rhs)
{
_data = ::boost::process::detail::convert(rhs._data);
_data = ::boost::process::v1::detail::convert(rhs._data);
_env_arr = _load_var(&*_data.begin());
_env_impl = &*_env_arr.begin();
return *this;
@@ -230,7 +230,7 @@ basic_environment_impl<Char>::basic_environment_impl(const native_environment_im
template<typename Char>
inline auto basic_environment_impl<Char>::get(const string_type &id) -> string_type
{
auto itr = std::find_if(_data.begin(), _data.end(),
auto itr = std::find_if(_data.begin(), _data.end(),
[&](const string_type & st) -> bool
{
if (st.size() <= id.size())
@@ -250,7 +250,7 @@ inline auto basic_environment_impl<Char>::get(const string_type &id) -> string_t
template<typename Char>
inline void basic_environment_impl<Char>::set(const string_type &id, const string_type &value)
{
auto itr = std::find_if(_data.begin(), _data.end(),
auto itr = std::find_if(_data.begin(), _data.end(),
[&](const string_type & st) -> bool
{
if (st.size() <= id.size())
@@ -261,7 +261,7 @@ inline void basic_environment_impl<Char>::set(const string_type &id, const strin
if (itr != _data.end())
*itr = id + equal_sign<Char>() + value;
else
else
_data.push_back(id + equal_sign<Char>() + value);
reload();
@@ -270,7 +270,7 @@ inline void basic_environment_impl<Char>::set(const string_type &id, const strin
template<typename Char>
inline void basic_environment_impl<Char>::reset(const string_type &id)
{
auto itr = std::find_if(_data.begin(), _data.end(),
auto itr = std::find_if(_data.begin(), _data.end(),
[&](const string_type & st) -> bool
{
if (st.size() <= id.size())
@@ -280,9 +280,9 @@ inline void basic_environment_impl<Char>::reset(const string_type &id)
);
if (itr != _data.end())
{
_data.erase(itr);//and remove it
_data.erase(itr);//and remove it
}
reload();
@@ -320,7 +320,7 @@ inline int native_handle() {return getpid(); }
}
}
}
}

View File

@@ -7,11 +7,14 @@
#ifndef BOOST_PROCESS_DETAIL_POSIX_EXE_HPP_
#define BOOST_PROCESS_DETAIL_POSIX_EXE_HPP_
#include <boost/process/v1/detail/config.hpp>
namespace boost
{
namespace process
{
BOOST_PROCESS_V1_INLINE namespace v1
{
namespace detail
{
namespace posix
@@ -30,7 +33,7 @@ inline void apply_exe(const StringType & exe, Executor & e)
}
}
}
}
#endif /* INCLUDE_BOOST_PROCESS_WINDOWS_ARGS_HPP_ */

View File

@@ -28,7 +28,7 @@
#include <boost/core/ignore_unused.hpp>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
template<typename Executor>
struct on_setup_t
@@ -204,9 +204,9 @@ class executor
throw process_error(_ec, _msg);
}
typedef typename ::boost::process::detail::has_error_handler<Sequence>::type has_error_handler;
typedef typename ::boost::process::detail::has_ignore_error <Sequence>::type has_ignore_error;
typedef typename ::boost::process::detail::posix::shall_use_vfork<Sequence>::type shall_use_vfork;
typedef typename ::boost::process::v1::detail::has_error_handler<Sequence>::type has_error_handler;
typedef typename ::boost::process::v1::detail::has_ignore_error <Sequence>::type has_ignore_error;
typedef typename ::boost::process::v1::detail::posix::shall_use_vfork<Sequence>::type shall_use_vfork;
inline child invoke(boost::mpl::true_ , boost::mpl::true_ );
inline child invoke(boost::mpl::false_, boost::mpl::true_ );
@@ -349,7 +349,7 @@ child executor<Sequence>::invoke(boost::mpl::true_, boost::mpl::false_) //ignore
this->pid = ::fork();
if (pid == -1)
{
auto ec = boost::process::detail::get_last_error();
auto ec = boost::process::v1::detail::get_last_error();
boost::fusion::for_each(seq, call_on_fork_error(*this, ec));
return child();
}
@@ -357,7 +357,7 @@ child executor<Sequence>::invoke(boost::mpl::true_, boost::mpl::false_) //ignore
{
boost::fusion::for_each(seq, call_on_exec_setup(*this));
::execve(exe, cmd_line, env);
auto ec = boost::process::detail::get_last_error();
auto ec = boost::process::v1::detail::get_last_error();
boost::fusion::for_each(seq, call_on_exec_error(*this, ec));
_exit(EXIT_FAILURE);
}
@@ -389,12 +389,12 @@ child executor<Sequence>::invoke(boost::mpl::false_, boost::mpl::false_)
if (::pipe(p.p) == -1)
{
set_error(::boost::process::detail::get_last_error(), "pipe(2) failed");
set_error(::boost::process::v1::detail::get_last_error(), "pipe(2) failed");
return child();
}
if (::fcntl(p.p[1], F_SETFD, FD_CLOEXEC) == -1)
{
auto err = ::boost::process::detail::get_last_error();
auto err = ::boost::process::v1::detail::get_last_error();
set_error(err, "fcntl(2) failed");//this might throw, so we need to be sure our pipe is safe.
return child();
}
@@ -417,7 +417,7 @@ child executor<Sequence>::invoke(boost::mpl::false_, boost::mpl::false_)
this->pid = ::fork();
if (pid == -1)
{
_ec = boost::process::detail::get_last_error();
_ec = boost::process::v1::detail::get_last_error();
_msg = "fork() failed";
boost::fusion::for_each(seq, call_on_fork_error(*this, _ec));
boost::fusion::for_each(seq, call_on_error(*this, _ec));
@@ -430,7 +430,7 @@ child executor<Sequence>::invoke(boost::mpl::false_, boost::mpl::false_)
boost::fusion::for_each(seq, call_on_exec_setup(*this));
::execve(exe, cmd_line, env);
_ec = boost::process::detail::get_last_error();
_ec = boost::process::v1::detail::get_last_error();
_msg = "execve failed";
boost::fusion::for_each(seq, call_on_exec_error(*this, _ec));
@@ -480,7 +480,7 @@ child executor<Sequence>::invoke(boost::mpl::true_, boost::mpl::true_) //ignore
this->pid = ::vfork();
if (pid == -1)
{
auto ec = boost::process::detail::get_last_error();
auto ec = boost::process::v1::detail::get_last_error();
boost::fusion::for_each(seq, call_on_fork_error(*this, ec));
return child();
}
@@ -488,7 +488,7 @@ child executor<Sequence>::invoke(boost::mpl::true_, boost::mpl::true_) //ignore
{
boost::fusion::for_each(seq, call_on_exec_setup(*this));
::execve(exe, cmd_line, env);
auto ec = boost::process::detail::get_last_error();
auto ec = boost::process::v1::detail::get_last_error();
boost::fusion::for_each(seq, call_on_exec_error(*this, ec));
_exit(EXIT_FAILURE);
}
@@ -516,7 +516,7 @@ child executor<Sequence>::invoke(boost::mpl::false_, boost::mpl::true_)
this->pid = ::vfork();
if (pid == -1)
{
_ec = boost::process::detail::get_last_error();
_ec = boost::process::v1::detail::get_last_error();
_msg = "fork() failed";
boost::fusion::for_each(seq, call_on_fork_error(*this, _ec));
boost::fusion::for_each(seq, call_on_error(*this, _ec));
@@ -529,7 +529,7 @@ child executor<Sequence>::invoke(boost::mpl::false_, boost::mpl::true_)
::execve(exe, cmd_line, env);
_ec = boost::process::detail::get_last_error();
_ec = boost::process::v1::detail::get_last_error();
_msg = "execve failed";
boost::fusion::for_each(seq, call_on_exec_error(*this, _ec));
@@ -568,6 +568,6 @@ inline executor<Tup> make_executor(Tup & tup)
return executor<Tup>(tup);
}
}}}}
}}}}}
#endif

View File

@@ -15,10 +15,10 @@
#include <boost/process/v1/detail/used_handles.hpp>
#include <array>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
struct close_fd_ : handler_base_ext, ::boost::process::detail::uses_handles
struct close_fd_ : handler_base_ext, ::boost::process::v1::detail::uses_handles
{
close_fd_(int fd) : fd_(fd) {}
@@ -26,7 +26,7 @@ struct close_fd_ : handler_base_ext, ::boost::process::detail::uses_handles
void on_exec_setup(PosixExecutor& e) const
{
if (::close(fd_) == -1)
e.set_error(::boost::process::detail::get_last_error(), "close() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "close() failed");
}
int get_used_handles() {return fd_;}
@@ -37,7 +37,7 @@ private:
};
template <class Range>
struct close_fds_ : handler_base_ext, ::boost::process::detail::uses_handles
struct close_fds_ : handler_base_ext, ::boost::process::v1::detail::uses_handles
{
public:
close_fds_(const Range &fds) : fds_(fds) {}
@@ -48,7 +48,7 @@ public:
for (auto & fd_ : fds_)
if (::close(fd_) == -1)
{
e.set_error(::boost::process::detail::get_last_error(), "close() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "close() failed");
break;
}
}
@@ -62,7 +62,7 @@ private:
template <class FileDescriptor>
struct bind_fd_ : handler_base_ext, ::boost::process::detail::uses_handles
struct bind_fd_ : handler_base_ext, ::boost::process::v1::detail::uses_handles
{
public:
bind_fd_(int id, const FileDescriptor &fd) : id_(id), fd_(fd) {}
@@ -71,7 +71,7 @@ public:
void on_exec_setup(PosixExecutor& e) const
{
if (::dup2(fd_, id_) == -1)
e.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "dup2() failed");
}
std::array<int, 2> get_used_handles() {return {id_, fd_};}
@@ -97,6 +97,6 @@ struct fd_
};
}}}}
}}}}}
#endif

View File

@@ -11,7 +11,7 @@
#include <boost/process/v1/filesystem.hpp>
#include <boost/core/exchange.hpp>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
struct file_descriptor
{
@@ -24,7 +24,7 @@ struct file_descriptor
file_descriptor() = default;
explicit file_descriptor(const boost::process::filesystem::path& p, mode_t mode = read_write)
explicit file_descriptor(const boost::process::v1::filesystem::path& p, mode_t mode = read_write)
: file_descriptor(p.native(), mode)
{
}
@@ -84,6 +84,6 @@ private:
int _handle = -1;
};
}}}}
}}}}}
#endif /* BOOST_PROCESS_DETAIL_WINDOWS_FILE_DESCRIPTOR_HPP_ */

View File

@@ -17,9 +17,9 @@
#include <cstdio>
#include <unistd.h>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
struct file_in : handler_base_ext, ::boost::process::detail::uses_handles
struct file_in : handler_base_ext, ::boost::process::v1::detail::uses_handles
{
file_descriptor file;
int handle = file.handle();
@@ -37,10 +37,10 @@ struct file_in : handler_base_ext, ::boost::process::detail::uses_handles
void on_exec_setup(WindowsExecutor &e) const
{
if (::dup2(handle, STDIN_FILENO) == -1)
e.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "dup2() failed");
}
};
}}}}
}}}}}
#endif

View File

@@ -16,10 +16,10 @@
#include <boost/process/v1/detail/used_handles.hpp>
#include <unistd.h>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
template<int p1, int p2>
struct file_out : handler_base_ext, ::boost::process::detail::uses_handles
struct file_out : handler_base_ext, ::boost::process::v1::detail::uses_handles
{
file_descriptor file;
int handle = file.handle();
@@ -45,7 +45,7 @@ template<typename Executor>
void file_out<1,-1>::on_exec_setup(Executor &e) const
{
if (::dup2(handle, STDOUT_FILENO) == -1)
e.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "dup2() failed");
}
template<>
@@ -53,7 +53,7 @@ template<typename Executor>
void file_out<2,-1>::on_exec_setup(Executor &e) const
{
if (::dup2(handle, STDERR_FILENO) == -1)
e.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "dup2() failed");
}
template<>
@@ -61,13 +61,13 @@ template<typename Executor>
void file_out<1,2>::on_exec_setup(Executor &e) const
{
if (::dup2(handle, STDOUT_FILENO) == -1)
e.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "dup2() failed");
if (::dup2(handle, STDERR_FILENO) == -1)
e.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "dup2() failed");
}
}}}}
}}}}}
#endif

View File

@@ -11,7 +11,7 @@
#include <system_error>
#include <unistd.h>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
struct group_handle
{
@@ -70,7 +70,7 @@ struct group_handle
inline void terminate(group_handle &p, std::error_code &ec) noexcept
{
if (::killpg(p.grp, SIGKILL) == -1)
ec = boost::process::detail::get_last_error();
ec = boost::process::v1::detail::get_last_error();
else
ec.clear();
@@ -81,7 +81,7 @@ inline void terminate(group_handle &p)
{
std::error_code ec;
terminate(p, ec);
boost::process::detail::throw_error(ec, "killpg(2) failed in terminate");
boost::process::v1::detail::throw_error(ec, "killpg(2) failed in terminate");
}
inline bool in_group()
@@ -89,6 +89,6 @@ inline bool in_group()
return true;
}
}}}}
}}}}}
#endif /* BOOST_PROCESS_DETAIL_WINDOWS_GROUP_HPP_ */

View File

@@ -12,7 +12,7 @@
#include <unistd.h>
namespace boost { namespace process {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 {
namespace detail { namespace posix {
@@ -46,7 +46,7 @@ struct group_ref : handler_base_ext
};
}}}}
}}}}}
#endif /* BOOST_PROCESS_DETAIL_POSIX_GROUP_REF_HPP_ */

View File

@@ -8,7 +8,7 @@
#include <boost/process/v1/detail/handler_base.hpp>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
//does not extend anything.
struct handler_base_ext : handler_base
@@ -67,7 +67,7 @@ private:
Handler handler_;
};
}}}}
}}}}}

View File

@@ -15,7 +15,7 @@
#include <cstdlib>
#include <boost/process/v1/detail/posix/handler.hpp>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
using native_handle_type = int;
@@ -27,7 +27,7 @@ inline std::vector<native_handle_type> get_handles(std::error_code & ec)
std::unique_ptr<DIR, void(*)(DIR*)> dir{::opendir("/dev/fd"), +[](DIR* p){::closedir(p);}};
if (!dir)
{
ec = ::boost::process::detail::get_last_error();
ec = ::boost::process::v1::detail::get_last_error();
return {};
}
else
@@ -60,7 +60,7 @@ inline std::vector<native_handle_type> get_handles()
auto res = get_handles(ec);
if (ec)
boost::process::detail::throw_error(ec, "open_dir(\"/dev/fd\") failed");
boost::process::v1::detail::throw_error(ec, "open_dir(\"/dev/fd\") failed");
return res;
}
@@ -72,7 +72,7 @@ inline bool is_stream_handle(native_handle_type handle, std::error_code & ec)
if (::fstat(handle, &stat_) != 0)
{
ec = ::boost::process::detail::get_last_error();
ec = ::boost::process::v1::detail::get_last_error();
}
else
ec.clear();
@@ -90,7 +90,7 @@ inline bool is_stream_handle(native_handle_type handle)
std::error_code ec;
auto res = is_stream_handle(handle, ec);
if (ec)
boost::process::detail::throw_error(ec, "fstat() failed");
boost::process::v1::detail::throw_error(ec, "fstat() failed");
return res;
}
@@ -113,7 +113,7 @@ struct limit_handles_ : handler_base_ext
auto dir = ::opendir("/dev/fd");
if (!dir)
{
exec.set_error(::boost::process::detail::get_last_error(), "opendir(\"/dev/fd\")");
exec.set_error(::boost::process::v1::detail::get_last_error(), "opendir(\"/dev/fd\")");
return;
}
@@ -135,7 +135,7 @@ struct limit_handles_ : handler_base_ext
if (::close(conv) != 0)
{
exec.set_error(::boost::process::detail::get_last_error(), "close() failed");
exec.set_error(::boost::process::v1::detail::get_last_error(), "close() failed");
return;
}
}
@@ -143,6 +143,6 @@ struct limit_handles_ : handler_base_ext
}
};
}}}}
}}}}}
#endif //PROCESS_HANDLES_HPP

View File

@@ -26,7 +26,7 @@
#include <vector>
#include <sys/wait.h>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
template<typename Executor>
struct on_exit_handler_transformer
@@ -100,7 +100,7 @@ struct io_context_ref : handler_base_ext
{
es->store(val);
for (auto & func : funcs)
func(::boost::process::detail::posix::eval_exit_status(val), ec);
func(::boost::process::v1::detail::posix::eval_exit_status(val), ec);
};
sigchld_service.async_wait(exec.pid, std::move(wh));
@@ -117,9 +117,9 @@ struct io_context_ref : handler_base_ext
private:
boost::asio::io_context &ios;
boost::process::detail::posix::sigchld_service &sigchld_service = boost::asio::use_service<boost::process::detail::posix::sigchld_service>(ios);
boost::process::v1::detail::posix::sigchld_service &sigchld_service = boost::asio::use_service<boost::process::v1::detail::posix::sigchld_service>(ios);
};
}}}}
}}}}}
#endif /* BOOST_PROCESS_WINDOWS_IO_CONTEXT_REF_HPP_ */

View File

@@ -11,7 +11,7 @@
#include <system_error>
#include <sys/wait.h>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
// Use the "stopped" state (WIFSTOPPED) to indicate "not terminated".
// This bit arrangement of status codes is not guaranteed by POSIX, but (according to comments in
@@ -35,7 +35,7 @@ inline bool is_running(const child_handle &p, int & exit_code, std::error_code &
if (ret == -1)
{
if (errno != ECHILD) //because it no child is running, then this one isn't either, obviously.
ec = ::boost::process::detail::get_last_error();
ec = ::boost::process::v1::detail::get_last_error();
return false;
}
else if (ret == 0)
@@ -55,7 +55,7 @@ inline bool is_running(const child_handle &p, int & exit_code)
{
std::error_code ec;
bool b = is_running(p, exit_code, ec);
boost::process::detail::throw_error(ec, "waitpid(2) failed in is_running");
boost::process::v1::detail::throw_error(ec, "waitpid(2) failed in is_running");
return b;
}
@@ -75,6 +75,6 @@ inline int eval_exit_status(int code)
}
}
}}}}
}}}}}
#endif

View File

@@ -17,9 +17,9 @@
#include <boost/process/v1/detail/used_handles.hpp>
#include <array>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
struct null_in : handler_base_ext, ::boost::process::detail::uses_handles
struct null_in : handler_base_ext, ::boost::process::v1::detail::uses_handles
{
file_descriptor source{"/dev/null", file_descriptor::read};
@@ -34,10 +34,10 @@ public:
void on_exec_setup(Executor &e) const
{
if (::dup2(source.handle(), STDIN_FILENO) == -1)
e.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "dup2() failed");
}
};
}}}}
}}}}}
#endif

View File

@@ -17,10 +17,10 @@
#include <unistd.h>
#include <array>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
template<int p1, int p2>
struct null_out : handler_base_ext, ::boost::process::detail::uses_handles
struct null_out : handler_base_ext, ::boost::process::v1::detail::uses_handles
{
file_descriptor sink{"/dev/null", file_descriptor::write};
@@ -41,7 +41,7 @@ template<typename Executor>
void null_out<1,-1>::on_exec_setup(Executor &e) const
{
if (::dup2(sink.handle(), STDOUT_FILENO) == -1)
e.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "dup2() failed");
}
template<>
@@ -49,7 +49,7 @@ template<typename Executor>
void null_out<2,-1>::on_exec_setup(Executor &e) const
{
if (::dup2(sink.handle(), STDERR_FILENO) == -1)
e.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "dup2() failed");
}
template<>
@@ -57,12 +57,12 @@ template<typename Executor>
void null_out<1,2>::on_exec_setup(Executor &e) const
{
if (::dup2(sink.handle(), STDOUT_FILENO) == -1)
e.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "dup2() failed");
if (::dup2(sink.handle(), STDERR_FILENO) == -1)
e.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "dup2() failed");
}
}}}}
}}}}}
#endif

View File

@@ -14,14 +14,14 @@
#include <system_error>
#include <functional>
namespace boost { namespace process { namespace detail {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail {
template<typename Tuple>
inline asio::io_context& get_io_context(const Tuple & tup);
namespace posix {
struct on_exit_ : boost::process::detail::posix::async_handler
struct on_exit_ : boost::process::v1::detail::posix::async_handler
{
std::function<void(int, const std::error_code&)> handler;
on_exit_(const std::function<void(int, const std::error_code&)> & handler) : handler(handler)
@@ -31,7 +31,7 @@ struct on_exit_ : boost::process::detail::posix::async_handler
template<typename Executor>
std::function<void(int, const std::error_code&)> on_exit_handler(Executor& exec)
{
auto v = boost::asio::prefer(boost::process::detail::get_io_context(exec.seq).get_executor(),
auto v = boost::asio::prefer(boost::process::v1::detail::get_io_context(exec.seq).get_executor(),
boost::asio::execution::outstanding_work.tracked);
auto handler_ = this->handler;
return
@@ -44,5 +44,5 @@ struct on_exit_ : boost::process::detail::posix::async_handler
};
}}}}
}}}}}
#endif /* BOOST_PROCESS_POSIX_ON_EXIT_HPP_ */

View File

@@ -16,9 +16,9 @@
#include <boost/process/v1/detail/used_handles.hpp>
#include <array>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
struct pipe_in : handler_base_ext, ::boost::process::detail::uses_handles
struct pipe_in : handler_base_ext, ::boost::process::v1::detail::uses_handles
{
int source;
int sink; //opposite end
@@ -53,7 +53,7 @@ struct pipe_in : handler_base_ext, ::boost::process::detail::uses_handles
void on_exec_setup(Executor &e) const
{
if (::dup2(source, STDIN_FILENO) == -1)
e.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "dup2() failed");
if (source != STDIN_FILENO)
::close(source);
@@ -93,6 +93,6 @@ struct async_pipe_in : public pipe_in
}
};
}}}}
}}}}}
#endif

View File

@@ -17,10 +17,10 @@
#include <array>
#include <boost/process/v1/detail/used_handles.hpp>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
template<int p1, int p2>
struct pipe_out : handler_base_ext, ::boost::process::detail::uses_handles
struct pipe_out : handler_base_ext, ::boost::process::v1::detail::uses_handles
{
int sink;
int source; //opposite end
@@ -62,7 +62,7 @@ template<typename Executor>
void pipe_out<1,-1>::on_exec_setup(Executor &e) const
{
if (::dup2(sink, STDOUT_FILENO) == -1)
e.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "dup2() failed");
if (sink != STDOUT_FILENO)
::close(sink);
@@ -74,7 +74,7 @@ template<typename Executor>
void pipe_out<2,-1>::on_exec_setup(Executor &e) const
{
if (::dup2(sink, STDERR_FILENO) == -1)
e.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "dup2() failed");
if (sink != STDOUT_FILENO)
::close(sink);
@@ -86,9 +86,9 @@ template<typename Executor>
void pipe_out<1,2>::on_exec_setup(Executor &e) const
{
if (::dup2(sink, STDOUT_FILENO) == -1)
e.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "dup2() failed");
if (::dup2(sink, STDERR_FILENO) == -1)
e.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
e.set_error(::boost::process::v1::detail::get_last_error(), "dup2() failed");
if ((sink != STDOUT_FILENO) && (sink != STDERR_FILENO))
::close(sink);
::close(source);
@@ -126,6 +126,6 @@ struct async_pipe_out : public pipe_out<p1, p2>
};
}}}}
}}}}}
#endif

View File

@@ -18,13 +18,13 @@
#include <stdlib.h>
#include <unistd.h>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
inline boost::process::filesystem::path search_path(
const boost::process::filesystem::path &filename,
const std::vector<boost::process::filesystem::path> &path)
inline boost::process::v1::filesystem::path search_path(
const boost::process::v1::filesystem::path &filename,
const std::vector<boost::process::v1::filesystem::path> &path)
{
for (const boost::process::filesystem::path & pp : path)
for (const boost::process::v1::filesystem::path & pp : path)
{
auto p = pp / filename;
#if defined(BOOST_PROCESS_USE_STD_FS)
@@ -32,13 +32,13 @@ inline boost::process::filesystem::path search_path(
#else
boost::system::error_code ec;
#endif
bool file = boost::process::filesystem::is_regular_file(p, ec);
bool file = boost::process::v1::filesystem::is_regular_file(p, ec);
if (!ec && file && ::access(p.c_str(), X_OK) == 0)
return p;
}
return "";
}
}}}}
}}}}}
#endif

View File

@@ -14,19 +14,19 @@
#include <boost/system/error_code.hpp>
#include <boost/process/v1/filesystem.hpp>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
inline boost::process::filesystem::path shell_path()
inline boost::process::v1::filesystem::path shell_path()
{
return "/bin/sh";
}
inline boost::process::filesystem::path shell_path(std::error_code &ec)
inline boost::process::v1::filesystem::path shell_path(std::error_code &ec)
{
ec.clear();
return "/bin/sh";
}
}}}}
}}}}}
#endif

View File

@@ -20,7 +20,7 @@
#include <sys/wait.h>
#include <list>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
class sigchld_service : public boost::asio::detail::service_base<sigchld_service>
{
@@ -145,7 +145,7 @@ void sigchld_service::_handle_signal(const boost::system::error_code & ec)
}
}
}
}

View File

@@ -14,7 +14,7 @@
#include <boost/process/v1/detail/posix/handler.hpp>
#include <signal.h>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
#if defined(__GLIBC__)
using sighandler_t = ::sighandler_t;
@@ -55,16 +55,16 @@ struct sig_init_ : handler_base_ext
}
private:
bool _reset = false;
::boost::process::detail::posix::sighandler_t _old{0};
::boost::process::detail::posix::sighandler_t _handler{0};
::boost::process::v1::detail::posix::sighandler_t _old{0};
::boost::process::v1::detail::posix::sighandler_t _handler{0};
};
struct sig_
{
constexpr sig_() {}
sig_init_ operator()(::boost::process::detail::posix::sighandler_t h) const {return h;}
sig_init_ operator= (::boost::process::detail::posix::sighandler_t h) const {return h;}
sig_init_ operator()(::boost::process::v1::detail::posix::sighandler_t h) const {return h;}
sig_init_ operator= (::boost::process::v1::detail::posix::sighandler_t h) const {return h;}
sig_init_ dfl() const {return SIG_DFL;}
sig_init_ ign() const {return SIG_IGN;}
@@ -74,6 +74,6 @@ struct sig_
}}}}
}}}}}
#endif

View File

@@ -15,7 +15,7 @@
#include <unistd.h>
#include <boost/core/ignore_unused.hpp>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
template<typename Char>
struct start_dir_init : handler_base_ext
@@ -34,6 +34,6 @@ private:
string_type s_;
};
}}}}
}}}}}
#endif

View File

@@ -17,12 +17,12 @@
#include <sys/wait.h>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
inline void terminate(const child_handle &p, std::error_code &ec) noexcept
{
if (::kill(p.pid, SIGKILL) == -1)
ec = boost::process::detail::get_last_error();
ec = boost::process::v1::detail::get_last_error();
else
ec.clear();
@@ -34,9 +34,9 @@ inline void terminate(const child_handle &p)
{
std::error_code ec;
terminate(p, ec);
boost::process::detail::throw_error(ec, "kill(2) failed");
boost::process::v1::detail::throw_error(ec, "kill(2) failed");
}
}}}}
}}}}}
#endif

View File

@@ -13,7 +13,7 @@
#include <boost/fusion/sequence/intrinsic/has_key.hpp>
#include <boost/fusion/container/set/convert.hpp>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
struct use_vfork_ : handler_base_ext
{
@@ -28,6 +28,6 @@ struct shall_use_vfork
};
}}}}
}}}}}
#endif /* BOOST_PROCESS_DETAIL_POSIX_USE_VFORK_HPP_ */

View File

@@ -17,7 +17,7 @@
#include <sys/wait.h>
#include <unistd.h>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
inline void wait(const child_handle &p, int & exit_code, std::error_code &ec) noexcept
{
@@ -32,7 +32,7 @@ inline void wait(const child_handle &p, int & exit_code, std::error_code &ec) no
(ret != -1 && !WIFEXITED(status) && !WIFSIGNALED(status)));
if (ret == -1)
ec = boost::process::detail::get_last_error();
ec = boost::process::v1::detail::get_last_error();
else
{
ec.clear();
@@ -44,7 +44,7 @@ inline void wait(const child_handle &p, int & exit_code) noexcept
{
std::error_code ec;
wait(p, exit_code, ec);
boost::process::detail::throw_error(ec, "waitpid(2) failed in wait");
boost::process::v1::detail::throw_error(ec, "waitpid(2) failed in wait");
}
template< class Clock, class Duration >
@@ -131,7 +131,7 @@ inline bool wait_until(
pid_t timeout_pid = ::fork();
if (timeout_pid == -1)
{
ec = boost::process::detail::get_last_error();
ec = boost::process::v1::detail::get_last_error();
return true;
}
else if (timeout_pid == 0)
@@ -192,7 +192,7 @@ inline bool wait_until(
#endif
if (ret == -1)
ec = boost::process::detail::get_last_error();
ec = boost::process::v1::detail::get_last_error();
else
{
ec.clear();
@@ -210,7 +210,7 @@ inline bool wait_until(
{
std::error_code ec;
bool b = wait_until(p, exit_code, time_out, ec);
boost::process::detail::throw_error(ec, "waitpid(2) failed in wait_until");
boost::process::v1::detail::throw_error(ec, "waitpid(2) failed in wait_until");
return b;
}
@@ -232,10 +232,10 @@ inline bool wait_for(
{
std::error_code ec;
bool b = wait_for(p, exit_code, rel_time, ec);
boost::process::detail::throw_error(ec, "waitpid(2) failed in wait_for");
boost::process::v1::detail::throw_error(ec, "waitpid(2) failed in wait_for");
return b;
}
}}}}
}}}}}
#endif

View File

@@ -18,7 +18,7 @@
#include <sys/wait.h>
#include <unistd.h>
namespace boost { namespace process { namespace detail { namespace posix {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace posix {
inline void wait(const group_handle &p, std::error_code &ec) noexcept
{
@@ -40,7 +40,7 @@ inline void wait(const group_handle &p, std::error_code &ec) noexcept
while ((ret != -1) || (errno != ECHILD));
if (errno != ECHILD)
ec = boost::process::detail::get_last_error();
ec = boost::process::v1::detail::get_last_error();
else
ec.clear();
}
@@ -49,7 +49,7 @@ inline void wait(const group_handle &p) noexcept
{
std::error_code ec;
wait(p, ec);
boost::process::detail::throw_error(ec, "waitpid(2) failed in wait");
boost::process::v1::detail::throw_error(ec, "waitpid(2) failed in wait");
}
template< class Clock, class Duration >
@@ -79,7 +79,7 @@ inline bool wait_until(
ec.clear();
return true;
}
ec = boost::process::detail::get_last_error();
ec = boost::process::v1::detail::get_last_error();
return false;
}
//we can wait, because unlike in the wait_for_exit, we have no race condition regarding eh exit code.
@@ -95,7 +95,7 @@ inline bool wait_until(
{
std::error_code ec;
bool b = wait_until(p, time_out, ec);
boost::process::detail::throw_error(ec, "waitpid(2) failed in wait_until");
boost::process::v1::detail::throw_error(ec, "waitpid(2) failed in wait_until");
return b;
}
@@ -115,10 +115,10 @@ inline bool wait_for(
{
std::error_code ec;
bool b = wait_for(p, rel_time, ec);
boost::process::detail::throw_error(ec, "waitpid(2) failed in wait_for");
boost::process::v1::detail::throw_error(ec, "waitpid(2) failed in wait_for");
return b;
}
}}}}
}}}}}
#endif

View File

@@ -14,9 +14,9 @@
#include <boost/process/v1/detail/config.hpp>
#include <boost/process/v1/detail/handler_base.hpp>
namespace boost { namespace process { namespace detail {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail {
struct throw_on_error_ : ::boost::process::detail::handler
struct throw_on_error_ : ::boost::process::v1::detail::handler
{
template <class Executor>
void on_error(Executor& exec, const std::error_code & ec) const
@@ -29,8 +29,8 @@ struct throw_on_error_ : ::boost::process::detail::handler
}
constexpr boost::process::detail::throw_on_error_ throw_on_error;
constexpr boost::process::v1::detail::throw_on_error_ throw_on_error;
}}
}}}
#endif

View File

@@ -15,7 +15,7 @@ namespace boost { namespace asio {
class io_context;
}}
namespace boost { namespace process { namespace detail {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail {
struct async_tag {};
@@ -27,8 +27,6 @@ template<> struct initializer_tag<::boost::asio::io_context> { typedef async_tag
}}}
}}}}
#endif /* BOOST_PROCESS_DETAIL_HANDLER_HPP_ */

View File

@@ -13,7 +13,9 @@
#include <initializer_list>
#include <boost/process/v1/filesystem.hpp>
#include <boost/process/v1/detail/traits/decl.hpp>
namespace boost { namespace process { namespace detail {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail {
template<typename Char>
struct cmd_or_exe_tag {};
@@ -53,12 +55,12 @@ template<> struct initializer_tag<std::initializer_list<const wchar_t *>> { type
template<> struct initializer_tag<shell_>
{
typedef cmd_or_exe_tag<typename boost::process::filesystem::path::value_type> type;
typedef cmd_or_exe_tag<typename boost::process::v1::filesystem::path::value_type> type;
};
template<> struct initializer_tag<boost::process::filesystem::path>
template<> struct initializer_tag<boost::process::v1::filesystem::path>
{
typedef cmd_or_exe_tag<typename boost::process::filesystem::path::value_type> type;
typedef cmd_or_exe_tag<typename boost::process::v1::filesystem::path::value_type> type;
};
template <typename Char>
@@ -78,8 +80,6 @@ template<>
struct initializer_builder<cmd_or_exe_tag<wchar_t>>;
}}}
}}}}
#endif /* BOOST_PROCESS_DETAIL_STRING_TRAITS_HPP_ */

View File

@@ -18,7 +18,7 @@
#endif
namespace boost { namespace process { namespace detail {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail {
template<typename T>
@@ -69,8 +69,6 @@ struct valid_argument_list
}}}
}}}}
#endif /* BOOST_PROCESS_DETAIL_HANDLER_HPP_ */

View File

@@ -6,11 +6,10 @@
#ifndef BOOST_PROCESS_DETAIL_TRAITS_ENV_HPP_
#define BOOST_PROCESS_DETAIL_TRAITS_ENV_HPP_
#include <boost/process/v1/detail/config.hpp>
#include <boost/process/v1/detail/traits/decl.hpp>
namespace boost { namespace process {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 {
template<typename Char>
class basic_environment;
@@ -23,9 +22,6 @@ namespace detail {
template<typename Char>
struct env_tag {};
template<typename Char> struct env_set;
template<typename Char> struct env_append;
@@ -39,8 +35,8 @@ template<typename Char> struct initializer_tag<env_append<Char>> { typedef env_t
template<typename Char> struct initializer_tag<env_reset<Char>> { typedef env_tag<Char> type;};
template<typename Char> struct initializer_tag<env_init <Char>> { typedef env_tag<Char> type;};
template<typename Char> struct initializer_tag<::boost::process::basic_environment<Char>> { typedef env_tag<Char> type; };
template<typename Char> struct initializer_tag<::boost::process::basic_native_environment<Char>> { typedef env_tag<Char> type; };
template<typename Char> struct initializer_tag<::boost::process::v1::basic_environment<Char>> { typedef env_tag<Char> type; };
template<typename Char> struct initializer_tag<::boost::process::v1::basic_native_environment<Char>> { typedef env_tag<Char> type; };
template<> struct initializer_builder<env_tag<char>>;
template<> struct initializer_builder<env_tag<wchar_t>>;
@@ -48,6 +44,5 @@ template<> struct initializer_builder<env_tag<wchar_t>>;
}
}}
}}}
#endif /* INCLUDE_BOOST_PROCESS_DETAIL_ENV_HPP_ */

View File

@@ -13,15 +13,13 @@
namespace boost { namespace process { namespace detail {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail {
struct error_tag;
template<>
struct initializer_tag<std::error_code>;
}}}
}}}}
#endif /* BOOST_PROCESS_DETAIL_HANDLER_HPP_ */

View File

@@ -12,7 +12,7 @@
namespace boost { namespace process {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 {
struct group;
@@ -25,12 +25,12 @@ template<>
struct make_initializer_t<group_tag>;
template<> struct initializer_tag_t<::boost::process::group> { typedef group_tag type;};
template<> struct initializer_tag_t<::boost::process::v1::group> { typedef group_tag type;};
}}}
}}}}

View File

@@ -14,13 +14,13 @@
#include <boost/process/v1/detail/traits/env.hpp>
#include <boost/process/v1/locale.hpp>
namespace boost { namespace process { namespace detail {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail {
//template
template<typename T> struct is_wchar_t : std::false_type {};
template<> struct is_wchar_t<boost::process::filesystem::path> : std::is_same<typename boost::process::filesystem::path::value_type, wchar_t>
template<> struct is_wchar_t<boost::process::v1::filesystem::path> : std::is_same<typename boost::process::v1::filesystem::path::value_type, wchar_t>
{
};
@@ -68,7 +68,7 @@ struct char_converter<char, const wchar_t*>
{
std::size_t size = 0;
while (in[size] != L'\0') size++;
return ::boost::process::detail::convert(in, in + size);
return ::boost::process::v1::detail::convert(in, in + size);
}
};
@@ -79,7 +79,7 @@ struct char_converter<char, wchar_t*>
{
std::size_t size = 0;
while (in[size] != L'\0') size++;
return ::boost::process::detail::convert(in, in + size);
return ::boost::process::v1::detail::convert(in, in + size);
}
};
@@ -88,7 +88,7 @@ struct char_converter<char, wchar_t[Size]>
{
static std::string conv(const wchar_t(&in)[Size])
{
return ::boost::process::detail::convert(in, in + Size -1);
return ::boost::process::v1::detail::convert(in, in + Size -1);
}
};
@@ -99,7 +99,7 @@ struct char_converter<wchar_t, const char*>
{
std::size_t size = 0;
while (in[size] != '\0') size++;
return ::boost::process::detail::convert(in, in + size);
return ::boost::process::v1::detail::convert(in, in + size);
}
};
@@ -110,7 +110,7 @@ struct char_converter<wchar_t, char*>
{
std::size_t size = 0;
while (in[size] != '\0') size++;
return ::boost::process::detail::convert(in, in + size);
return ::boost::process::v1::detail::convert(in, in + size);
}
};
@@ -120,7 +120,7 @@ struct char_converter<wchar_t, char[Size]>
{
static std::wstring conv(const char(&in)[Size])
{
return ::boost::process::detail::convert(in, in + Size -1);
return ::boost::process::v1::detail::convert(in, in + Size -1);
}
};
@@ -130,7 +130,7 @@ struct char_converter<wchar_t, std::string>
{
static std::wstring conv(const std::string & in)
{
return ::boost::process::detail::convert(in);
return ::boost::process::v1::detail::convert(in);
}
};
@@ -139,7 +139,7 @@ struct char_converter<char, std::wstring>
{
static std::string conv(const std::wstring & in)
{
return ::boost::process::detail::convert(in);
return ::boost::process::v1::detail::convert(in);
}
};
@@ -272,5 +272,5 @@ struct char_converter<char, std::initializer_list<wchar_t * >>
};
}}}
}}}}
#endif /* BOOST_PROCESS_DETAIL_TRAITS_WCHAR_T_HPP_ */

View File

@@ -18,7 +18,7 @@
#include <boost/process/v1/detail/windows/asio_fwd.hpp>
#endif
namespace boost { namespace process { namespace detail {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail {
struct uses_handles
{
@@ -52,7 +52,7 @@ struct foreach_handle_invocator
func(handle_);
}
void invoke(::boost::process::detail::api::native_handle_type handle) const {func(handle);};
void invoke(::boost::process::v1::detail::api::native_handle_type handle) const {func(handle);};
template<typename T>
void operator()(T & val) const {invoke(val.get_used_handles());}
@@ -66,16 +66,16 @@ void foreach_used_handle(Executor &exec, Function &&func)
}
template<typename Executor>
std::vector<::boost::process::detail::api::native_handle_type>
std::vector<::boost::process::v1::detail::api::native_handle_type>
get_used_handles(Executor &exec)
{
std::vector<::boost::process::detail::api::native_handle_type> res = exec.get_used_handles();
foreach_used_handle(exec, [&](::boost::process::detail::api::native_handle_type handle){res.push_back(handle);});
std::vector<::boost::process::v1::detail::api::native_handle_type> res = exec.get_used_handles();
foreach_used_handle(exec, [&](::boost::process::v1::detail::api::native_handle_type handle){res.push_back(handle);});
return res;
}
}}}
}}}}
#endif /* BOOST_PROCESS_DETAIL_USED_HANDLES_HPP_ */

View File

@@ -6,8 +6,9 @@
#ifndef BOOST_PROCESS_DETAIL_WINDOWS_ASIO_FWD_HPP_
#define BOOST_PROCESS_DETAIL_WINDOWS_ASIO_FWD_HPP_
#include <memory>
#include <boost/process/v1/detail/config.hpp>
#include <boost/asio/ts/netfwd.hpp>
#include <memory>
namespace boost { namespace asio {
@@ -37,7 +38,7 @@ typedef basic_object_handle<any_io_executor> object_handle;
} //windows
} //asio
namespace process { namespace detail { namespace windows {
namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
class async_pipe;
@@ -53,8 +54,9 @@ struct async_out_future;
} // windows
} // detail
using ::boost::process::detail::windows::async_pipe;
using ::boost::process::v1::detail::windows::async_pipe;
} // v1
} // process
} // boost

View File

@@ -7,10 +7,11 @@
#ifndef BOOST_PROCESS_WINDOWS_ASYNC_HANDLER_HPP_
#define BOOST_PROCESS_WINDOWS_ASYNC_HANDLER_HPP_
#include <boost/process/v1/detail/config.hpp>
#include <boost/process/v1/detail/windows/handler.hpp>
#include <type_traits>
namespace boost { namespace process { namespace detail { namespace windows {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
struct require_io_context {};
@@ -35,6 +36,6 @@ template<typename T>
struct does_require_io_context<const T&> : std::is_base_of<require_io_context, T> {};
}}}}
}}}}}
#endif /* BOOST_PROCESS_WINDOWS_ASYNC_HANDLER_HPP_ */

View File

@@ -24,13 +24,13 @@
#include <memory>
#include <future>
namespace boost { namespace process { namespace detail { namespace windows {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
template<typename Buffer>
struct async_in_buffer : ::boost::process::detail::windows::handler_base_ext,
::boost::process::detail::windows::require_io_context,
::boost::process::detail::uses_handles
struct async_in_buffer : ::boost::process::v1::detail::windows::handler_base_ext,
::boost::process::v1::detail::windows::require_io_context,
::boost::process::v1::detail::uses_handles
{
Buffer & buf;
@@ -41,7 +41,7 @@ struct async_in_buffer : ::boost::process::detail::windows::handler_base_ext,
fut = promise->get_future(); return std::move(*this);
}
std::shared_ptr<boost::process::async_pipe> pipe;
std::shared_ptr<boost::process::v1::async_pipe> pipe;
::boost::winapi::HANDLE_ get_used_handles() const
{
@@ -91,7 +91,7 @@ struct async_in_buffer : ::boost::process::detail::windows::handler_base_ext,
void on_setup(WindowsExecutor &exec)
{
if (!pipe)
pipe = std::make_shared<boost::process::async_pipe>(get_io_context(exec.seq));
pipe = std::make_shared<boost::process::v1::async_pipe>(get_io_context(exec.seq));
::boost::winapi::HANDLE_ source_handle = std::move(*pipe).source().native_handle();
@@ -106,6 +106,6 @@ struct async_in_buffer : ::boost::process::detail::windows::handler_base_ext,
};
}}}}
}}}}}
#endif

View File

@@ -25,7 +25,7 @@
#include <future>
namespace boost { namespace process { namespace detail { namespace windows {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
template <typename Executor>
@@ -67,12 +67,12 @@ inline void apply_out_handles(Executor &e, void* handle, std::integral_constant<
}
template<int p1, int p2, typename Buffer>
struct async_out_buffer : ::boost::process::detail::windows::handler_base_ext,
::boost::process::detail::windows::require_io_context
struct async_out_buffer : ::boost::process::v1::detail::windows::handler_base_ext,
::boost::process::v1::detail::windows::require_io_context
{
Buffer & buf;
std::shared_ptr<boost::process::async_pipe> pipe;
std::shared_ptr<boost::process::v1::async_pipe> pipe;
async_out_buffer(Buffer & buf) : buf(buf)
@@ -99,7 +99,7 @@ struct async_out_buffer : ::boost::process::detail::windows::handler_base_ext,
void on_setup(WindowsExecutor &exec)
{
if (!pipe)
pipe = std::make_shared<boost::process::async_pipe>(get_io_context(exec.seq));
pipe = std::make_shared<boost::process::v1::async_pipe>(get_io_context(exec.seq));
apply_out_handles(exec, std::move(*pipe).sink().native_handle(),
std::integral_constant<int, p1>(), std::integral_constant<int, p2>());
}
@@ -108,11 +108,11 @@ struct async_out_buffer : ::boost::process::detail::windows::handler_base_ext,
template<int p1, int p2, typename Type>
struct async_out_future : ::boost::process::detail::windows::handler_base_ext,
::boost::process::detail::windows::require_io_context,
::boost::process::detail::uses_handles
struct async_out_future : ::boost::process::v1::detail::windows::handler_base_ext,
::boost::process::v1::detail::windows::require_io_context,
::boost::process::v1::detail::uses_handles
{
std::shared_ptr<boost::process::async_pipe> pipe;
std::shared_ptr<boost::process::v1::async_pipe> pipe;
std::shared_ptr<std::promise<Type>> promise = std::make_shared<std::promise<Type>>();
std::shared_ptr<boost::asio::streambuf> buffer = std::make_shared<boost::asio::streambuf>();
@@ -173,7 +173,7 @@ struct async_out_future : ::boost::process::detail::windows::handler_base_ext,
void on_setup(WindowsExecutor &exec)
{
if (!pipe)
pipe = std::make_shared<boost::process::async_pipe>(get_io_context(exec.seq));
pipe = std::make_shared<boost::process::v1::async_pipe>(get_io_context(exec.seq));
apply_out_handles(exec, std::move(*pipe).sink().native_handle(),
std::integral_constant<int, p1>(), std::integral_constant<int, p2>());
@@ -181,6 +181,6 @@ struct async_out_future : ::boost::process::detail::windows::handler_base_ext,
};
}}}}
}}}}}
#endif

View File

@@ -20,7 +20,7 @@
#include <system_error>
#include <string>
namespace boost { namespace process { namespace detail { namespace windows {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
inline std::string make_pipe_name()
{
@@ -290,7 +290,7 @@ async_pipe::async_pipe(boost::asio::io_context & ios_source,
::boost::winapi::HANDLE_ source = ::boost::winapi::create_named_pipe(
#if defined(BOOST_NO_ANSI_APIS)
::boost::process::detail::convert(name).c_str(),
::boost::process::v1::detail::convert(name).c_str(),
#else
name.c_str(),
#endif
@@ -300,13 +300,13 @@ async_pipe::async_pipe(boost::asio::io_context & ios_source,
if (source == boost::winapi::INVALID_HANDLE_VALUE_)
::boost::process::detail::throw_last_error("create_named_pipe(" + name + ") failed");
::boost::process::v1::detail::throw_last_error("create_named_pipe(" + name + ") failed");
_source.assign(source);
::boost::winapi::HANDLE_ sink = boost::winapi::create_file(
#if defined(BOOST_NO_ANSI_APIS)
::boost::process::detail::convert(name).c_str(),
::boost::process::v1::detail::convert(name).c_str(),
#else
name.c_str(),
#endif
@@ -316,7 +316,7 @@ async_pipe::async_pipe(boost::asio::io_context & ios_source,
nullptr);
if (sink == ::boost::winapi::INVALID_HANDLE_VALUE_)
::boost::process::detail::throw_last_error("create_file() failed");
::boost::process::v1::detail::throw_last_error("create_file() failed");
_sink.assign(sink);
}
@@ -480,6 +480,6 @@ inline bool operator!=(const basic_pipe<Char, Traits> & lhs, const async_pipe &
!compare_handles(lhs.native_sink(), rhs.native_sink());
}
}}}}
}}}}}
#endif /* INCLUDE_BOOST_PIPE_DETAIL_WINDOWS_ASYNC_PIPE_HPP_ */

View File

@@ -21,6 +21,8 @@ namespace boost
{
namespace process
{
BOOST_PROCESS_V1_INLINE namespace v1
{
namespace detail
{
namespace windows
@@ -197,7 +199,7 @@ private:
}
}
}
}
#endif /* INCLUDE_BOOST_PROCESS_WINDOWS_ARGS_HPP_ */

View File

@@ -19,7 +19,7 @@
#include <string>
namespace boost { namespace process { namespace detail { namespace windows {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
template<class CharT, class Traits = std::char_traits<CharT>>
class basic_pipe
@@ -72,7 +72,7 @@ public:
_sink, data, count * sizeof(char_type), &write_len, nullptr
))
{
auto ec = ::boost::process::detail::get_last_error();
auto ec = ::boost::process::v1::detail::get_last_error();
if ((ec.value() == ::boost::winapi::ERROR_BROKEN_PIPE_) ||
(ec.value() == ::boost::winapi::ERROR_NO_DATA_))
return 0;
@@ -88,7 +88,7 @@ public:
_source, data, count * sizeof(char_type), &read_len, nullptr
))
{
auto ec = ::boost::process::detail::get_last_error();
auto ec = ::boost::process::v1::detail::get_last_error();
if ((ec.value() == ::boost::winapi::ERROR_BROKEN_PIPE_) ||
(ec.value() == ::boost::winapi::ERROR_NO_DATA_))
return 0;
@@ -144,7 +144,7 @@ basic_pipe<Char, Traits>::basic_pipe(const std::string & name)
//static constexpr int FILE_ATTRIBUTE_NORMAL_ = 0x00000080; //temporary
#if BOOST_NO_ANSI_APIS
std::wstring name_ = boost::process::detail::convert(name);
std::wstring name_ = boost::process::v1::detail::convert(name);
#else
auto &name_ = name;
#endif
@@ -155,7 +155,7 @@ basic_pipe<Char, Traits>::basic_pipe(const std::string & name)
0, ::boost::winapi::PIPE_UNLIMITED_INSTANCES_, 8192, 8192, 0, nullptr);
if (source == boost::winapi::INVALID_HANDLE_VALUE_)
::boost::process::detail::throw_last_error("create_named_pipe() failed");
::boost::process::v1::detail::throw_last_error("create_named_pipe() failed");
::boost::winapi::HANDLE_ sink = boost::winapi::create_file(
name_.c_str(),
@@ -165,7 +165,7 @@ basic_pipe<Char, Traits>::basic_pipe(const std::string & name)
nullptr);
if (sink == ::boost::winapi::INVALID_HANDLE_VALUE_)
::boost::process::detail::throw_last_error("create_file() failed");
::boost::process::v1::detail::throw_last_error("create_file() failed");
_source = source;
_sink = sink;
@@ -225,6 +225,6 @@ inline bool operator!=(const basic_pipe<Char, Traits> & lhs, const basic_pipe<Ch
!compare_handles(lhs.native_sink(), rhs.native_sink());
}
}}}}
}}}}}
#endif

View File

@@ -10,12 +10,13 @@
#ifndef BOOST_PROCESS_WINDOWS_CHILD_HPP
#define BOOST_PROCESS_WINDOWS_CHILD_HPP
#include <boost/process/v1/detail/config.hpp>
#include <boost/move/move.hpp>
#include <boost/winapi/handles.hpp>
#include <boost/winapi/process.hpp>
#include <boost/winapi/jobs.hpp>
namespace boost { namespace process { namespace detail { namespace windows {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
typedef ::boost::winapi::DWORD_ pid_t;
@@ -93,6 +94,6 @@ struct child_handle
}
};
}}}}
}}}}}
#endif

View File

@@ -10,13 +10,14 @@
#ifndef BOOST_PROCESS_WINDOWS_INITIALIZERS_CLOSE_IN_HPP
#define BOOST_PROCESS_WINDOWS_INITIALIZERS_CLOSE_IN_HPP
#include <boost/process/v1/detail/config.hpp>
#include <boost/process/v1/detail/handler_base.hpp>
#include <boost/winapi/process.hpp>
#include <boost/winapi/handles.hpp>
#include <boost/process/v1/detail/handler_base.hpp>
namespace boost { namespace process { namespace detail { namespace windows {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
struct close_in : public ::boost::process::detail::handler_base
struct close_in : public ::boost::process::v1::detail::handler_base
{
template <class WindowsExecutor>
void on_setup(WindowsExecutor &e) const
@@ -26,6 +27,6 @@ struct close_in : public ::boost::process::detail::handler_base
}
};
}}}}
}}}}}
#endif

View File

@@ -10,14 +10,15 @@
#ifndef BOOST_PROCESS_WINDOWS_INITIALIZERS_CLOSE_OUT_HPP
#define BOOST_PROCESS_WINDOWS_INITIALIZERS_CLOSE_OUT_HPP
#include <boost/process/v1/detail/config.hpp>
#include <boost/process/v1/detail/handler_base.hpp>
#include <boost/winapi/process.hpp>
#include <boost/winapi/handles.hpp>
#include <boost/process/v1/detail/handler_base.hpp>
namespace boost { namespace process { namespace detail { namespace windows {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
template<int p1, int p2>
struct close_out : public ::boost::process::detail::handler_base
struct close_out : public ::boost::process::v1::detail::handler_base
{
template <class WindowsExecutor>
inline void on_setup(WindowsExecutor &e) const;
@@ -48,6 +49,6 @@ void close_out<1,2>::on_setup(WindowsExecutor &e) const
e.startup_info.dwFlags |= ::boost::winapi::STARTF_USESTDHANDLES_;
}
}}}}
}}}}}
#endif

View File

@@ -13,13 +13,15 @@ namespace boost
{
namespace process
{
BOOST_PROCESS_V1_INLINE namespace v1
{
namespace detail
{
namespace windows
{
template<typename CharType>
struct cmd_setter_ : ::boost::process::detail::handler_base
struct cmd_setter_ : ::boost::process::v1::detail::handler_base
{
typedef CharType value_type;
typedef std::basic_string<value_type> string_type;
@@ -43,7 +45,7 @@ private:
}
}
}
}
#endif /* INCLUDE_BOOST_PROCESS_WINDOWS_ARGS_HPP_ */

View File

@@ -10,7 +10,7 @@
#include <boost/winapi/file_management.hpp>
#include <boost/process/v1/detail/config.hpp>
namespace boost { namespace process { namespace detail { namespace windows {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
inline bool compare_handles(boost::winapi::HANDLE_ lhs, boost::winapi::HANDLE_ rhs)
{
@@ -25,16 +25,16 @@ inline bool compare_handles(boost::winapi::HANDLE_ lhs, boost::winapi::HANDLE_ r
::boost::winapi::BY_HANDLE_FILE_INFORMATION_ rhs_info{0,{0,0},{0,0},{0,0},0,0,0,0,0,0};
if (!::boost::winapi::GetFileInformationByHandle(lhs, &lhs_info))
::boost::process::detail::throw_last_error("GetFileInformationByHandle");
::boost::process::v1::detail::throw_last_error("GetFileInformationByHandle");
if (!::boost::winapi::GetFileInformationByHandle(rhs, &rhs_info))
::boost::process::detail::throw_last_error("GetFileInformationByHandle");
::boost::process::v1::detail::throw_last_error("GetFileInformationByHandle");
return (lhs_info.nFileIndexHigh == rhs_info.nFileIndexHigh)
&& (lhs_info.nFileIndexLow == rhs_info.nFileIndexLow);
}
}}}}
}}}}}

View File

@@ -15,15 +15,15 @@
#include <boost/process/v1/detail/handler_base.hpp>
#include <boost/process/v1/environment.hpp>
namespace boost { namespace process { namespace detail { namespace windows {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
template<typename Char>
struct env_init : public ::boost::process::detail::handler_base
struct env_init : public ::boost::process::v1::detail::handler_base
{
boost::process::basic_environment<Char> env;
boost::process::v1::basic_environment<Char> env;
env_init(boost::process::basic_environment<Char> && env) : env(std::move(env)) {};
env_init(const boost::process::basic_environment<Char> & env) : env(env) {};
env_init(boost::process::v1::basic_environment<Char> && env) : env(std::move(env)) {};
env_init(const boost::process::v1::basic_environment<Char> & env) : env(env) {};
constexpr static ::boost::winapi::DWORD_ creation_flag(char) {return 0u;}
constexpr static ::boost::winapi::DWORD_ creation_flag(wchar_t)
@@ -47,7 +47,7 @@ struct env_init : public ::boost::process::detail::handler_base
};
}}}}
}}}}}

View File

@@ -17,7 +17,7 @@
#include <algorithm>
#include <boost/process/v1/locale.hpp>
namespace boost { namespace process { namespace detail { namespace windows {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
template<typename Char>
class native_environment_impl
@@ -87,7 +87,7 @@ inline auto native_environment_impl<Char>::get(const pointer_type id) -> string_
if (size == buf_size) //buffer to small
buf_size *= 2;
else if (size == 0)
::boost::process::detail::throw_last_error("GetEnvironmentVariable() failed");
::boost::process::v1::detail::throw_last_error("GetEnvironmentVariable() failed");
else
return std::basic_string<Char>(
buf.data(), buf.data()+ size);
@@ -194,15 +194,15 @@ public:
template<typename CharR>
explicit inline basic_environment_impl(
const basic_environment_impl<CharR>& rhs,
const ::boost::process::codecvt_type & cv = ::boost::process::codecvt())
: _data(::boost::process::detail::convert(rhs._data, cv))
const ::boost::process::v1::codecvt_type & cv = ::boost::process::v1::codecvt())
: _data(::boost::process::v1::detail::convert(rhs._data, cv))
{
}
template<typename CharR>
basic_environment_impl & operator=(const basic_environment_impl<CharR>& rhs)
{
_data = ::boost::process::detail::convert(rhs._data);
_data = ::boost::process::v1::detail::convert(rhs._data);
_env_arr = _load_var(&*_data.begin());
_env_impl = &*_env_arr.begin();
return *this;
@@ -349,7 +349,7 @@ typedef void* native_handle_t;
}
}
}
}

View File

@@ -24,7 +24,7 @@
#include <atomic>
#include <cstring>
namespace boost { namespace process {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 {
namespace detail { namespace windows {
@@ -160,8 +160,8 @@ class executor : public startup_info_impl<Char>
}
};
typedef typename ::boost::process::detail::has_error_handler<Sequence>::type has_error_handler;
typedef typename ::boost::process::detail::has_ignore_error <Sequence>::type has_ignore_error;
typedef typename ::boost::process::v1::detail::has_error_handler<Sequence>::type has_error_handler;
typedef typename ::boost::process::v1::detail::has_ignore_error <Sequence>::type has_ignore_error;
std::error_code _ec{0, std::system_category()};
@@ -207,7 +207,7 @@ public:
boost::fusion::for_each(seq, on_success_fn);
}
else
set_error(::boost::process::detail::get_last_error(),
set_error(::boost::process::v1::detail::get_last_error(),
" CreateProcess failed");
if ( _ec)
@@ -254,6 +254,6 @@ executor<Char, Tup> make_executor(Tup & tup)
}
}}}}
}}}}}
#endif

View File

@@ -13,7 +13,7 @@
#include <boost/process/v1/filesystem.hpp>
#include <boost/core/exchange.hpp>
namespace boost { namespace process { namespace detail { namespace windows {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
struct file_descriptor
{
@@ -40,14 +40,14 @@ struct file_descriptor
}
file_descriptor() = default;
file_descriptor(const boost::process::filesystem::path& p, mode_t mode = read_write)
file_descriptor(const boost::process::v1::filesystem::path& p, mode_t mode = read_write)
: file_descriptor(p.native(), mode)
{
}
file_descriptor(const std::string & path , mode_t mode = read_write)
#if defined(BOOST_NO_ANSI_APIS)
: file_descriptor(::boost::process::detail::convert(path), mode)
: file_descriptor(::boost::process::v1::detail::convert(path), mode)
#else
: file_descriptor(path.c_str(), mode)
#endif
@@ -117,6 +117,6 @@ private:
::boost::winapi::HANDLE_ _handle = ::boost::winapi::INVALID_HANDLE_VALUE_;
};
}}}}
}}}}}
#endif /* BOOST_PROCESS_DETAIL_WINDOWS_FILE_DESCRIPTOR_HPP_ */

View File

@@ -17,10 +17,10 @@
#include <boost/process/v1/detail/windows/file_descriptor.hpp>
#include <io.h>
namespace boost { namespace process { namespace detail { namespace windows {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
struct file_in : public ::boost::process::detail::handler_base,
::boost::process::detail::uses_handles
struct file_in : public ::boost::process::v1::detail::handler_base,
::boost::process::v1::detail::uses_handles
{
file_descriptor file;
::boost::winapi::HANDLE_ handle = file.handle();
@@ -43,6 +43,6 @@ struct file_in : public ::boost::process::detail::handler_base,
}
};
}}}}
}}}}}
#endif

View File

@@ -17,11 +17,11 @@
#include <boost/process/v1/detail/used_handles.hpp>
#include <boost/process/v1/detail/windows/file_descriptor.hpp>
namespace boost { namespace process { namespace detail { namespace windows {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
template<int p1, int p2>
struct file_out : public ::boost::process::detail::handler_base,
::boost::process::detail::uses_handles
struct file_out : public ::boost::process::v1::detail::handler_base,
::boost::process::v1::detail::uses_handles
{
file_descriptor file;
::boost::winapi::HANDLE_ handle = file.handle();
@@ -77,6 +77,6 @@ void file_out<1,2>::on_setup(WindowsExecutor &e) const
e.inherit_handles = true;
}
}}}}
}}}}}
#endif

View File

@@ -12,7 +12,7 @@
#include <boost/process/v1/detail/windows/job_workaround.hpp>
#include <system_error>
namespace boost { namespace process { namespace detail { namespace windows {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
inline bool break_away_enabled(::boost::winapi::HANDLE_ h)
{
@@ -184,13 +184,13 @@ struct group_handle
inline void terminate(const group_handle &p)
{
if (!::boost::winapi::TerminateJobObject(p.handle(), EXIT_FAILURE))
boost::process::detail::throw_last_error("TerminateJobObject() failed");
boost::process::v1::detail::throw_last_error("TerminateJobObject() failed");
}
inline void terminate(const group_handle &p, std::error_code &ec) noexcept
{
if (!::boost::winapi::TerminateJobObject(p.handle(), EXIT_FAILURE))
ec = boost::process::detail::get_last_error();
ec = boost::process::v1::detail::get_last_error();
else
ec.clear();
}
@@ -206,7 +206,7 @@ inline bool in_group()
}}}}
}}}}}
#endif /* BOOST_PROCESS_DETAIL_WINDOWS_GROUP_HPP_ */

View File

@@ -12,13 +12,13 @@
#include <boost/process/v1/detail/used_handles.hpp>
#include <boost/process/v1/detail/windows/handler.hpp>
namespace boost { namespace process {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 {
namespace detail { namespace windows {
struct group_ref : handler_base_ext, ::boost::process::detail::uses_handles
struct group_ref : handler_base_ext, ::boost::process::v1::detail::uses_handles
{
::boost::winapi::HANDLE_ handle;
@@ -41,14 +41,14 @@ struct group_ref : handler_base_ext, ::boost::process::detail::uses_handles
void on_success(Executor& exec) const
{
if (!::boost::winapi::AssignProcessToJobObject(handle, exec.proc_info.hProcess))
exec.set_error(::boost::process::detail::get_last_error(),
exec.set_error(::boost::process::v1::detail::get_last_error(),
"AssignProcessToJobObject() failed.");
}
};
}}}}
}}}}}
#endif /* BOOST_PROCESS_DETAIL_WINDOWS_GROUP_HPP_ */

View File

@@ -6,6 +6,8 @@
#ifndef BOOST_PROCESS_DETAIL_WINDOWS_HANDLE_WORKAROUND_HPP_
#define BOOST_PROCESS_DETAIL_WINDOWS_HANDLE_WORKAROUND_HPP_
#include <boost/process/v1/detail/config.hpp>
#include <boost/winapi/basic_types.hpp>
#include <boost/winapi/dll.hpp>
#include <boost/winapi/access_rights.hpp>
@@ -16,7 +18,7 @@
#endif
namespace boost { namespace process { namespace detail { namespace windows { namespace workaround
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows { namespace workaround
{
@@ -257,6 +259,6 @@ inline ::boost::winapi::BOOL_ nt_query_object(
#endif
}}}}}
}}}}}}
#endif /* BOOST_PROCESS_DETAIL_WINDOWS_JOB_WORKAROUND_HPP_ */

View File

@@ -6,14 +6,15 @@
#ifndef BOOST_PROCESS_DETAIL_WINDOWS_HANDLER_HPP_
#define BOOST_PROCESS_DETAIL_WINDOWS_HANDLER_HPP_
#include <boost/process/v1/detail/config.hpp>
#include <boost/process/v1/detail/handler_base.hpp>
namespace boost { namespace process { namespace detail { namespace windows {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
//does not extend anything.
struct handler_base_ext : handler_base {};
}}}}
}}}}}

View File

@@ -14,7 +14,7 @@
#include <boost/winapi/handles.hpp>
#include <boost/winapi/handle_info.hpp>
namespace boost { namespace process { namespace detail {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail {
template<typename Executor, typename Function>
@@ -50,7 +50,7 @@ inline std::vector<native_handle_type> get_handles(std::error_code & ec)
if (nt_status < 0 || nt_status > 0x7FFFFFFF)
{
ec = ::boost::process::detail::get_last_error();
ec = ::boost::process::v1::detail::get_last_error();
return {};
}
else
@@ -72,7 +72,7 @@ inline std::vector<native_handle_type> get_handles()
auto res = get_handles(ec);
if (ec)
boost::process::detail::throw_error(ec, "NtQuerySystemInformation failed");
boost::process::v1::detail::throw_error(ec, "NtQuerySystemInformation failed");
return res;
}
@@ -99,7 +99,7 @@ inline bool is_stream_handle(native_handle_type handle, std::error_code & ec)
if (nt_status < 0 || nt_status > 0x7FFFFFFF)
{
ec = ::boost::process::detail::get_last_error();
ec = ::boost::process::v1::detail::get_last_error();
return false;
}
else
@@ -120,7 +120,7 @@ inline bool is_stream_handle(native_handle_type handle)
std::error_code ec;
auto res = is_stream_handle(handle, ec);
if (ec)
boost::process::detail::throw_error(ec, "NtQueryObject failed");
boost::process::v1::detail::throw_error(ec, "NtQueryObject failed");
return res;
}
@@ -173,6 +173,6 @@ struct limit_handles_ : handler_base_ext
};
}}}}
}}}}}
#endif //PROCESS_HANDLES_HPP

View File

@@ -30,7 +30,7 @@
#include <boost/type_index.hpp>
namespace boost { namespace process { namespace detail { namespace windows {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
template<typename Executor>
struct on_exit_handler_transformer
@@ -72,7 +72,7 @@ struct async_handler_collector
};
//Also set's up waiting for the exit, so it can close async stuff.
struct io_context_ref : boost::process::detail::handler_base
struct io_context_ref : boost::process::v1::detail::handler_base
{
io_context_ref(boost::asio::io_context & ios)
@@ -106,7 +106,7 @@ struct io_context_ref : boost::process::detail::handler_base
static_cast<::boost::winapi::BOOL_>(true),
::boost::winapi::DUPLICATE_SAME_ACCESS_))
exec.set_error(::boost::process::detail::get_last_error(),
exec.set_error(::boost::process::v1::detail::get_last_error(),
"Duplicate Pipe Failed");
@@ -167,6 +167,6 @@ private:
boost::asio::io_context &ios;
};
}}}}
}}}}}
#endif /* BOOST_PROCESS_WINDOWS_IO_CONTEXT_REF_HPP_ */

View File

@@ -12,7 +12,7 @@
#include <cstdlib>
#include <boost/winapi/process.hpp>
namespace boost { namespace process { namespace detail { namespace windows {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
constexpr static ::boost::winapi::DWORD_ still_active = 259;
@@ -24,7 +24,7 @@ inline bool is_running(const child_handle &p, int & exit_code, std::error_code &
::boost::winapi::DWORD_ code;
//single value, not needed in the winapi.
if (!::boost::winapi::GetExitCodeProcess(p.process_handle(), &code))
ec = ::boost::process::detail::get_last_error();
ec = ::boost::process::v1::detail::get_last_error();
else
ec.clear();
@@ -41,7 +41,7 @@ inline bool is_running(const child_handle &p, int & exit_code)
{
std::error_code ec;
bool b = is_running(p, exit_code, ec);
boost::process::detail::throw_error(ec, "GetExitCodeProcess() failed in is_running");
boost::process::v1::detail::throw_error(ec, "GetExitCodeProcess() failed in is_running");
return b;
}
@@ -52,6 +52,6 @@ inline bool is_running(int code)
inline int eval_exit_status(int in ) {return in;}
}}}}
}}}}}
#endif

View File

@@ -6,6 +6,7 @@
#ifndef BOOST_PROCESS_DETAIL_WINDOWS_JOB_WORKAROUND_HPP_
#define BOOST_PROCESS_DETAIL_WINDOWS_JOB_WORKAROUND_HPP_
#include <boost/process/v1/detail/config.hpp>
#include <boost/winapi/config.hpp>
#include <boost/winapi/basic_types.hpp>
#include <boost/winapi/dll.hpp>
@@ -33,7 +34,7 @@ BOOST_SYMBOL_IMPORT ::boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC GetQueuedCompl
}
#endif
namespace boost { namespace process { namespace detail { namespace windows { namespace workaround {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows { namespace workaround {
extern "C"
{
@@ -256,6 +257,6 @@ inline ::boost::winapi::BOOL_ set_information_job_object(
constexpr static ::boost::winapi::DWORD_ JOB_OBJECT_LIMIT_BREAKAWAY_OK_ = 0x00000800;
}}}}}
}}}}}}
#endif /* BOOST_PROCESS_DETAIL_WINDOWS_JOB_WORKAROUND_HPP_ */

View File

@@ -7,6 +7,7 @@
#ifndef BOOST_PROCESS_DETAIL_WINDOWS_LOCALE_HPP_
#define BOOST_PROCESS_DETAIL_WINDOWS_LOCALE_HPP_
#include <boost/process/v1/detail/config.hpp>
#include <locale>
#include <boost/core/ignore_unused.hpp>
#include <boost/winapi/file_management.hpp>
@@ -16,6 +17,8 @@ namespace boost
{
namespace process
{
BOOST_PROCESS_V1_INLINE namespace v1
{
namespace detail
{
namespace windows
@@ -105,7 +108,7 @@ class windows_file_codecvt
}
}
}
}
#endif /* BOOST_PROCESS_LOCALE_HPP_ */

View File

@@ -17,9 +17,9 @@
#include <boost/process/v1/detail/used_handles.hpp>
#include <boost/process/v1/detail/windows/file_descriptor.hpp>
namespace boost { namespace process { namespace detail { namespace windows {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
struct null_in : public ::boost::process::detail::handler_base, ::boost::process::detail::uses_handles
struct null_in : public ::boost::process::v1::detail::handler_base, ::boost::process::v1::detail::uses_handles
{
file_descriptor source{"NUL", file_descriptor::read};
@@ -40,6 +40,6 @@ public:
}
};
}}}}
}}}}}
#endif

View File

@@ -17,10 +17,10 @@
#include <boost/process/v1/detail/used_handles.hpp>
#include <boost/process/v1/detail/windows/file_descriptor.hpp>
namespace boost { namespace process { namespace detail { namespace windows {
namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
template<int p1, int p2>
struct null_out : public ::boost::process::detail::handler_base, ::boost::process::detail::uses_handles
struct null_out : public ::boost::process::v1::detail::handler_base, ::boost::process::v1::detail::uses_handles
{
file_descriptor sink {"NUL", file_descriptor::write}; //works because it gets destroyed AFTER launch.
@@ -73,6 +73,6 @@ void null_out<1,2>::on_setup(WindowsExecutor &e) const
}
}}}}
}}}}}
#endif

Some files were not shown because too many files have changed in this diff Show More