File indexing completed on 2025-01-18 09:50:09
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_PROCESS_V2_DETAIL_ENVIRONMENT_POSIX_HPP
0012 #define BOOST_PROCESS_V2_DETAIL_ENVIRONMENT_POSIX_HPP
0013
0014 #include <boost/process/v2/detail/config.hpp>
0015 #include <boost/process/v2/cstring_ref.hpp>
0016
0017 #if defined(__APPLE__) || defined(__MACH__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__sun)
0018 extern "C" { extern char **environ; }
0019 #endif
0020
0021 BOOST_PROCESS_V2_BEGIN_NAMESPACE
0022
0023 namespace environment
0024 {
0025
0026 using char_type = char;
0027
0028 template<typename Char>
0029 using key_char_traits = std::char_traits<Char>;
0030
0031 template<typename Char>
0032 using value_char_traits = std::char_traits<Char>;
0033
0034
0035 constexpr char_type equality_sign = '=';
0036 constexpr char_type delimiter = ':';
0037
0038 namespace detail
0039 {
0040
0041 BOOST_PROCESS_V2_DECL
0042 basic_cstring_ref<char_type, value_char_traits<char>>
0043 get(basic_cstring_ref<char_type, key_char_traits<char_type>> key, error_code & ec);
0044
0045 BOOST_PROCESS_V2_DECL
0046 void set(basic_cstring_ref<char_type, key_char_traits<char_type>> key,
0047 basic_cstring_ref<char_type, value_char_traits<char_type>> value,
0048 error_code & ec);
0049
0050 BOOST_PROCESS_V2_DECL
0051 void unset(basic_cstring_ref<char_type, key_char_traits<char_type>> key,
0052 error_code & ec);
0053 }
0054
0055
0056 using native_handle_type = const char * const *;
0057 using native_iterator = native_handle_type;
0058
0059 namespace detail
0060 {
0061
0062 BOOST_PROCESS_V2_DECL native_handle_type load_native_handle();
0063 struct native_handle_deleter
0064 {
0065 void operator()(native_handle_type) const {}
0066 };
0067
0068 BOOST_PROCESS_V2_DECL native_iterator next(native_handle_type nh);
0069 BOOST_PROCESS_V2_DECL native_iterator find_end(native_handle_type nh);
0070 inline const char_type * dereference(native_iterator iterator) {return *iterator;}
0071
0072 BOOST_PROCESS_V2_DECL bool is_executable(const filesystem::path & pth, error_code & ec);
0073
0074 }
0075
0076 }
0077
0078 BOOST_PROCESS_V2_END_NAMESPACE
0079
0080 #endif