From 87ef1499bfcaa0ea2a58cb6d3c327162507f6ac8 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Mon, 19 Oct 2015 07:16:40 +0200 Subject: Add optional description in the value name-aliases --- pcilib/pcilib.h | 1 + pcilib/xml.c | 2 ++ 2 files changed, 3 insertions(+) (limited to 'pcilib') diff --git a/pcilib/pcilib.h b/pcilib/pcilib.h index dbf837d..30bcdab 100644 --- a/pcilib/pcilib.h +++ b/pcilib/pcilib.h @@ -142,6 +142,7 @@ typedef struct { pcilib_register_value_t value; /**< This value will get assigned instead of the name */ pcilib_register_value_t min, max; /**< the values in the specified range are aliased by name */ const char *name; /**< corresponding string to value */ + const char *description; /**< longer description */ } pcilib_register_value_name_t; typedef struct { diff --git a/pcilib/xml.c b/pcilib/xml.c index b9deed2..b022fd8 100644 --- a/pcilib/xml.c +++ b/pcilib/xml.c @@ -578,6 +578,8 @@ static int pcilib_xml_parse_value_name(pcilib_t *ctx, xmlXPathContextPtr xpath, if (!strcasecmp(name, "name")) { desc->name = value; + } else if (!strcasecmp(name, "description")) { + desc->description = value; } else if (!strcasecmp(name, "value")) { val = strtol(value, &endptr, 0); if ((strlen(endptr) > 0)) { -- cgit v1.2.3