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_DEV_SNDSTAT "/dev/sndstat"
12 #include <sys/systeminfo.h>
14 /* all following functions should return true, when the Information
15 was filled into the lBox-Widget.
16 returning false indicates, that information was not available.
19 bool GetInfo_ReadfromFile(QListView
*lBox
, char *Name
, char splitchar
) {
23 QFile
*file
= new QFile(Name
);
24 QListViewItem
* olditem
= 0;
26 if (!file
->open(QIODevice::ReadOnly
)) {
31 while (file
->readLine(buf
, sizeof(buf
)-1) > 0) {
34 if (splitchar
!=0) /* remove leading spaces between ':' and the following text */
46 QString s1
= QString::fromLocal8Bit(buf
);
47 QString s2
= s1
.mid(s1
.find(splitchar
)+1);
49 s1
.truncate(s1
.find(splitchar
));
50 if (!(s1
.isEmpty() || s2
.isEmpty()))
51 olditem
= new QListViewItem(lBox
, olditem
, s1
, s2
);
60 bool GetInfo_CPU(QListView
*lBox
) {
63 sysinfo(SI_ARCHITECTURE
, buf
, sizeof(buf
));
64 new QListViewItem(lBox
, QString::fromLocal8Bit(buf
));
68 bool GetInfo_IRQ(QListView
*) {
72 bool GetInfo_DMA(QListView
*) {
76 bool GetInfo_PCI(QTreeWidget
* tree
) {
79 sysinfo(SI_BUSTYPES
, buf
, sizeof(buf
));
81 list
<< QString::fromLocal8Bit(buf
);
82 new QTreeWidgetItem(tree
, list
);
86 bool GetInfo_IO_Ports(QListView
*) {
90 bool GetInfo_Sound(QListView
*lBox
) {
91 if (GetInfo_ReadfromFile(lBox
, INFO_DEV_SNDSTAT
, 0))
97 bool GetInfo_Devices(QListView
*) {
101 bool GetInfo_SCSI(QListView
*) {
105 bool GetInfo_Partitions(QListView
*) {
109 bool GetInfo_XServer_and_Video(QListView
*lBox
) {
110 return GetInfo_XServer_Generic(lBox
);