diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-12-15 15:19:16 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-12-15 15:19:16 +0000 |
commit | 58dab80c5625896156e4d31fb39778556c88eb32 (patch) | |
tree | 372c912b71a146260e12a13205fa44c0c3378fa3 /lspcidrake.c | |
parent | 1e92adca428885ca5ec4a47a07cf25106c33974d (diff) | |
download | ldetect-58dab80c5625896156e4d31fb39778556c88eb32.tar ldetect-58dab80c5625896156e4d31fb39778556c88eb32.tar.gz ldetect-58dab80c5625896156e4d31fb39778556c88eb32.tar.bz2 ldetect-58dab80c5625896156e4d31fb39778556c88eb32.tar.xz ldetect-58dab80c5625896156e4d31fb39778556c88eb32.zip |
creation
Diffstat (limited to 'lspcidrake.c')
-rw-r--r-- | lspcidrake.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lspcidrake.c b/lspcidrake.c new file mode 100644 index 0000000..faec021 --- /dev/null +++ b/lspcidrake.c @@ -0,0 +1,24 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include "libldetect.h" + +void pci_printit(struct pci_entries entries) { + int i; + for (i = 0; i < entries.nb; i++) { + struct pci_entry e = entries.entries[i]; + printf("%s:\t%s", e.module ? e.module : "unknown", e.text); + if (e.class) { + const char *class = pci_class2text(e.class); + if (strcmp(class, "NOT_DEFINED") != 0) printf(" [%s]", class); + } + printf("\n"); + } +} + +int main(int argc, char **argv) { + struct pci_entries entries = pci_probe(1); + pci_printit(entries); + pci_free(entries); + exit(0); +} |