From 4732690283a60cd39918b94d636c3d246f8f27d2 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Sat, 25 Feb 2017 08:13:08 +0100 Subject: bind hid_probe() Needed for next commit It could also be later used for drakx's lspci (like for ldetect's lspcidrake) --- perl-install/c/stuff.xs.pl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'perl-install/c') diff --git a/perl-install/c/stuff.xs.pl b/perl-install/c/stuff.xs.pl index 86f826f7b..b2929adeb 100755 --- a/perl-install/c/stuff.xs.pl +++ b/perl-install/c/stuff.xs.pl @@ -288,6 +288,22 @@ usleep(microseconds) char* get_pci_description(int vendor_id,int device_id) +void +hid_probe() + PPCODE: + struct hid_entries entries = hid_probe(); + int i; + + EXTEND(SP, entries.nb); + for (i = 0; i < entries.nb; i++) { + struct hid_entry *e = &entries.entries[i]; + HV *rh = (HV *)sv_2mortal((SV *)newHV()); + hv_store(rh, "description", 11, newSVpv(e->text, 0), 0); + hv_store(rh, "driver", 6, newSVpv(e->module, 0), 0); + PUSHs(newRV((SV *)rh)); + } + hid_entries_free(&entries); + void pci_probe() PPCODE: -- cgit v1.2.1