A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/dump__sysinfo_8cpp_source.html below:

NCBI C++ ToolKit: src/gui/widgets/feedback/dump_sysinfo.cpp Source File

44 #include <CoreServices/CoreServices.h> 45 #import <Foundation/Foundation.h> 46 #import <Foundation/NSProcessInfo.h> 48 size_t

GetPhysicalMemory(

void

)

50  return

[NSProcessInfo processInfo].physicalMemory;

54 #if defined(__WXGTK20__) || defined(__WXGTK__) 62 #include <wx/gdicmn.h> 75

ostr <<

"System Info"

<< endl <<

string

(72,

'-'

) << endl << endl;

79

ostr <<

"Host info: "

;

83

args.push_back(

"-a"

);

84

pipe.

Open

(

"uname"

, args);

93

ostr <<

"Number of CPUs: "

;

98  size_t

ram_size = GetPhysicalMemory();

100

ostr <<

"RAM size: "

<< ram_size / 1048576 <<

"MB"

<< endl;

102

ostr <<

"OS Version: "

<< wxGetOsDescription().ToUTF8() << endl;

108

memset(&sysinfo, 0,

sizeof

(sysinfo));

110  typedef

void (WINAPI *PGetSysInfo)(SYSTEM_INFO*);

112

PGetSysInfo pGetSysInfo = (PGetSysInfo)GetProcAddress(GetModuleHandle(TEXT(

"kernel32.dll"

)),

"GetNativeSystemInfo"

);

113  if

