summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2008-02-12 09:37:03 +0100
committerMartin Mares <mj@ucw.cz>2008-02-12 09:37:03 +0100
commit0f24ef6fb9a98a4554fb533281f25902e60deaf4 (patch)
tree61490ee1a481ffcafdaacc582cadf39bdd512c37
parent98ccf6d67b6dd95c7471fd4e5a6d6452a62394b9 (diff)
downloadpciutils-0f24ef6fb9a98a4554fb533281f25902e60deaf4.tar.gz
Parameters now have help texts.
-rw-r--r--lib/init.c7
-rw-r--r--lib/internal.h2
-rw-r--r--lib/pci.h1
3 files changed, 6 insertions, 4 deletions
diff --git a/lib/init.c b/lib/init.c
index 167c893..45c7590 100644
--- a/lib/init.c
+++ b/lib/init.c
@@ -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
diff --git a/lib/internal.h b/lib/internal.h
index 3299104..1f6a2f6 100644
--- a/lib/internal.h
+++ b/lib/internal.h
@@ -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,
diff --git a/lib/pci.h b/lib/pci.h
index 030363a..4d18385 100644
--- 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);