Signed-off-by: Stefan Tauner stefan.tauner@student.tuwien.ac.at --- print_wiki.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/print_wiki.c b/print_wiki.c index 17e2e85..d936682 100644 --- a/print_wiki.c +++ b/print_wiki.c @@ -77,6 +77,7 @@ static const char chip_th[] = "\ | align="center" | Min \n| align="center" | Max\n\n";
static const char programmer_th[] = "\ +! align="left" | Programmer\n\ ! align="left" | Vendor\n\ ! align="left" | Device\n\ ! align="center" | IDs\n\ @@ -309,18 +310,22 @@ static int count_supported_pcidevs_wiki(const struct pcidev_status *devs) return count; }
-static void print_supported_pcidevs_wiki_helper(const struct pcidev_status *devs) +static void print_supported_pcidevs_wiki_helper(const struct programmer_entry prog) { int i = 0; static int c = 0; + const struct pcidev_status *devs = prog.devices.pci; + const unsigned int count = count_supported_pcidevs_wiki(devs);
/* Alternate colors if the vendor changes. */ c = !c;
for (i = 0; devs[i].vendor_name != NULL; i++) { - printf("|- bgcolor="#%s"\n| %s || %s || %04x:%04x || {{%s}}\n", (c) ? "eeeeee" : "dddddd", - devs[i].vendor_name, devs[i].device_name, devs[i].vendor_id, devs[i].device_id, - (devs[i].status == NT) ? "?3" : "OK"); + printf("|- bgcolor="#%s"\n", (c) ? "eeeeee" : "dddddd"); + if (i == 0) + printf("| rowspan="%u" | %s |", count, prog.name); + printf("| %s || %s || %04x:%04x || {{%s}}\n", devs[i].vendor_name, devs[i].device_name, + devs[i].vendor_id, devs[i].device_id, (devs[i].status == NT) ? "?3" : "OK"); } }
@@ -333,18 +338,22 @@ static int count_supported_usbdevs_wiki(const struct usbdev_status *devs) return count; }
-static void print_supported_usbdevs_wiki_helper(const struct usbdev_status *devs) +static void print_supported_usbdevs_wiki_helper(const struct programmer_entry prog) { int i = 0; static int c = 0; + const struct usbdev_status *devs = prog.devices.usb; + const unsigned int count = count_supported_usbdevs_wiki(devs);
/* Alternate colors if the vendor changes. */ c = !c;
for (i = 0; devs[i].vendor_name != NULL; i++) { - printf("|- bgcolor="#%s"\n| %s || %s || %04x:%04x || {{%s}}\n", (c) ? "eeeeee" : "dddddd", - devs[i].vendor_name, devs[i].device_name, devs[i].vendor_id, devs[i].device_id, - (devs[i].status == NT) ? "?3" : "OK"); + printf("|- bgcolor="#%s"\n", (c) ? "eeeeee" : "dddddd"); + if (i == 0) + printf("| rowspan="%u" | %s |", count, prog.name); + printf("| %s || %s || %04x:%04x || {{%s}}\n", devs[i].vendor_name, devs[i].device_name, + devs[i].vendor_id, devs[i].device_id, devs[i].status == NT ? "?3" : "OK"); } }
@@ -376,7 +385,7 @@ static void print_supported_devs_wiki() for (i = 0; i < PROGRAMMER_INVALID; i++) { const struct programmer_entry prog = programmer_table[i]; if (prog.type == PCI) { - print_supported_pcidevs_wiki_helper(prog.devices.pci); + print_supported_pcidevs_wiki_helper(prog); } } printf("\n|}\n\n|}\n"); @@ -388,7 +397,7 @@ static void print_supported_devs_wiki() for (i = 0; i < PROGRAMMER_INVALID; i++) { const struct programmer_entry prog = programmer_table[i]; if (prog.type == USB) { - print_supported_usbdevs_wiki_helper(prog.devices.usb); + print_supported_usbdevs_wiki_helper(prog); } } printf("\n|}\n\n|}\n");