diff options
author | Burt P <pburt0@gmail.com> | 2020-01-10 11:07:39 -0600 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2020-01-17 16:14:30 -0800 |
commit | 29f8126a0112c2125aa8b150314521cbc5c7d9fd (patch) | |
tree | fac2a5301b804d3977f88d6d75aa2be3630366a4 /hardinfo/pci_util.c | |
parent | 7114175cdb6ff611dfb164959c5aec2099f9e887 (diff) |
pci: sort list of devices
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'hardinfo/pci_util.c')
-rw-r--r-- | hardinfo/pci_util.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/hardinfo/pci_util.c b/hardinfo/pci_util.c index 9502b23b..69150732 100644 --- a/hardinfo/pci_util.c +++ b/hardinfo/pci_util.c @@ -151,6 +151,11 @@ static gboolean pci_lookup_ids(pcid *d) { return ret; } +gint pcid_cmp_by_addy(const pcid* a, const pcid* b) { + if (!a || !b) return (!!a - !!b); + return g_strcmp0(a->slot_str, b->slot_str); +} + void pcid_free(pcid *s) { if (s) { g_free(s->slot_str); |