]> mj.ucw.cz Git - pciutils.git/commitdiff
Parameters now have help texts.
authorMartin Mares <mj@ucw.cz>
Tue, 12 Feb 2008 08:37:03 +0000 (09:37 +0100)
committerMartin Mares <mj@ucw.cz>
Tue, 12 Feb 2008 08:37:03 +0000 (09:37 +0100)
lib/init.c
lib/internal.h
lib/pci.h

index 167c893131ac04e63a1fe7c2382866bb41b7a90b..45c75909cd76d66adf95ff70a0d4cf9b087aebed 100644 (file)
@@ -68,8 +68,8 @@ pci_alloc(void)
   memset(a, 0, sizeof(*a));
   pci_set_name_list_path(a, PCI_PATH_IDS_DIR "/" PCI_IDS, 0);
 #ifdef PCI_USE_DNS
-  pci_define_param(a, "net.domain", PCI_ID_DOMAIN);
-  pci_define_param(a, "net.cache_path", "~/.pciids-cache");
+  pci_define_param(a, "net.domain", PCI_ID_DOMAIN, "DNS domain used for resolving of ID's");
+  pci_define_param(a, "net.cache_path", "~/.pciids-cache", "Name of the ID cache file");
   a->id_lookup_mode = PCI_LOOKUP_CACHE;
 #endif
   for(i=0; i<PCI_ACCESS_MAX; i++)
@@ -154,7 +154,7 @@ pci_get_param(struct pci_access *acc, char *param)
 }
 
 void
-pci_define_param(struct pci_access *acc, char *param, char *value)
+pci_define_param(struct pci_access *acc, char *param, char *value, char *help)
 {
   struct pci_param *p = pci_malloc(acc, sizeof(*p));
 
@@ -163,6 +163,7 @@ pci_define_param(struct pci_access *acc, char *param, char *value)
   p->param = param;
   p->value = value;
   p->value_malloced = 0;
+  p->help = help;
 }
 
 int
index 329910450e8dfe9ed9e04d63113b92e7e8dab7d2..1f6a2f6686b370b0adbd25b8e6f106a156e972a6 100644 (file)
@@ -36,7 +36,7 @@ char *pci_strdup(struct pci_access *a, char *s);
 struct pci_dev *pci_alloc_dev(struct pci_access *);
 int pci_link_dev(struct pci_access *, struct pci_dev *);
 
-void pci_define_param(struct pci_access *acc, char *param, char *val);
+void pci_define_param(struct pci_access *acc, char *param, char *val, char *help);
 int pci_set_param_internal(struct pci_access *acc, char *param, char *val, int copy);
 
 extern struct pci_methods pm_intel_conf1, pm_intel_conf2, pm_linux_proc,
index 030363ac18ed166e3a37be98b70dd2f89ee4efe9..4d18385dcfa48ee36e77517bdfe825f5fa76196e 100644 (file)
--- a/lib/pci.h
+++ b/lib/pci.h
@@ -91,6 +91,7 @@ struct pci_param {
   char *param;                         /* Name of the parameter */
   char *value;                         /* Value of the parameter */
   int value_malloced;                  /* used internally */
+  char *help;                          /* Explanation of the parameter */
 };
 
 char *pci_get_param(struct pci_access *acc, char *param);