Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62025 - in sandbox/SOC/2010/process: boost boost/process/detail libs/process/example
From: fotanus_at_[hidden]
Date: 2010-05-16 02:59:55


Author: fotanus
Date: 2010-05-16 02:59:54 EDT (Sun, 16 May 2010)
New Revision: 62025
URL: http://svn.boost.org/trac/boost/changeset/62025

Log:
Some adjustments on POSIX for the new organization

Text files modified:
   sandbox/SOC/2010/process/boost/process.hpp | 8 +++++
   sandbox/SOC/2010/process/boost/process/detail/posix_helpers.hpp | 49 ++++++++++++++----------------
   sandbox/SOC/2010/process/boost/process/detail/stream_detail.hpp | 64 ++++++++++++++++++++--------------------
   sandbox/SOC/2010/process/libs/process/example/create_process.cpp | 2
   4 files changed, 64 insertions(+), 59 deletions(-)

Modified: sandbox/SOC/2010/process/boost/process.hpp
==============================================================================
--- sandbox/SOC/2010/process/boost/process.hpp (original)
+++ sandbox/SOC/2010/process/boost/process.hpp 2010-05-16 02:59:54 EDT (Sun, 16 May 2010)
@@ -51,4 +51,12 @@
 #include <boost/process/status.hpp>
 #include <boost/process/stream_behavior.hpp>
 */
+#include <boost/process/child.hpp>
+#include <boost/process/context.hpp>
+#include <boost/process/operations.hpp>
+#include <boost/process/pistream.hpp>
+#include <boost/process/postream.hpp>
+#include <boost/process/process.hpp>
+#include <boost/process/status.hpp>
+#include <boost/process/stream_behavior.hpp>
 #endif

Modified: sandbox/SOC/2010/process/boost/process/detail/posix_helpers.hpp
==============================================================================
--- sandbox/SOC/2010/process/boost/process/detail/posix_helpers.hpp (original)
+++ sandbox/SOC/2010/process/boost/process/detail/posix_helpers.hpp 2010-05-16 02:59:54 EDT (Sun, 16 May 2010)
@@ -11,31 +11,28 @@
 //
 
 /**
- * \file boost/process/detail/helper_functions.hpp
+ * \file boost/process/detail/posix_helper.hpp
  *
- * Includes the declaration of helper functions for the operations in a win32 system.
+ * Includes the declaration of helper functions for the operations in a posix system.
  * It's for internal purposes.
  *
  */
 
-#include <boost/process/detail/file_handle.hpp>
-#include <boost/process/detail/pipe.hpp>
-#include <boost/scoped_ptr.hpp>
-#include <boost/shared_array.hpp>
-#include <boost/scoped_array.hpp>
-#include <boost/assert.hpp>
-#include <boost/system/system_error.hpp>
-#include <boost/throw_exception.hpp>
-#include <vector>
-#include <string>
-#include <cstddef>
-#include <string.h>
-#include <windows.h>
 
+#if defined(BOOST_POSIX_API)
+ #include <unistd.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+#endif
+#include <map>
+#include <string.h>
+#include <boost/optional.hpp>
+#include <boost/process/stream_behavior.hpp>
+#include <boost/process/detail/stream_detail.hpp>
 
 
-#ifndef BOOST_PROCESS_WIN32_HELPERS_HPP
-#define BOOST_PROCESS_WIN32_HELPERS_HPP
+#ifndef BOOST_PROCESS_POSIX_HELPERS_HPP
+#define BOOST_PROCESS_POSIX_HELPERS_HPP
 namespace boost{
 namespace process{
 namespace detail{
@@ -49,22 +46,22 @@
  * Note that this function is meant to be called on a brand-new child.
  *
  */
-inline void configure_stream(stream_detail &s){
+inline configure_posix_stream(stream_detail &s){
 
         switch(s.behavior){
- case dummy:{
+ case dummy:{
 
- char null_file[10];
- if(s.stream_type == stdin_type)
- null_file = "/dev/null";
- else
- null_file = "/dev/zero";
+ std::string null_file;
+ if(s.stream_type == stdin_type)
+ null_file = "/dev/null";
+ else
+ null_file = "/dev/zero";
 
                         int fd;
                         if(s.stream_type == stdin_type)
- fd = ::open(null_file, O_RDONLY);
+ fd = ::open(null_file.c_str(), O_RDONLY);
                         else
- fd = ::open(null_file, O_WRONLY);
+ fd = ::open(null_file.c_str(), O_WRONLY);
 
                         if (fd == -1)
                                 boost::throw_exception(boost::system::system_error(boost::system::error_code(errno, boost::system::get_system_category()), "boost::process::detail::setup_input: open(2) of " + s.object.file_ + " failed"));

Modified: sandbox/SOC/2010/process/boost/process/detail/stream_detail.hpp
==============================================================================
--- sandbox/SOC/2010/process/boost/process/detail/stream_detail.hpp (original)
+++ sandbox/SOC/2010/process/boost/process/detail/stream_detail.hpp 2010-05-16 02:59:54 EDT (Sun, 16 May 2010)
@@ -74,38 +74,38 @@
         std_stream_type stream_type;
         stream_behavior behavior;
 
- stream_detail(std_stream_type st){
- switch(st){
- case stdin_type:{
- stream_type = st;
-
- #if defined(BOOST_POSIX_API)
- stream_handler = STDIN_FILENO;
- #elif defined(BOOST_WINDOWS_API)
- stream_handler = STD_INPUT_HANDLE;
- #endif
- }
- case stdout_type:{
- stream_type = st;
-
- #if defined(BOOST_POSIX_API)
- stream_handler = STDOUT_FILENO;
- #elif defined(BOOST_WINDOWS_API)
- stream_handler = STD_OUTPUT_HANDLE;
- #endif
- }
- case stderr_type:{
- stream_type = st;
-
- #if defined(BOOST_POSIX_API)
- stream_handler = STDERR_FILENO;
- #elif defined(BOOST_WINDOWS_API)
- stream_handler = STD_ERROR_HANDLE;
- #endif
- }
-
- }
- }
+ stream_detail(std_stream_type st){
+ switch(st){
+ case stdin_type:{
+ stream_type = st;
+
+ #if defined(BOOST_POSIX_API)
+ stream_handler = STDIN_FILENO;
+ #elif defined(BOOST_WINDOWS_API)
+ stream_handler = STD_INPUT_HANDLE;
+ #endif
+ }
+ case stdout_type:{
+ stream_type = st;
+
+ #if defined(BOOST_POSIX_API)
+ stream_handler = STDOUT_FILENO;
+ #elif defined(BOOST_WINDOWS_API)
+ stream_handler = STD_OUTPUT_HANDLE;
+ #endif
+ }
+ case stderr_type:{
+ stream_type = st;
+
+ #if defined(BOOST_POSIX_API)
+ stream_handler = STDERR_FILENO;
+ #elif defined(BOOST_WINDOWS_API)
+ stream_handler = STD_ERROR_HANDLE;
+ #endif
+ }
+
+ }
+ }
 };
 
 

Modified: sandbox/SOC/2010/process/libs/process/example/create_process.cpp
==============================================================================
--- sandbox/SOC/2010/process/libs/process/example/create_process.cpp (original)
+++ sandbox/SOC/2010/process/libs/process/example/create_process.cpp 2010-05-16 02:59:54 EDT (Sun, 16 May 2010)
@@ -2,7 +2,7 @@
  * Creating process with child_create()
  */
 
-#include <boost/process/operations.hpp>
+#include <boost/process.hpp>
 #include <vector>
 #include <iostream>
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk