GetPhysicalMemory(
void)
50 return[NSProcessInfo processInfo].physicalMemory;
54 #if defined(__WXGTK20__) || defined(__WXGTK__) 62 #include <wx/gdicmn.h> 75ostr <<
"System Info"<< endl <<
string(72,
'-') << endl << endl;
79ostr <<
"Host info: ";
83args.push_back(
"-a");
84pipe.
Open(
"uname", args);
93ostr <<
"Number of CPUs: ";
98 size_tram_size = GetPhysicalMemory();
100ostr <<
"RAM size: "<< ram_size / 1048576 <<
"MB"<< endl;
102ostr <<
"OS Version: "<< wxGetOsDescription().ToUTF8() << endl;
108memset(&sysinfo, 0,
sizeof(sysinfo));
110 typedefvoid (WINAPI *PGetSysInfo)(SYSTEM_INFO*);
112PGetSysInfo pGetSysInfo = (PGetSysInfo)GetProcAddress(GetModuleHandle(TEXT(
"kernel32.dll")),
"GetNativeSystemInfo");
113 if( pGetSysInfo !=
NULL){
114pGetSysInfo( &sysinfo );
116GetSystemInfo( &sysinfo );
119ostr <<
"Processor type: ";
120 switch(sysinfo.wProcessorArchitecture) {
122 casePROCESSOR_ARCHITECTURE_UNKNOWN:
123ostr <<
"unknown"<< endl;
125 casePROCESSOR_ARCHITECTURE_INTEL:
126ostr <<
"Intel x32"<< endl;
128 casePROCESSOR_ARCHITECTURE_AMD64:
129ostr <<
"Intel x64"<< endl;
131 casePROCESSOR_ARCHITECTURE_IA64:
132ostr <<
"Itanium"<< endl;
135ostr <<
"Processor level: " 136<< sysinfo.wProcessorLevel << endl
138ostr <<
"Processor revision: " 139<<
hex<< sysinfo.wProcessorRevision << dec << endl
142ostr <<
"Page size: "<< sysinfo.dwPageSize << endl;
144DWORDLONG ramSize = 0;
145 typedef BOOL(WINAPI *PGMSE)(LPMEMORYSTATUSEX);
146PGMSE pGMSE = (PGMSE)GetProcAddress(GetModuleHandle(TEXT(
"kernel32.dll")),
"GlobalMemoryStatusEx");
149memset(&mi, 0,
sizeof(MEMORYSTATUSEX));
150mi.dwLength =
sizeof(MEMORYSTATUSEX);
152ramSize = mi.ullTotalPhys;
156memset(&mi, 0,
sizeof(MEMORYSTATUS));
157mi.dwLength =
sizeof(MEMORYSTATUS);
158GlobalMemoryStatus(&mi);
159ramSize = mi.dwTotalPhys;
161ostr <<
"RAM size: "<< (ramSize / 1024 / 1024) <<
"MB"<< endl;
163ostr <<
"OS Version: "<< wxGetOsDescription().ToUTF8() << endl;
165ostr <<
"Number of monitors: "<< GetSystemMetrics(SM_CMONITORS) << endl;
166ostr <<
"Base Monitor Resolution: " 167<< GetSystemMetrics(SM_CXSCREEN) <<
"x" 168<< GetSystemMetrics(SM_CYSCREEN) << endl
170ostr <<
"Virtual Monitor Resolution: " 171<< GetSystemMetrics(SM_CXVIRTUALSCREEN) <<
"x" 172<< GetSystemMetrics(SM_CYVIRTUALSCREEN) << endl
174ostr <<
"Network detected: " 175<< (GetSystemMetrics(SM_NETWORK) & 0x01 ?
"yes":
"no") << endl
177ostr <<
"Remote Session: " 178<< (GetSystemMetrics(SM_REMOTESESSION) ?
"yes":
"no") << endl
183ostr <<
"Linux Distribution: " 184<< wxGetLinuxDistributionInfo().Description.ToUTF8() << endl << endl;
186 typedefpair<const char*, const char*>
TPair;
187 static TPairs_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){
195ostr << s_ProcEntries[
i].
first<<
":"<< endl;
198ostr <<
" "<< line << endl;
203ostr <<
"IP address: ";
209ostr << endl << endl;
212ostr <<
"Graphics Subsystem Info"<< endl <<
string(72,
'-') << endl << endl;
214wxClientDisplayRect(&x, &y, &w, &h);
215ostr <<
"Root window size: "<< w <<
" x "<< h << endl;
218 constGLubyte* na_text = (
constGLubyte*)
"NOT AVAILABLE";
219 constGLubyte* ptr = glGetString(GL_VENDOR);
223ostr <<
"GL_VENDOR: "<< ptr << endl;
225ptr = glGetString(GL_RENDERER);
229ostr <<
"GL_RENDERER: "<< ptr << endl;
231ptr = glGetString(GL_VERSION);
235ostr <<
"GL_VERSION: "<< ptr << endl;
237ptr = glGetString(GLU_VERSION);
241ostr <<
"GLU_VERSION: "<< ptr << endl;
243 #if defined(__WXGTK20__) || defined(__WXGTK__) 244 intglxMajorVer = 1, glxMinorVer = 0;
245glXQueryVersion(wxGetX11Display(), &glxMajorVer, &glxMinorVer);
246ostr <<
"GLX Version: "<< glxMajorVer <<
"."<< glxMinorVer << endl;
248ptr = glGetString(GL_EXTENSIONS);
250 strings(
reinterpret_cast<const char*
>(ptr));
253ostr <<
"GL_EXTENSIONS:"<< endl;
254 ITERATE(list<string>, iter, toks) {
255ostr <<
" "<< *iter << endl;
259ptr = gluGetString(GLU_EXTENSIONS);
261 strings(
reinterpret_cast<const char*
>(ptr));
264ostr <<
"GLU_EXTENSIONS:"<< endl;
265 ITERATE(list<string>, iter, toks) {
266ostr <<
" "<< *iter << endl;
272 typedefpair<const char*, GLenum>
TPair;
273 static const TPairs_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) {
293max_len =
max(max_len, strlen(s_EnumPairs[
i].
first));
296 for(
size_t i= 0;
i<
sizeof(s_EnumPairs) /
sizeof(
TPair); ++
i) {
298glGetIntegerv(s_EnumPairs[
i].second, vals);
299ostr << 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 ¤t_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