Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:42:45

0001 //
0002 // Copyright (c) 2012 Artyom Beilis (Tonkikh)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0.
0005 // https://www.boost.org/LICENSE_1_0.txt
0006 
0007 #ifndef BOOST_NOWIDE_CSTDLIB_HPP_INCLUDED
0008 #define BOOST_NOWIDE_CSTDLIB_HPP_INCLUDED
0009 
0010 #include <boost/nowide/config.hpp>
0011 #if !defined(BOOST_WINDOWS)
0012 #include <cstdlib>
0013 #endif
0014 
0015 namespace boost {
0016 namespace nowide {
0017 #if !defined(BOOST_WINDOWS) && !defined(BOOST_NOWIDE_DOXYGEN)
0018     using std::getenv;
0019     using std::system;
0020 #else
0021     ///
0022     /// \brief UTF-8 aware getenv. Returns 0 if the variable is not set.
0023     ///
0024     /// This function is not thread safe or reenterable as defined by the standard library
0025     ///
0026     BOOST_NOWIDE_DECL char* getenv(const char* key);
0027 
0028     ///
0029     /// Same as std::system but cmd is UTF-8.
0030     ///
0031     BOOST_NOWIDE_DECL int system(const char* cmd);
0032 
0033 #endif
0034     ///
0035     /// \brief Set environment variable \a key to \a value
0036     ///
0037     /// if overwrite is not 0, that the old value is always overwritten, otherwise,
0038     /// if the variable exists it remains unchanged
0039     ///
0040     /// \a key and \a value are UTF-8 on Windows
0041     /// \return zero on success, else nonzero
0042     ///
0043     BOOST_NOWIDE_DECL int setenv(const char* key, const char* value, int overwrite);
0044 
0045     ///
0046     /// \brief Remove environment variable \a key
0047     ///
0048     /// \a key is UTF-8 on Windows
0049     /// \return zero on success, else nonzero
0050     ///
0051     BOOST_NOWIDE_DECL int unsetenv(const char* key);
0052 
0053     ///
0054     /// \brief Adds or changes an environment variable, \a string must be in format KEY=VALUE
0055     ///
0056     /// \a string MAY become part of the environment, hence changes to the value MAY change
0057     /// the environment. For portability it is hence recommended NOT to change it.
0058     /// \a string is UTF-8 on Windows
0059     /// \return zero on success, else nonzero
0060     ///
0061     BOOST_NOWIDE_DECL int putenv(char* string);
0062 
0063 } // namespace nowide
0064 } // namespace boost
0065 
0066 #endif