Boost.Nowide
cstdlib.hpp
1 //
2 // Copyright (c) 2012 Artyom Beilis (Tonkikh)
3 //
4 // Distributed under the Boost Software License, Version 1.0.
5 // https://www.boost.org/LICENSE_1_0.txt
6 
7 #ifndef BOOST_NOWIDE_CSTDLIB_HPP_INCLUDED
8 #define BOOST_NOWIDE_CSTDLIB_HPP_INCLUDED
9 
10 #include <boost/nowide/config.hpp>
11 #if !defined(BOOST_WINDOWS)
12 #include <cstdlib>
13 #endif
14 
15 namespace boost {
16 namespace nowide {
17 #if !defined(BOOST_WINDOWS) && !defined(BOOST_NOWIDE_DOXYGEN)
18  using std::getenv;
19  using std::system;
20 #else
21  BOOST_NOWIDE_DECL char* getenv(const char* key);
27 
31  BOOST_NOWIDE_DECL int system(const char* cmd);
32 
33 #endif
34  BOOST_NOWIDE_DECL int setenv(const char* key, const char* value, int overwrite);
44 
51  BOOST_NOWIDE_DECL int unsetenv(const char* key);
52 
61  BOOST_NOWIDE_DECL int putenv(char* string);
62 
63 } // namespace nowide
64 } // namespace boost
65 
66 #endif
int setenv(const char *key, const char *value, int overwrite)
Set environment variable key to value.
Definition: cstdlib.cpp:28
int putenv(char *string)
Adds or changes an environment variable, string must be in format KEY=VALUE.
Definition: cstdlib.cpp:38
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:33