4
UNIX System V Release 4 specific Information about the Hardware.
5
Appropriate for SCO OpenServer and UnixWare.
6
Written 20-Feb-99 by Ronald Joe Record (rr@sco.com)
7
Initially based on info_sgi.cpp
10
#define INFO_CPU_AVAILABLE
11
#define INFO_IRQ_AVAILABLE
12
#define INFO_DMA_AVAILABLE
13
#define INFO_PCI_AVAILABLE
14
#define INFO_IOPORTS_AVAILABLE
15
#define INFO_SOUND_AVAILABLE
16
#define INFO_DEVICES_AVAILABLE
17
#define INFO_SCSI_AVAILABLE
18
#define INFO_PARTITIONS_AVAILABLE
19
#define INFO_XSERVER_AVAILABLE
21
#define INFO_DEV_SNDSTAT "/dev/sndstat"
23
#include <sys/systeminfo.h>
25
/* all following functions should return true, when the Information
26
was filled into the lBox-Widget.
27
returning false indicates, that information was not available.
30
bool GetInfo_ReadfromFile( QListView *lBox, char *Name, char splitchar )
35
QFile *file = new QFile(Name);
36
QListViewItem* olditem = 0;
38
if(!file->open(QIODevice::ReadOnly)) {
43
while (file->readLine(buf,sizeof(buf)-1) > 0) {
46
if (splitchar!=0) /* remove leading spaces between ':' and the following text */
57
QString s1 = QString::fromLocal8Bit(buf);
58
QString s2 = s1.mid(s1.find(splitchar)+1);
60
s1.truncate(s1.find(splitchar));
61
if(!(s1.isEmpty() || s2.isEmpty()))
62
olditem = new QListViewItem(lBox, olditem, s1, s2);
71
bool GetInfo_CPU( QListView *lBox )
75
sysinfo(SI_ARCHITECTURE, buf, sizeof(buf));
76
new QListViewItem(lBox, QString::fromLocal8Bit(buf));
81
bool GetInfo_IRQ( QListView * )
86
bool GetInfo_DMA( QListView * )
91
bool GetInfo_PCI( QListView *lBox )
95
sysinfo(SI_BUSTYPES, buf, sizeof(buf));
96
new QListViewItem(lBox, QString::fromLocal8Bit(buf));
100
bool GetInfo_IO_Ports( QListView * )
105
bool GetInfo_Sound( QListView *lBox )
107
if ( GetInfo_ReadfromFile( lBox, INFO_DEV_SNDSTAT, 0 ))
113
bool GetInfo_Devices( QListView * )
118
bool GetInfo_SCSI( QListView * )
123
bool GetInfo_Partitions( QListView * )
128
bool GetInfo_XServer_and_Video( QListView *lBox )
130
return GetInfo_XServer_Generic( lBox );