( pGetSysInfo !=

NULL

){

114

pGetSysInfo( &sysinfo );

116

GetSystemInfo( &sysinfo );

119

ostr <<

"Processor type: "

;

120  switch

(sysinfo.wProcessorArchitecture) {

122  case

PROCESSOR_ARCHITECTURE_UNKNOWN:

123

ostr <<

"unknown"

<< endl;

125  case

PROCESSOR_ARCHITECTURE_INTEL:

126

ostr <<

"Intel x32"

<< endl;

128  case

PROCESSOR_ARCHITECTURE_AMD64:

129

ostr <<

"Intel x64"

<< endl;

131  case

PROCESSOR_ARCHITECTURE_IA64:

132

ostr <<

"Itanium"

<< endl;

135

ostr <<

"Processor level: " 136

<< sysinfo.wProcessorLevel << endl

138

ostr <<

"Processor revision: " 139

<<

hex

<< sysinfo.wProcessorRevision << dec << endl

142

ostr <<

"Page size: "

<< sysinfo.dwPageSize << endl;

144

DWORDLONG ramSize = 0;

145  typedef BOOL

(WINAPI *PGMSE)(LPMEMORYSTATUSEX);

146

PGMSE pGMSE = (PGMSE)GetProcAddress(GetModuleHandle(TEXT(

"kernel32.dll"

)),

"GlobalMemoryStatusEx"

);

149

memset(&mi, 0,

sizeof

(MEMORYSTATUSEX));

150

mi.dwLength =

sizeof

(MEMORYSTATUSEX);

152

ramSize = mi.ullTotalPhys;

156

memset(&mi, 0,

sizeof

(MEMORYSTATUS));

157

mi.dwLength =

sizeof

(MEMORYSTATUS);

158

GlobalMemoryStatus(&mi);

159

ramSize = mi.dwTotalPhys;

161

ostr <<

"RAM size: "

<< (ramSize / 1024 / 1024) <<

"MB"

<< endl;

163

ostr <<

"OS Version: "

<< wxGetOsDescription().ToUTF8() << endl;

165

ostr <<

"Number of monitors: "

<< GetSystemMetrics(SM_CMONITORS) << endl;

166

ostr <<

"Base Monitor Resolution: " 167

<< GetSystemMetrics(SM_CXSCREEN) <<

"x" 168

<< GetSystemMetrics(SM_CYSCREEN) << endl

170

ostr <<

"Virtual Monitor Resolution: " 171

<< GetSystemMetrics(SM_CXVIRTUALSCREEN) <<

"x" 172

<< GetSystemMetrics(SM_CYVIRTUALSCREEN) << endl

174

ostr <<

"Network detected: " 175

<< (GetSystemMetrics(SM_NETWORK) & 0x01 ?

"yes"

:

"no"

) << endl

177

ostr <<

"Remote Session: " 178

<< (GetSystemMetrics(SM_REMOTESESSION) ?

"yes"

:

"no"

) << endl

183

ostr <<

"Linux Distribution: " 184

<< wxGetLinuxDistributionInfo().Description.ToUTF8() << endl << endl;

186  typedef

pair<const char*, const char*>

TPair

;

187  static TPair

s_ProcEntries[] = {

188  TPair

(

"CPU Information"

,

"/proc/cpuinfo"

),

189  TPair

(

"Memory Information"

,

"/proc/meminfo"

),

192  for

(

size_t i

= 0;

i

<

sizeof

(s_ProcEntries) /

sizeof

(

TPair

); ++

i

){

195

ostr << s_ProcEntries[

i

].

first

<<

":"

<< endl;

198

ostr <<

" "

<< line << endl;

203

ostr <<

"IP address: "

;

209

ostr << endl << endl;

212

ostr <<

"Graphics Subsystem Info"

<< endl <<

string

(72,

'-'

) << endl << endl;

214

wxClientDisplayRect(&x, &y, &w, &h);

215

ostr <<

"Root window size: "

<< w <<

" x "

<< h << endl;

218  const

GLubyte* na_text = (

const

GLubyte*)

"NOT AVAILABLE"

;

219  const

GLubyte* ptr = glGetString(GL_VENDOR);

223

ostr <<

"GL_VENDOR: "

<< ptr << endl;

225

ptr = glGetString(GL_RENDERER);

229

ostr <<

"GL_RENDERER: "

<< ptr << endl;

231

ptr = glGetString(GL_VERSION);

235

ostr <<

"GL_VERSION: "

<< ptr << endl;

237

ptr = glGetString(GLU_VERSION);

241

ostr <<

"GLU_VERSION: "

<< ptr << endl;

243 #if defined(__WXGTK20__) || defined(__WXGTK__) 244  int

glxMajorVer = 1, glxMinorVer = 0;

245

glXQueryVersion(wxGetX11Display(), &glxMajorVer, &glxMinorVer);

246

ostr <<

"GLX Version: "

<< glxMajorVer <<

"."

<< glxMinorVer << endl;

248

ptr = glGetString(GL_EXTENSIONS);

250  string

s(

reinterpret_cast<const char

*

>

(ptr));

253

ostr <<

"GL_EXTENSIONS:"

<< endl;

254  ITERATE

(list<string>, iter, toks) {

255

ostr <<

" "

<< *iter << endl;

259

ptr = gluGetString(GLU_EXTENSIONS);

261  string

s(

reinterpret_cast<const char

*

>

(ptr));

264

ostr <<

"GLU_EXTENSIONS:"

<< endl;

265  ITERATE

(list<string>, iter, toks) {

266

ostr <<

" "

<< *iter << endl;

272  typedef

pair<const char*, GLenum>

TPair

;

273  static const TPair

s_EnumPairs[] = {

274  TPair

(

"GL_DOUBLEBUFFER"

, GL_DOUBLEBUFFER),

275  TPair

(

"GL_RED_BITS"

, GL_RED_BITS),

276  TPair

(

"GL_GREEN_BITS"

, GL_GREEN_BITS),

277  TPair

(

"GL_BLUE_BITS"

, GL_BLUE_BITS),

278  TPair

(

"GL_ALPHA_BITS"

, GL_ALPHA_BITS),

279  TPair

(

"GL_DEPTH_BITS"

, GL_DEPTH_BITS),

280  TPair

(

"GL_MAX_ATTRIB_STACK_DEPTH"

, GL_MAX_ATTRIB_STACK_DEPTH),

281  TPair

(

"GL_MAX_LIGHTS"

, GL_MAX_LIGHTS),

282  TPair

(

"GL_MAX_LIST_NESTING"

, GL_MAX_LIST_NESTING),

283  TPair

(

"GL_MAX_PROJECTION_STACK_DEPTH"

, GL_MAX_PROJECTION_STACK_DEPTH),

284  TPair

(

"GL_MAX_TEXTURE_SIZE"

, GL_MAX_TEXTURE_SIZE),

285  TPair

(

"GL_MAX_TEXTURE_STACK_DEPTH"

, GL_MAX_TEXTURE_STACK_DEPTH),

286  TPair

(

"GL_MAX_MODELVIEW_STACK_DEPTH"

, GL_MAX_MODELVIEW_STACK_DEPTH),

287  TPair

(

"GL_MAX_VIEWPORT_DIMS"

, GL_MAX_VIEWPORT_DIMS),

288  TPair

(

"GL_MAX_NAME_STACK_DEPTH"

, GL_MAX_NAME_STACK_DEPTH),

292  for

(

size_t i

= 0;

i

<

sizeof

(s_EnumPairs) /

sizeof

(

TPair

); ++

i

) {

293

max_len =

max

(max_len, strlen(s_EnumPairs[

i

].

first

));

296  for

(

size_t i

= 0;

i

<

sizeof

(s_EnumPairs) /

sizeof

(

TPair

); ++

i

) {

298

glGetIntegerv(s_EnumPairs[

i

].second, vals);

299

ostr << s_EnumPairs[

i

].

first

<<

":" 300

<<

string

(max_len - strlen(s_EnumPairs[

i

].

first

) + 3,

' '

)

static void DumpSystemInfo(CNcbiOstream &ostr)

Dump a text formatted report of the current system configuration.

static unsigned int GetCpuCount(void)

Return number of active CPUs/cores (never less than 1).

SStaticPair< const char *, const char * > TPair

static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

EIO_Status Open(const string &cmd, const vector< string > &args, TCreateFlags create_flags=0, const string &current_dir=kEmptyStr, const char *const envp[]=0, size_t pipe_size=0)

Open pipe.

EIO_Status Read(void *buf, size_t count, size_t *read=0, EChildIOHandle from_handle=eDefault)

Read data from the pipe's default read handle.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

static CNCBI_IPAddr GetLocalHostAddress(ESwitch reget=eDefault)

Local host address in network byte order (cached for faster retrieval)

static string ntoa(const CNCBI_IPAddr &addr)

BSD-like API.

CNcbiIstream & NcbiGetlineEOL(CNcbiIstream &is, string &str, string::size_type *count=NULL)

Read from "is" to "str" the next line (taking into account platform specifics of End-of-Line)

IO_PREFIX::ostream CNcbiOstream

Portable alias for ostream.

IO_PREFIX::ifstream CNcbiIfstream

Portable alias for ifstream.

static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)

Split a string using specified delimiters.

@ fSplit_Tokenize

All delimiters are merged and trimmed, to get non-empty tokens only.

@ eIO_Success

everything is fine, no error occurred

static void hex(unsigned char c)

Portable class to work with a spawned process via pipes.

Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...

Standard mechanism to include OpenGL headers for all platforms.

Template structure SStaticPair is simlified replacement of STL pair<> Main reason of introducing this...


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4