Boost.Nowide
cstdlib.hpp
1 //
2 // Copyright (c) 2012 Artyom Beilis (Tonkikh)
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See
5 // accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
7 //
8 #ifndef BOOST_NOWIDE_CSTDLIB_HPP_INCLUDED
9 #define BOOST_NOWIDE_CSTDLIB_HPP_INCLUDED
10 
11 #include <boost/nowide/config.hpp>
12 #if !defined(BOOST_WINDOWS)
13 #include <cstdlib>
14 #endif
15 
16 namespace boost {
17 namespace nowide {
18 #if !defined(BOOST_WINDOWS) && !defined(BOOST_NOWIDE_DOXYGEN)
19  using std::getenv;
20  using std::system;
21 #else
22  BOOST_NOWIDE_DECL char* getenv(const char* key);
28 
32  BOOST_NOWIDE_DECL int system(const char* cmd);
33 
34 #endif
35  BOOST_NOWIDE_DECL int setenv(const char* key, const char* value, int overwrite);
45 
52  BOOST_NOWIDE_DECL int unsetenv(const char* key);
53 
62  BOOST_NOWIDE_DECL int putenv(char* string);
63 
64 } // namespace nowide
65 } // namespace boost
66 
67 #endif
int setenv(const char *key, const char *value, int overwrite)
Set environment variable key to value.
Definition: cstdlib.cpp:24
int putenv(char *string)
Adds or changes an environment variable, string must be in format KEY=VALUE.
Definition: cstdlib.cpp:34
char * getenv(const char *key)
UTF-8 aware getenv. Returns 0 if the variable is not set.
int system(const char *cmd)
int unsetenv(const char *key)
Remove environment variable key.
Definition: cstdlib.cpp:29