diff options
author | Alexander Gluzsky <sss123next@list.ru> | 2013-02-04 16:43:34 +0000 |
---|---|---|
committer | Alexander Gluzsky <sss123next@list.ru> | 2013-02-04 16:43:34 +0000 |
commit | 6a3159197f21b14c2f74584bcbd0d63266b5db47 (patch) | |
tree | e75e6e9ca1cbd9c5839f0af5d1b542216279cf6e /plugins/New_GPG/src/include/boost | |
parent | c32c268ada5d7e265a6f1085cc3e87589f4c1d4a (diff) |
cleanup
usgin older boost api for backward compatibility
git-svn-id: http://svn.miranda-ng.org/main/trunk@3424 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/New_GPG/src/include/boost')
37 files changed, 4 insertions, 1722 deletions
diff --git a/plugins/New_GPG/src/include/boost/process/posix/child.hpp b/plugins/New_GPG/src/include/boost/process/posix/child.hpp deleted file mode 100644 index 913484529e..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/child.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_CHILD_HPP -#define BOOST_PROCESS_POSIX_CHILD_HPP - -#include <sys/types.h> - -namespace boost { namespace process { namespace posix { - -struct child -{ - pid_t pid; - - explicit child(pid_t p) : pid(p) {} -}; - -}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/create_pipe.hpp b/plugins/New_GPG/src/include/boost/process/posix/create_pipe.hpp deleted file mode 100644 index ecdd523516..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/create_pipe.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_CREATE_PIPE_HPP -#define BOOST_PROCESS_POSIX_CREATE_PIPE_HPP - -#include <boost/process/config.hpp> -#include <boost/process/posix/pipe.hpp> -#include <boost/system/error_code.hpp> -#include <unistd.h> - -namespace boost { namespace process { namespace posix { - -inline pipe create_pipe() -{ - int fds[2]; - if (::pipe(fds) == -1) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("pipe(2) failed"); - return pipe(fds[0], fds[1]); -} - -inline pipe create_pipe(boost::system::error_code &ec) -{ - int fds[2]; - if (::pipe(fds) == -1) - BOOST_PROCESS_RETURN_LAST_SYSTEM_ERROR(ec); - else - ec.clear(); - return pipe(fds[0], fds[1]); -} - -}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/execute.hpp b/plugins/New_GPG/src/include/boost/process/posix/execute.hpp deleted file mode 100644 index 27082196c8..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/execute.hpp +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_EXECUTE_HPP -#define BOOST_PROCESS_POSIX_EXECUTE_HPP - -#include <boost/process/posix/executor.hpp> -#include <boost/process/posix/child.hpp> -#include <boost/fusion/tuple/make_tuple.hpp> -#include <boost/ref.hpp> - -namespace boost { namespace process { namespace posix { - -template <class I0> -child execute(const I0 &i0) -{ - return executor()(boost::fusion::make_tuple(boost::cref(i0))); -} - -template <class I0, class I1> -child execute(const I0 &i0, const I1 &i1) -{ - return executor()(boost::fusion::make_tuple(boost::cref(i0), boost::cref(i1))); -} - -template <class I0, class I1, class I2> -child execute(const I0 &i0, const I1 &i1, const I2 &i2) -{ - return executor()(boost::fusion::make_tuple(boost::cref(i0), boost::cref(i1), boost::cref(i2))); -} - -template <class I0, class I1, class I2, class I3> -child execute(const I0 &i0, const I1 &i1, const I2 &i2, const I3 &i3) -{ - return executor()(boost::fusion::make_tuple(boost::cref(i0), boost::cref(i1), boost::cref(i2), boost::cref(i3))); -} - -template <class I0, class I1, class I2, class I3, class I4> -child execute(const I0 &i0, const I1 &i1, const I2 &i2, const I3 &i3, const I4 &i4) -{ - return executor()(boost::fusion::make_tuple(boost::cref(i0), boost::cref(i1), boost::cref(i2), boost::cref(i3), boost::cref(i4))); -} - -template <class I0, class I1, class I2, class I3, class I4, class I5> -child execute(const I0 &i0, const I1 &i1, const I2 &i2, const I3 &i3, const I4 &i4, const I5 &i5) -{ - return executor()(boost::fusion::make_tuple(boost::cref(i0), boost::cref(i1), boost::cref(i2), boost::cref(i3), boost::cref(i4), boost::cref(i5))); -} - -template <class I0, class I1, class I2, class I3, class I4, class I5, class I6> -child execute(const I0 &i0, const I1 &i1, const I2 &i2, const I3 &i3, const I4 &i4, const I5 &i5, const I6 &i6) -{ - return executor()(boost::fusion::make_tuple(boost::cref(i0), boost::cref(i1), boost::cref(i2), boost::cref(i3), boost::cref(i4), boost::cref(i5), boost::cref(i6))); -} - -template <class I0, class I1, class I2, class I3, class I4, class I5, class I6, class I7> -child execute(const I0 &i0, const I1 &i1, const I2 &i2, const I3 &i3, const I4 &i4, const I5 &i5, const I6 &i6, const I7 &i7) -{ - return executor()(boost::fusion::make_tuple(boost::cref(i0), boost::cref(i1), boost::cref(i2), boost::cref(i3), boost::cref(i4), boost::cref(i5), boost::cref(i6), boost::cref(i7))); -} - -template <class I0, class I1, class I2, class I3, class I4, class I5, class I6, class I7, class I8> -child execute(const I0 &i0, const I1 &i1, const I2 &i2, const I3 &i3, const I4 &i4, const I5 &i5, const I6 &i6, const I7 &i7, const I8 &i8) -{ - return executor()(boost::fusion::make_tuple(boost::cref(i0), boost::cref(i1), boost::cref(i2), boost::cref(i3), boost::cref(i4), boost::cref(i5), boost::cref(i6), boost::cref(i7), boost::cref(i8))); -} - -template <class I0, class I1, class I2, class I3, class I4, class I5, class I6, class I7, class I8, class I9> -child execute(const I0 &i0, const I1 &i1, const I2 &i2, const I3 &i3, const I4 &i4, const I5 &i5, const I6 &i6, const I7 &i7, const I8 &i8, const I9 &i9) -{ - return executor()(boost::fusion::make_tuple(boost::cref(i0), boost::cref(i1), boost::cref(i2), boost::cref(i3), boost::cref(i4), boost::cref(i5), boost::cref(i6), boost::cref(i7), boost::cref(i8), boost::cref(i9))); -} - -}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/executor.hpp b/plugins/New_GPG/src/include/boost/process/posix/executor.hpp deleted file mode 100644 index a3e81f128f..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/executor.hpp +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_EXECUTOR_HPP -#define BOOST_PROCESS_POSIX_EXECUTOR_HPP - -#include <boost/process/posix/child.hpp> -#include <boost/fusion/algorithm/iteration/for_each.hpp> -#include <cstdlib> -#include <sys/types.h> -#include <unistd.h> - -namespace boost { namespace process { namespace posix { - -struct executor -{ - executor() : exe(0), cmd_line(0), env(0) {} - - struct call_on_fork_setup - { - executor &e_; - - call_on_fork_setup(executor &e) : e_(e) {} - - template <class Arg> - void operator()(const Arg &arg) const - { - arg.on_fork_setup(e_); - } - }; - - struct call_on_fork_error - { - executor &e_; - - call_on_fork_error(executor &e) : e_(e) {} - - template <class Arg> - void operator()(Arg &arg) const - { - arg.on_fork_error(e_); - } - }; - - struct call_on_fork_success - { - executor &e_; - - call_on_fork_success(executor &e) : e_(e) {} - - template <class Arg> - void operator()(Arg &arg) const - { - arg.on_fork_success(e_); - } - }; - - struct call_on_exec_setup - { - executor &e_; - - call_on_exec_setup(executor &e) : e_(e) {} - - template <class Arg> - void operator()(Arg &arg) const - { - arg.on_exec_setup(e_); - } - }; - - struct call_on_exec_error - { - executor &e_; - - call_on_exec_error(executor &e) : e_(e) {} - - template <class Arg> - void operator()(Arg &arg) const - { - arg.on_exec_error(e_); - } - }; - - template <class InitializerSequence> - child operator()(const InitializerSequence &seq) - { - boost::fusion::for_each(seq, call_on_fork_setup(*this)); - - pid_t pid = ::fork(); - if (pid == -1) - { - boost::fusion::for_each(seq, call_on_fork_error(*this)); - } - else if (pid == 0) - { - boost::fusion::for_each(seq, call_on_exec_setup(*this)); - ::execve(exe, cmd_line, env); - boost::fusion::for_each(seq, call_on_exec_error(*this)); - _exit(EXIT_FAILURE); - } - - boost::fusion::for_each(seq, call_on_fork_success(*this)); - - return child(pid); - } - - const char *exe; - char **cmd_line; - char **env; -}; - -}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers.hpp deleted file mode 100644 index 78295c14cb..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers.hpp +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_HPP - -#include <boost/process/posix/initializers/bind_fd.hpp> -#include <boost/process/posix/initializers/bind_stderr.hpp> -#include <boost/process/posix/initializers/bind_stdin.hpp> -#include <boost/process/posix/initializers/bind_stdout.hpp> -#include <boost/process/posix/initializers/close_fd.hpp> -#include <boost/process/posix/initializers/close_fds.hpp> -#include <boost/process/posix/initializers/close_fds_if.hpp> -#include <boost/process/posix/initializers/close_stderr.hpp> -#include <boost/process/posix/initializers/close_stdin.hpp> -#include <boost/process/posix/initializers/close_stdout.hpp> -#include <boost/process/posix/initializers/hide_console.hpp> -#include <boost/process/posix/initializers/inherit_env.hpp> -#include <boost/process/posix/initializers/notify_io_service.hpp> -#include <boost/process/posix/initializers/on_exec_error.hpp> -#include <boost/process/posix/initializers/on_exec_setup.hpp> -#include <boost/process/posix/initializers/on_fork_error.hpp> -#include <boost/process/posix/initializers/on_fork_setup.hpp> -#include <boost/process/posix/initializers/on_fork_success.hpp> -#include <boost/process/posix/initializers/run_exe.hpp> -#include <boost/process/posix/initializers/set_args.hpp> -#include <boost/process/posix/initializers/set_cmd_line.hpp> -#include <boost/process/posix/initializers/set_env.hpp> -#include <boost/process/posix/initializers/set_on_error.hpp> -#include <boost/process/posix/initializers/start_in_dir.hpp> -#include <boost/process/posix/initializers/throw_on_error.hpp> - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/bind_fd.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/bind_fd.hpp deleted file mode 100644 index 851b7ef3e4..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/bind_fd.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_BIND_FD_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_BIND_FD_HPP - -#include <boost/process/posix/initializers/initializer_base.hpp> -#include <unistd.h> - -namespace boost { namespace process { namespace posix { namespace initializers { - -template <class FileDescriptor> -class bind_fd_ : public initializer_base -{ -public: - bind_fd_(int id, const FileDescriptor &fd) : id_(id), fd_(fd) {} - - template <class PosixExecutor> - void on_exec_setup(PosixExecutor&) const - { - ::dup2(fd_.handle(), id_); - } - -private: - int id_; - FileDescriptor fd_; -}; - -template <class FileDescriptor> -bind_fd_<FileDescriptor> bind_fd(int id, const FileDescriptor &fd) -{ - return bind_fd_<FileDescriptor>(id, fd); -} - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/bind_stderr.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/bind_stderr.hpp deleted file mode 100644 index be767bf2fe..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/bind_stderr.hpp +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_BIND_STDERR_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_BIND_STDERR_HPP - -#include <boost/process/posix/initializers/initializer_base.hpp> -#include <boost/iostreams/device/file_descriptor.hpp> -#include <unistd.h> - -namespace boost { namespace process { namespace posix { namespace initializers { - -class bind_stderr : public initializer_base -{ -public: - explicit bind_stderr(const boost::iostreams::file_descriptor_sink &sink) - : sink_(sink) {} - - template <class PosixExecutor> - void on_exec_setup(PosixExecutor&) const - { - ::dup2(sink_.handle(), STDERR_FILENO); - } - -private: - boost::iostreams::file_descriptor_sink sink_; -}; - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/bind_stdin.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/bind_stdin.hpp deleted file mode 100644 index b592d6f8b3..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/bind_stdin.hpp +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_BIND_STDIN_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_BIND_STDIN_HPP - -#include <boost/process/posix/initializers/initializer_base.hpp> -#include <boost/iostreams/device/file_descriptor.hpp> -#include <unistd.h> - -namespace boost { namespace process { namespace posix { namespace initializers { - -class bind_stdin : public initializer_base -{ -public: - explicit bind_stdin(const boost::iostreams::file_descriptor_source &source) - : source_(source) {} - - template <class PosixExecutor> - void on_exec_setup(PosixExecutor&) const - { - ::dup2(source_.handle(), STDIN_FILENO); - } - -private: - boost::iostreams::file_descriptor_source source_; -}; - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/bind_stdout.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/bind_stdout.hpp deleted file mode 100644 index a2c316d997..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/bind_stdout.hpp +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_BIND_STDOUT_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_BIND_STDOUT_HPP - -#include <boost/process/posix/initializers/initializer_base.hpp> -#include <boost/iostreams/device/file_descriptor.hpp> -#include <unistd.h> - -namespace boost { namespace process { namespace posix { namespace initializers { - -class bind_stdout : public initializer_base -{ -public: - explicit bind_stdout(const boost::iostreams::file_descriptor_sink &sink) - : sink_(sink) {} - - template <class PosixExecutor> - void on_exec_setup(PosixExecutor&) const - { - ::dup2(sink_.handle(), STDOUT_FILENO); - } - -private: - boost::iostreams::file_descriptor_sink sink_; -}; - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/close_fd.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/close_fd.hpp deleted file mode 100644 index fd516e4100..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/close_fd.hpp +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_CLOSE_FD_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_CLOSE_FD_HPP - -#include <boost/process/posix/initializers/initializer_base.hpp> -#include <unistd.h> - -namespace boost { namespace process { namespace posix { namespace initializers { - -class close_fd : public initializer_base -{ -public: - explicit close_fd(int fd) : fd_(fd) {} - - template <class PosixExecutor> - void on_exec_setup(PosixExecutor&) const - { - ::close(fd_); - } - -private: - int fd_; -}; - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/close_fds.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/close_fds.hpp deleted file mode 100644 index 2fa338501e..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/close_fds.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_CLOSE_FDS_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_CLOSE_FDS_HPP - -#include <boost/process/posix/initializers/initializer_base.hpp> -#include <boost/range/algorithm/for_each.hpp> -#include <unistd.h> - -namespace boost { namespace process { namespace posix { namespace initializers { - -template <class Range> -class close_fds_ : public initializer_base -{ -public: - explicit close_fds_(const Range &fds) : fds_(fds) {} - - template <class PosixExecutor> - void on_exec_setup(PosixExecutor&) const - { - boost::for_each(fds_, ::close); - } - -private: - Range fds_; -}; - -template <class Range> -close_fds_<Range> close_fds(const Range &fds) -{ - return close_fds_<Range>(fds); -} - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/close_fds_if.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/close_fds_if.hpp deleted file mode 100644 index fb3a651d62..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/close_fds_if.hpp +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_CLOSE_FDS_IF_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_CLOSE_FDS_IF_HPP - -#include <boost/process/posix/initializers/initializer_base.hpp> -#include <boost/iterator/counting_iterator.hpp> -#include <boost/range/counting_range.hpp> -#include <boost/range/adaptor/filtered.hpp> -#include <boost/range/algorithm/for_each.hpp> -#include <unistd.h> -#include <fcntl.h> -#include <errno.h> - -#ifndef BOOST_PROCESS_POSIX_MAX_FD -# define BOOST_PROCESS_POSIX_MAX_FD 32 -#endif - -namespace boost { namespace process { namespace posix { namespace initializers { - -template <class Predicate> -class close_fds_if_ : public initializer_base -{ -private: - static void close(int fd) - { - ::fcntl(fd, F_SETFD, FD_CLOEXEC); - } - -public: - explicit close_fds_if_(const Predicate &pred) : pred_(pred) {} - - template <class PosixExecutor> - void on_exec_setup(PosixExecutor&) const - { - boost::for_each( - boost::adaptors::filter( - boost::counting_range(0, upper_bound()), - pred_ - ), - close - ); - } - -private: - static int upper_bound() - { - int up; -#if defined(F_MAXFD) - do - { - up = ::fcntl(0, F_MAXFD); - } while (up == -1 && errno == EINTR); - if (up == -1) -#endif - up = ::sysconf(_SC_OPEN_MAX); - if (up == -1) - up = BOOST_PROCESS_POSIX_MAX_FD; - return up; - } - - Predicate pred_; -}; - -template <class Predicate> -close_fds_if_<Predicate> close_fds_if(const Predicate &pred) -{ - return close_fds_if_<Predicate>(pred); -} - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/close_stderr.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/close_stderr.hpp deleted file mode 100644 index 1a4c2ad00d..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/close_stderr.hpp +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_CLOSE_STDERR_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_CLOSE_STDERR_HPP - -#include <boost/process/posix/initializers/initializer_base.hpp> -#include <unistd.h> - -namespace boost { namespace process { namespace posix { namespace initializers { - -class close_stderr : public initializer_base -{ -public: - template <class PosixExecutor> - void on_exec_setup(PosixExecutor&) const - { - ::close(STDERR_FILENO); - } -}; - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/close_stdin.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/close_stdin.hpp deleted file mode 100644 index 021c3ec54d..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/close_stdin.hpp +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_CLOSE_STDIN_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_CLOSE_STDIN_HPP - -#include <boost/process/posix/initializers/initializer_base.hpp> -#include <unistd.h> - -namespace boost { namespace process { namespace posix { namespace initializers { - -class close_stdin : public initializer_base -{ -public: - template <class PosixExecutor> - void on_exec_setup(PosixExecutor&) const - { - ::close(STDIN_FILENO); - } -}; - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/close_stdout.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/close_stdout.hpp deleted file mode 100644 index cfab7d1d62..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/close_stdout.hpp +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_CLOSE_STDOUT_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_CLOSE_STDOUT_HPP - -#include <boost/process/posix/initializers/initializer_base.hpp> -#include <unistd.h> - -namespace boost { namespace process { namespace posix { namespace initializers { - -class close_stdout : public initializer_base -{ -public: - template <class PosixExecutor> - void on_exec_setup(PosixExecutor&) const - { - ::close(STDOUT_FILENO); - } -}; - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/hide_console.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/hide_console.hpp deleted file mode 100644 index 20d527b457..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/hide_console.hpp +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_HIDE_CONSOLE_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_HIDE_CONSOLE_HPP - -#include <boost/process/posix/initializers/initializer_base.hpp> - -namespace boost { namespace process { namespace posix { namespace initializers { - -class hide_console : public initializer_base -{ -public: -}; - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/inherit_env.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/inherit_env.hpp deleted file mode 100644 index bc73c8571f..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/inherit_env.hpp +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_INHERIT_ENV_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_INHERIT_ENV_HPP - -#include <boost/process/posix/initializers/initializer_base.hpp> -// From <https://svn.boost.org/trac/boost/changeset/67768> -#if defined(__APPLE__) && defined(__DYNAMIC__) -extern "C" { extern char ***_NSGetEnviron(void); } -# define environ (*_NSGetEnviron()) -#else -# include <unistd.h> -#endif - -namespace boost { namespace process { namespace posix { namespace initializers { - -class inherit_env : public initializer_base -{ -public: - template <class PosixExecutor> - void on_fork_setup(PosixExecutor &e) const - { - e.env = environ; - } -}; - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/initializer_base.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/initializer_base.hpp deleted file mode 100644 index 775f00e48c..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/initializer_base.hpp +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_INITIALIZER_BASE_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_INITIALIZER_BASE_HPP - -namespace boost { namespace process { namespace posix { namespace initializers { - -struct initializer_base -{ - template <class PosixExecutor> - void on_fork_setup(PosixExecutor&) const {} - - template <class PosixExecutor> - void on_fork_error(PosixExecutor&) const {} - - template <class PosixExecutor> - void on_fork_success(PosixExecutor&) const {} - - template <class PosixExecutor> - void on_exec_setup(PosixExecutor&) const {} - - template <class PosixExecutor> - void on_exec_error(PosixExecutor&) const {} -}; - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/notify_io_service.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/notify_io_service.hpp deleted file mode 100644 index d94f674c81..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/notify_io_service.hpp +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_NOTIFY_IO_SERVICE_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_NOTIFY_IO_SERVICE_HPP - -#include <boost/process/config.hpp> -#include <boost/process/posix/initializers/initializer_base.hpp> - -namespace boost { namespace process { namespace posix { namespace initializers { - -template <class IOService> -class notify_io_service_ : public initializer_base -{ -public: - explicit notify_io_service_(IOService &io_service) : - io_service_(io_service) {} - - template <class PosixExecutor> - void on_fork_setup(PosixExecutor&) const - { - io_service_.notify_fork(IOService::fork_prepare); - } - - template <class PosixExecutor> - void on_fork_success(PosixExecutor&) const - { - io_service_.notify_fork(IOService::fork_parent); - } - - template <class PosixExecutor> - void on_exec_setup(PosixExecutor&) const - { - io_service_.notify_fork(IOService::fork_child); - } - -private: - IOService &io_service_; -}; - -template <class IOService> -notify_io_service_<IOService> notify_io_service(IOService &io_service) -{ - return notify_io_service_<IOService>(io_service); -} - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/on_exec_error.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/on_exec_error.hpp deleted file mode 100644 index 63b56def4f..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/on_exec_error.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_ON_EXEC_ERROR_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_ON_EXEC_ERROR_HPP - -#include <boost/process/config.hpp> -#include <boost/process/posix/initializers/initializer_base.hpp> - -namespace boost { namespace process { namespace posix { namespace initializers { - -template <class Handler> -class on_exec_error_ : public initializer_base -{ -public: - explicit on_exec_error_(Handler handler) : handler_(handler) {} - - template <class PosixExecutor> - void on_exec_error(PosixExecutor &e) const - { - handler_(e); - } - -private: - Handler handler_; -}; - -template <class Handler> -on_exec_error_<Handler> on_exec_error(Handler handler) -{ - return on_exec_error_<Handler>(handler); -} - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/on_exec_setup.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/on_exec_setup.hpp deleted file mode 100644 index 50f5f3736b..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/on_exec_setup.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_ON_EXEC_SETUP_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_ON_EXEC_SETUP_HPP - -#include <boost/process/config.hpp> -#include <boost/process/posix/initializers/initializer_base.hpp> - -namespace boost { namespace process { namespace posix { namespace initializers { - -template <class Handler> -class on_exec_setup_ : public initializer_base -{ -public: - explicit on_exec_setup_(Handler handler) : handler_(handler) {} - - template <class PosixExecutor> - void on_exec_setup(PosixExecutor &e) const - { - handler_(e); - } - -private: - Handler handler_; -}; - -template <class Handler> -on_exec_setup_<Handler> on_exec_setup(Handler handler) -{ - return on_exec_setup_<Handler>(handler); -} - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/on_fork_error.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/on_fork_error.hpp deleted file mode 100644 index 42ecf1aac9..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/on_fork_error.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_ON_FORK_ERROR_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_ON_FORK_ERROR_HPP - -#include <boost/process/config.hpp> -#include <boost/process/posix/initializers/initializer_base.hpp> - -namespace boost { namespace process { namespace posix { namespace initializers { - -template <class Handler> -class on_fork_error_ : public initializer_base -{ -public: - explicit on_fork_error_(Handler handler) : handler_(handler) {} - - template <class PosixExecutor> - void on_fork_error(PosixExecutor &e) const - { - handler_(e); - } - -private: - Handler handler_; -}; - -template <class Handler> -on_fork_error_<Handler> on_fork_error(Handler handler) -{ - return on_fork_error_<Handler>(handler); -} - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/on_fork_setup.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/on_fork_setup.hpp deleted file mode 100644 index c0c5b0682f..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/on_fork_setup.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_ON_FORK_SETUP_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_ON_FORK_SETUP_HPP - -#include <boost/process/config.hpp> -#include <boost/process/posix/initializers/initializer_base.hpp> - -namespace boost { namespace process { namespace posix { namespace initializers { - -template <class Handler> -class on_fork_setup_ : public initializer_base -{ -public: - explicit on_fork_setup_(Handler handler) : handler_(handler) {} - - template <class PosixExecutor> - void on_fork_setup(PosixExecutor &e) const - { - handler_(e); - } - -private: - Handler handler_; -}; - -template <class Handler> -on_fork_setup_<Handler> on_fork_setup(Handler handler) -{ - return on_fork_setup_<Handler>(handler); -} - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/on_fork_success.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/on_fork_success.hpp deleted file mode 100644 index 01c9b12db0..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/on_fork_success.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_ON_FORK_SUCCESS_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_ON_FORK_SUCCESS_HPP - -#include <boost/process/config.hpp> -#include <boost/process/posix/initializers/initializer_base.hpp> - -namespace boost { namespace process { namespace posix { namespace initializers { - -template <class Handler> -class on_fork_success_ : public initializer_base -{ -public: - explicit on_fork_success_(Handler handler) : handler_(handler) {} - - template <class PosixExecutor> - void on_fork_success(PosixExecutor &e) const - { - handler_(e); - } - -private: - Handler handler_; -}; - -template <class Handler> -on_fork_success_<Handler> on_fork_success(Handler handler) -{ - return on_fork_success_<Handler>(handler); -} - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/run_exe.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/run_exe.hpp deleted file mode 100644 index 6cceeea8c1..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/run_exe.hpp +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_RUN_EXE_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_RUN_EXE_HPP - -#include <boost/process/posix/initializers/initializer_base.hpp> -#include <boost/filesystem.hpp> -#include <boost/shared_array.hpp> -#include <string> - -namespace boost { namespace process { namespace posix { namespace initializers { - -class run_exe_ : public initializer_base -{ -public: - explicit run_exe_(const std::string &s) : s_(s), cmd_line_(new char*[2]) - { - cmd_line_[0] = const_cast<char*>(s_.c_str()); - cmd_line_[1] = 0; - } - - template <class PosixExecutor> - void on_exec_setup(PosixExecutor &e) const - { - e.exe = s_.c_str(); - if (!e.cmd_line) - e.cmd_line = cmd_line_.get(); - } - -private: - std::string s_; - boost::shared_array<char*> cmd_line_; -}; - -inline run_exe_ run_exe(const char *s) -{ - return run_exe_(s); -} - -inline run_exe_ run_exe(const std::string &s) -{ - return run_exe_(s); -} - -inline run_exe_ run_exe(const boost::filesystem::path &p) -{ - return run_exe_(p.string()); -} - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/set_args.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/set_args.hpp deleted file mode 100644 index 294926dc22..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/set_args.hpp +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_SET_ARGS_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_SET_ARGS_HPP - -#include <boost/process/posix/initializers/initializer_base.hpp> -#include <boost/range/algorithm/transform.hpp> -#include <boost/shared_array.hpp> -#include <string> - -namespace boost { namespace process { namespace posix { namespace initializers { - -template <class Range> -class set_args_ : public initializer_base -{ -private: - static char *c_str(const std::string &s) - { - return const_cast<char*>(s.c_str()); - } - -public: - explicit set_args_(const Range &args) - { - args_.reset(new char*[args.size() + 1]); - boost::transform(args, args_.get(), c_str); - args_[args.size()] = 0; - } - - template <class PosixExecutor> - void on_exec_setup(PosixExecutor &e) const - { - e.cmd_line = args_.get(); - if (!e.exe && *args_[0]) - e.exe = args_[0]; - } - -private: - boost::shared_array<char*> args_; -}; - -template <class Range> -set_args_<Range> set_args(const Range &range) -{ - return set_args_<Range>(range); -} - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/set_cmd_line.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/set_cmd_line.hpp deleted file mode 100644 index 0f59d25359..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/set_cmd_line.hpp +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_SET_CMD_LINE_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_SET_CMD_LINE_HPP - -#include <boost/process/posix/initializers/initializer_base.hpp> -#include <boost/tokenizer.hpp> -#include <boost/shared_array.hpp> -#include <string> -#include <vector> - -namespace boost { namespace process { namespace posix { namespace initializers { - -class set_cmd_line : public initializer_base -{ -private: - static char *c_str(const std::string &s) - { - return const_cast<char*>(s.c_str()); - } - -public: - explicit set_cmd_line(const std::string &s) - { - typedef boost::tokenizer<boost::escaped_list_separator<char> > tokenizer; - boost::escaped_list_separator<char> sep('\\', ' ', '\"'); - tokenizer tok(s, sep); - args_.assign(tok.begin(), tok.end()); - cmd_line_.reset(new char*[args_.size() + 1]); - boost::transform(args_, cmd_line_.get(), c_str); - cmd_line_[args_.size()] = 0; - } - - template <class PosixExecutor> - void on_exec_setup(PosixExecutor &e) const - { - e.cmd_line = cmd_line_.get(); - } - -private: - std::vector<std::string> args_; - boost::shared_array<char*> cmd_line_; -}; - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/set_env.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/set_env.hpp deleted file mode 100644 index 76649184f3..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/set_env.hpp +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_SET_ENV_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_SET_ENV_HPP - -#include <boost/process/posix/initializers/initializer_base.hpp> -#include <boost/range/algorithm/transform.hpp> -#include <boost/shared_array.hpp> -#include <string> - -namespace boost { namespace process { namespace posix { namespace initializers { - -template <class Range> -class set_env_ : public initializer_base -{ -private: - static char *get_ptr(const std::string &s) - { - return const_cast<char*>(s.c_str()); - } - -public: - explicit set_env_(const Range &envs) : env_(new char*[envs.size() + 1]) - { - boost::transform(envs, env_.get(), get_ptr); - env_[envs.size()] = 0; - } - - template <class PosixExecutor> - void on_fork_setup(PosixExecutor &e) const - { - e.env = env_.get(); - } - -private: - boost::shared_array<char*> env_; -}; - -template <class Range> -set_env_<Range> set_env(const Range &envs) -{ - return set_env_<Range>(envs); -} - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/set_on_error.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/set_on_error.hpp deleted file mode 100644 index c01a816e60..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/set_on_error.hpp +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_SET_ON_ERROR_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_SET_ON_ERROR_HPP - -#include <boost/process/config.hpp> -#include <boost/process/posix/initializers/initializer_base.hpp> -#include <boost/system/error_code.hpp> -#include <unistd.h> -#include <fcntl.h> -#include <errno.h> - -namespace boost { namespace process { namespace posix { namespace initializers { - -class set_on_error : public initializer_base -{ -public: - explicit set_on_error(boost::system::error_code &ec) : ec_(ec) {} - - template <class PosixExecutor> - void on_fork_setup(PosixExecutor&) const - { - if (::pipe(fds_) == -1) - BOOST_PROCESS_RETURN_LAST_SYSTEM_ERROR(ec_); - if (::fcntl(fds_[1], F_SETFD, FD_CLOEXEC) == -1) - { - BOOST_PROCESS_RETURN_LAST_SYSTEM_ERROR(ec_); - ::close(fds_[0]); - ::close(fds_[1]); - } - } - - template <class PosixExecutor> - void on_fork_error(PosixExecutor&) const - { - if (!ec_) - { - BOOST_PROCESS_RETURN_LAST_SYSTEM_ERROR(ec_); - ::close(fds_[0]); - ::close(fds_[1]); - } - } - - template <class PosixExecutor> - void on_fork_success(PosixExecutor&) const - { - if (!ec_) - { - ::close(fds_[1]); - int code; - if (::read(fds_[0], &code, sizeof(int)) > 0) - { - ec_ = boost::system::error_code(code, - boost::system::system_category()); - } - ::close(fds_[0]); - } - } - - template <class PosixExecutor> - void on_exec_setup(PosixExecutor&) const - { - if (!ec_) - { - ::close(fds_[0]); - } - } - - template <class PosixExecutor> - void on_exec_error(PosixExecutor&) const - { - if (!ec_) - { - int e = errno; - while (::write(fds_[1], &e, sizeof(int)) == -1 && errno == EINTR) - ; - ::close(fds_[1]); - } - } - -private: - boost::system::error_code &ec_; - mutable int fds_[2]; -}; - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/start_in_dir.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/start_in_dir.hpp deleted file mode 100644 index 187b5a31f4..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/start_in_dir.hpp +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_START_IN_DIR_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_START_IN_DIR_HPP - -#include <boost/process/posix/initializers/initializer_base.hpp> -#include <string> -#include <unistd.h> - -namespace boost { namespace process { namespace posix { namespace initializers { - -class start_in_dir : public initializer_base -{ -public: - explicit start_in_dir(const std::string &s) : s_(s) {} - - template <class PosixExecutor> - void on_exec_setup(PosixExecutor&) const - { - ::chdir(s_.c_str()); - } - -private: - std::string s_; -}; - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/initializers/throw_on_error.hpp b/plugins/New_GPG/src/include/boost/process/posix/initializers/throw_on_error.hpp deleted file mode 100644 index 7734c19e30..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/initializers/throw_on_error.hpp +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_INITIALIZERS_THROW_ON_ERROR_HPP -#define BOOST_PROCESS_POSIX_INITIALIZERS_THROW_ON_ERROR_HPP - -#include <boost/process/config.hpp> -#include <boost/process/posix/initializers/initializer_base.hpp> -#include <boost/system/error_code.hpp> -#include <boost/system/system_error.hpp> -#include <unistd.h> -#include <fcntl.h> -#include <errno.h> - -namespace boost { namespace process { namespace posix { namespace initializers { - -class throw_on_error : public initializer_base -{ -public: - template <class PosixExecutor> - void on_fork_setup(PosixExecutor&) const - { - if (::pipe(fds_) == -1) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("pipe(2) failed"); - if (::fcntl(fds_[1], F_SETFD, FD_CLOEXEC) == -1) - { - int e = errno; - ::close(fds_[0]); - ::close(fds_[1]); - BOOST_PROCESS_THROW(boost::system::system_error( - boost::system::error_code(e, boost::system::system_category()), - BOOST_PROCESS_SOURCE_LOCATION "fcntl(2) failed")); - } - } - - template <class PosixExecutor> - void on_fork_error(PosixExecutor&) const - { - int e = errno; - ::close(fds_[0]); - ::close(fds_[1]); - BOOST_PROCESS_THROW(boost::system::system_error( - boost::system::error_code(e, boost::system::system_category()), - BOOST_PROCESS_SOURCE_LOCATION "fork(2) failed")); - } - - template <class PosixExecutor> - void on_fork_success(PosixExecutor&) const - { - ::close(fds_[1]); - int code; - if (::read(fds_[0], &code, sizeof(int)) > 0) - { - ::close(fds_[0]); - BOOST_PROCESS_THROW(boost::system::system_error( - boost::system::error_code(code, - boost::system::system_category()), - BOOST_PROCESS_SOURCE_LOCATION "execve(2) failed")); - } - ::close(fds_[0]); - } - - template <class PosixExecutor> - void on_exec_setup(PosixExecutor&) const - { - ::close(fds_[0]); - } - - template <class PosixExecutor> - void on_exec_error(PosixExecutor&) const - { - int e = errno; - while (::write(fds_[1], &e, sizeof(int)) == -1 && errno == EINTR) - ; - ::close(fds_[1]); - } - -private: - mutable int fds_[2]; -}; - -}}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/pipe.hpp b/plugins/New_GPG/src/include/boost/process/posix/pipe.hpp deleted file mode 100644 index ca5b29447a..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/pipe.hpp +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_PIPE_HPP -#define BOOST_PROCESS_POSIX_PIPE_HPP - -namespace boost { namespace process { namespace posix { - -struct pipe -{ - int source; - int sink; - - pipe(int source, int sink) : source(source), sink(sink) {} -}; - -inline pipe make_pipe(int source, int sink) -{ - return pipe(source, sink); -} - -}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/search_path.hpp b/plugins/New_GPG/src/include/boost/process/posix/search_path.hpp deleted file mode 100644 index 6dc2bea063..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/search_path.hpp +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_SEARCH_PATH_HPP -#define BOOST_PROCESS_POSIX_SEARCH_PATH_HPP - -#include <boost/process/config.hpp> -#include <boost/filesystem.hpp> -#include <boost/tokenizer.hpp> -#include <string> -#include <stdexcept> -#include <stdlib.h> -#include <unistd.h> - -namespace boost { namespace process { namespace posix { - -inline std::string search_path(const std::string &filename, - std::string path = "") -{ - if (path.empty()) - { - path = ::getenv("PATH"); - if (path.empty()) - BOOST_PROCESS_THROW(std::runtime_error( - "Environment variable PATH not found")); - } - - std::string result; - typedef boost::tokenizer<boost::char_separator<char> > tokenizer; - boost::char_separator<char> sep(":"); - tokenizer tok(path, sep); - for (tokenizer::iterator it = tok.begin(); it != tok.end(); ++it) - { - boost::filesystem::path p = *it; - p /= filename; - if (!::access(p.c_str(), X_OK)) - { - result = p.string(); - break; - } - } - return result; -} - -}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/shell_path.hpp b/plugins/New_GPG/src/include/boost/process/posix/shell_path.hpp deleted file mode 100644 index 3e21e75759..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/shell_path.hpp +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_SHELL_PATH_HPP -#define BOOST_PROCESS_POSIX_SHELL_PATH_HPP - -#include <boost/process/config.hpp> -#include <boost/system/error_code.hpp> -#include <boost/filesystem/path.hpp> - -namespace boost { namespace process { namespace posix { - -inline boost::filesystem::path shell_path() -{ - return "/bin/sh"; -} - -inline boost::filesystem::path shell_path(boost::system::error_code &ec) -{ - ec.clear(); - return "/bin/sh"; -} - -}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/terminate.hpp b/plugins/New_GPG/src/include/boost/process/posix/terminate.hpp deleted file mode 100644 index 9be087df25..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/terminate.hpp +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_TERMINATE_HPP -#define BOOST_PROCESS_POSIX_TERMINATE_HPP - -#include <boost/process/config.hpp> -#include <boost/system/error_code.hpp> -#include <signal.h> - -namespace boost { namespace process { namespace posix { - -template <class Process> -void terminate(const Process &p) -{ - if (::kill(p.pid, SIGKILL) == -1) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("kill(2) failed"); -} - -template <class Process> -void terminate(const Process &p, boost::system::error_code &ec) -{ - if (::kill(p.pid, SIGKILL) == -1) - BOOST_PROCESS_RETURN_LAST_SYSTEM_ERROR(ec); - else - ec.clear(); -} - -}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/posix/wait_for_exit.hpp b/plugins/New_GPG/src/include/boost/process/posix/wait_for_exit.hpp deleted file mode 100644 index d2b946c262..0000000000 --- a/plugins/New_GPG/src/include/boost/process/posix/wait_for_exit.hpp +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_POSIX_WAIT_FOR_EXIT_HPP -#define BOOST_PROCESS_POSIX_WAIT_FOR_EXIT_HPP - -#include <boost/process/config.hpp> -#include <boost/system/error_code.hpp> -#include <sys/types.h> -#include <sys/wait.h> - -namespace boost { namespace process { namespace posix { - -template <class Process> -inline int wait_for_exit(const Process &p) -{ - pid_t ret; - int status; - do - { - ret = ::waitpid(p.pid, &status, 0); - } while ((ret == -1 && errno == EINTR) || (ret != -1 && !WIFEXITED(status))); - if (ret == -1) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("waitpid(2) failed"); - return status; -} - -template <class Process> -inline int wait_for_exit(const Process &p, boost::system::error_code &ec) -{ - pid_t ret; - int status; - do - { - ret = ::waitpid(p.pid, &status, 0); - } while ((ret == -1 && errno == EINTR) || (ret != -1 && !WIFEXITED(status))); - if (ret == -1) - BOOST_PROCESS_RETURN_LAST_SYSTEM_ERROR(ec); - else - ec.clear(); - return status; -} - -}}} - -#endif diff --git a/plugins/New_GPG/src/include/boost/process/windows/search_path.hpp b/plugins/New_GPG/src/include/boost/process/windows/search_path.hpp index 62bb5f2745..ceb9c6f7c2 100644..100755 --- a/plugins/New_GPG/src/include/boost/process/windows/search_path.hpp +++ b/plugins/New_GPG/src/include/boost/process/windows/search_path.hpp @@ -42,13 +42,13 @@ inline std::wstring search_path(const std::wstring &filename, { boost::filesystem::path p = *it; p /= filename; - boost::array<std::wstring, 4> extensions = - { L"", L".exe", L".com", L".bat" }; - for (boost::array<std::wstring, 4>::iterator it2 = extensions.begin(); + boost::array<std::string, 4> extensions = + { "", ".exe", ".com", ".bat" }; + for (boost::array<std::string, 4>::iterator it2 = extensions.begin(); it2 != extensions.end(); ++it2) { boost::filesystem::path p2 = p; - p2 += *it2; + p2 /= (std::string)*it2; boost::system::error_code ec; bool file = boost::filesystem::is_regular_file(p2, ec); if (!ec && file && |