Back to index

lshw  02.16
Functions
main.cc File Reference
#include "hw.h"
#include "print.h"
#include "version.h"
#include "options.h"
#include "mem.h"
#include "dmi.h"
#include "cpuinfo.h"
#include "cpuid.h"
#include "device-tree.h"
#include "pci.h"
#include "pcmcia.h"
#include "pcmcia-legacy.h"
#include "ide.h"
#include "scsi.h"
#include "spd.h"
#include "network.h"
#include "isapnp.h"
#include "fb.h"
#include "usb.h"
#include "sysfs.h"
#include "display.h"
#include "parisc.h"
#include "cpufreq.h"
#include "ideraid.h"
#include "mounts.h"
#include "smp.h"
#include "abi.h"
#include <unistd.h>
#include <stdio.h>

Go to the source code of this file.

Functions

 __ID ("@(#) $Id: main.cc 2433 2012-01-10 22:01:30Z lyonel $")
bool scan_system (hwNode &system)

Function Documentation

__ID ( "@(#) $Id: main.cc 2433 2012-01-10 22:01:30Z lyonel $"  )
bool scan_system ( hwNode system)

Definition at line 51 of file main.cc.

{
  char hostname[80];

  if (gethostname(hostname, sizeof(hostname)) == 0)
  {
    hwNode computer(::enabled("output:sanitize")?"computer":hostname,
      hw::system);

    status("DMI");
    if (enabled("dmi"))
      scan_dmi(computer);
    status("SMP");
    if (enabled("smp"))
      scan_smp(computer);
    status("PA-RISC");
    if (enabled("parisc"))
      scan_parisc(computer);
    status("device-tree");
    if (enabled("device-tree"))
      scan_device_tree(computer);
    status("SPD");
    if (enabled("spd"))
      scan_spd(computer);
    status("memory");
    if (enabled("memory"))
      scan_memory(computer);
    status("/proc/cpuinfo");
    if (enabled("cpuinfo"))
      scan_cpuinfo(computer);
    status("CPUID");
    if (enabled("cpuid"))
      scan_cpuid(computer);
    status("PCI (sysfs)");
    if (enabled("pci"))
    {
      if(!scan_pci(computer))
      {
        if (enabled("pcilegacy"))
          scan_pci_legacy(computer);
      }
    }
    else
    {
      status("PCI (legacy)");
      if (enabled("pcilegacy"))
        scan_pci_legacy(computer);
    }
    status("ISA PnP");
    if (enabled("isapnp"))
      scan_isapnp(computer);
    status("PCMCIA");
    if (enabled("pcmcia"))
      scan_pcmcia(computer);
    status("PCMCIA");
    if (enabled("pcmcia-legacy"))
      scan_pcmcialegacy(computer);
    status("kernel device tree (sysfs)");
    if (enabled("sysfs"))
      scan_sysfs(computer);
    status("USB");
    if (enabled("usb"))
      scan_usb(computer);
    status("IDE");
    if (enabled("ide"))
      scan_ide(computer);
    if (enabled("ideraid"))
      scan_ideraid(computer);
    status("SCSI");
    if (enabled("scsi"))
      scan_scsi(computer);
    if (enabled("mounts"))
      scan_mounts(computer);
    status("Network interfaces");
    if (enabled("network"))
      scan_network(computer);
    status("Framebuffer devices");
    if (enabled("fb"))
      scan_fb(computer);
    status("Display");
    if (enabled("display"))
      scan_display(computer);
    status("CPUFreq");
    if (enabled("cpufreq"))
      scan_cpufreq(computer);
    status("ABI");
    if (enabled("abi"))
      scan_abi(computer);
    status("");

    if (computer.getDescription() == "")
      computer.setDescription("Computer");
    computer.assignPhysIds();
    computer.fixInconsistencies();

    system = computer;
  }
  else
    return false;

  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function: