diff options
author | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2014-08-08 23:52:33 +0000 |
---|---|---|
committer | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2014-08-08 23:52:33 +0000 |
commit | 9b32de94f5104cb7fa12816b7fa561b804df6ed8 (patch) | |
tree | 9501e463b76abf831d62bfd1a9a9ac2f8939476e /print.c | |
parent | a8cf3620a42ca5927253822a813e3fbae1d6e7bf (diff) | |
download | ast2050-flashrom-9b32de94f5104cb7fa12816b7fa561b804df6ed8.zip ast2050-flashrom-9b32de94f5104cb7fa12816b7fa561b804df6ed8.tar.gz |
Refactor some CLI-relevant parts
Begin to move functions that clearly belong to the (command line)
user interface out of flashrom's core files like flashrom.c.
- Refine messages within check_chip_supported(), rename it to
print_chip_support_status() and move it to newly created cli_common.c.
- Move flashbuses_to_text() to cli_common.c as well.
- Move global verbosity variables to cli_output.c.
Corresponding to flashrom svn r1841.
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'print.c')
-rw-r--r-- | print.c | 33 |
1 files changed, 0 insertions, 33 deletions
@@ -59,39 +59,6 @@ static const char *test_state_to_text(enum test_state test_state) } } -/* - * Return a string corresponding to the bustype parameter. - * Memory is obtained with malloc() and must be freed with free() by the caller. - */ -char *flashbuses_to_text(enum chipbustype bustype) -{ - char *ret = calloc(1, 1); - /* - * FIXME: Once all chipsets and flash chips have been updated, NONSPI - * will cease to exist and should be eliminated here as well. - */ - if (bustype == BUS_NONSPI) { - ret = strcat_realloc(ret, "Non-SPI, "); - } else { - if (bustype & BUS_PARALLEL) - ret = strcat_realloc(ret, "Parallel, "); - if (bustype & BUS_LPC) - ret = strcat_realloc(ret, "LPC, "); - if (bustype & BUS_FWH) - ret = strcat_realloc(ret, "FWH, "); - if (bustype & BUS_SPI) - ret = strcat_realloc(ret, "SPI, "); - if (bustype & BUS_PROG) - ret = strcat_realloc(ret, "Programmer-specific, "); - if (bustype == BUS_NONE) - ret = strcat_realloc(ret, "None, "); - } - /* Kill last comma. */ - ret[strlen(ret) - 2] = '\0'; - ret = realloc(ret, strlen(ret) + 1); - return ret; -} - static int print_supported_chips(void) { const char *delim = "/"; |