32 #ifndef _util_misc_exenv_h
33 #define _util_misc_exenv_h
41 #include <util/misc/formio.h>
49 static int initialized_;
52 static char hostname_[256];
53 static char username_[9];
58 static std::ostream *out_;
59 static std::ostream *nullstream_;
62 static void init(
int &argcref,
char **&argvref);
66 static int &
argc() {
return *argc_; }
68 static char **&
argv() {
return *argv_; }
72 static const char *
hostname() {
return hostname_; }
74 static const char *
username() {
return username_; }
76 static void set_out(std::ostream *o) { SCFormIO::init_ostream(*o);out_=o; }
78 static std::ostream &
outn() {
if (!out_)set_out(&std::cout);
return *out_; }
82 static std::ostream &
out0();
87 static size_t memory() {
return mem_; }
89 static int nproc() {
return nproc_; }