diff --git a/src/lpt.c b/src/lpt.c index 31088f984..d528c2911 100644 --- a/src/lpt.c +++ b/src/lpt.c @@ -17,33 +17,31 @@ lpt_port_t lpt_ports[3]; -static const struct -{ - const char *name; - const char *internal_name; - const lpt_device_t *device; -} lpt_devices[] = -{ - {"None", "none", NULL}, - {"Disney Sound Source", "dss", &dss_device}, - {"LPT DAC / Covox Speech Thing", "lpt_dac", &lpt_dac_device}, - {"Stereo LPT DAC", "lpt_dac_stereo", &lpt_dac_stereo_device}, - {"Generic Text Printer", "text_prt", &lpt_prt_text_device}, - {"Generic ESC/P Dot-Matrix", "dot_matrix", &lpt_prt_escp_device}, - {"Generic PostScript Printer", "postscript", &lpt_prt_ps_device}, - {"PLIP Network", "plip", &lpt_plip_device}, - {"Protection Dongle for Savage Quest","dongle_savquest",&lpt_hasp_savquest_device}, - {"", "", NULL} +static const struct { + const char *internal_name; + const lpt_device_t *device; +} lpt_devices[] = { + {"none", NULL}, + {"dss", &dss_device}, + {"lpt_dac", &lpt_dac_device}, + {"lpt_dac_stereo", &lpt_dac_stereo_device}, + {"text_prt", &lpt_prt_text_device}, + {"dot_matrix", &lpt_prt_escp_device}, + {"postscript", &lpt_prt_ps_device}, + {"plip", &lpt_plip_device}, + {"dongle_savquest", &lpt_hasp_savquest_device}, + {"", NULL} }; char * lpt_device_get_name(int id) { - if (strlen((char *) lpt_devices[id].name) == 0) + if (strlen((char *) lpt_devices[id].internal_name) == 0) return NULL; - - return (char *) lpt_devices[id].name; + if (!lpt_devices[id].device) + return "None"; + return (char *) lpt_devices[id].device->name; } diff --git a/src/network/net_plip.c b/src/network/net_plip.c index 25610ef78..c71cf77d1 100644 --- a/src/network/net_plip.c +++ b/src/network/net_plip.c @@ -492,7 +492,7 @@ plip_close(void *priv) const lpt_device_t lpt_plip_device = { - .name = "Parallel Line Internet Protocol (LPT)", + .name = "Parallel Line Internet Protocol", .init = plip_lpt_init, .close = plip_close, .write_data = plip_write_data, @@ -502,10 +502,9 @@ const lpt_device_t lpt_plip_device = { .read_ctrl = NULL }; -const device_t plip_device = -{ - "Parallel Line Internet Protocol", - DEVICE_LPT, 0, - plip_net_init, NULL, - NULL, { NULL }, NULL, NULL +const device_t plip_device = { + "Parallel Line Internet Protocol", + DEVICE_LPT, 0, + plip_net_init, NULL, + NULL, { NULL }, NULL, NULL }; diff --git a/src/printer/prt_escp.c b/src/printer/prt_escp.c index 029d2d492..8e490e9e1 100644 --- a/src/printer/prt_escp.c +++ b/src/printer/prt_escp.c @@ -2143,7 +2143,7 @@ escp_close(void *priv) const lpt_device_t lpt_prt_escp_device = { - "EPSON ESC/P compatible printer", + "Generic ESC/P Dot-Matrix", escp_init, escp_close, write_data, diff --git a/src/printer/prt_ps.c b/src/printer/prt_ps.c index f66d17f80..de30a962c 100644 --- a/src/printer/prt_ps.c +++ b/src/printer/prt_ps.c @@ -389,7 +389,7 @@ ps_close(void *p) const lpt_device_t lpt_prt_ps_device = { - .name = "Generic PostScript printer", + .name = "Generic PostScript Printer", .init = ps_init, .close = ps_close, .write_data = ps_write_data, diff --git a/src/printer/prt_text.c b/src/printer/prt_text.c index e11d4f734..b0f0b5daa 100644 --- a/src/printer/prt_text.c +++ b/src/printer/prt_text.c @@ -483,7 +483,7 @@ prnt_close(void *priv) const lpt_device_t lpt_prt_text_device = { - "Generic TEXT printer", + "Generic Text Printer", prnt_init, prnt_close, write_data,