]> mj.ucw.cz Git - pciutils.git/blobdiff - lib/init.c
Alternative Routing-ID Interpretation capability support
[pciutils.git] / lib / init.c
index 59cb706d3580aa8ab6ff5938bc3bf51f16e47e14..be45f81dd5888a99038767bb8e773a59d5503568 100644 (file)
@@ -123,6 +123,28 @@ pci_null_debug(char *msg UNUSED, ...)
 {
 }
 
+int
+pci_lookup_method(char *name)
+{
+  int i;
+
+  for (i=0; i<PCI_ACCESS_MAX; i++)
+    if (pci_methods[i] && !strcmp(pci_methods[i]->name, name))
+      return i;
+  return -1;
+}
+
+char *
+pci_get_method_name(int index)
+{
+  if (index < 0 || index >= PCI_ACCESS_MAX)
+    return NULL;
+  else if (!pci_methods[index])
+    return "";
+  else
+    return pci_methods[index]->name;
+}
+
 struct pci_access *
 pci_alloc(void)
 {