From 7939d501d71ae4e240a399eb7b1ba0a64eb4a88a Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Fri, 16 Mar 2018 15:35:00 -0400 Subject: [PATCH] all: Move all backend names into aliases tables. Update all printer entries to have unique names. As long as the USB VID/PID is unique, each "backend" appears unique! --- backend_canonselphy.c | 79 +++++++++++++++++++++++----------------- backend_canonselphyneo.c | 22 +++++++---- backend_citizencw01.c | 15 +++++--- backend_common.c | 26 +++++++------ backend_common.h | 4 +- backend_dnpds40.c | 31 ++++++++-------- backend_kodak1400.c | 19 ++++++---- backend_kodak605.c | 13 +++++-- backend_kodak6800.c | 14 +++---- backend_magicard.c | 20 ++++++---- backend_mitsu70x.c | 25 ++++++++----- backend_mitsu9550.c | 36 +++++++++--------- backend_mitsup95d.c | 22 ++++++++--- backend_shinkos1245.c | 13 +++++-- backend_shinkos2145.c | 13 +++++-- backend_shinkos6145.c | 15 +++++--- backend_shinkos6245.c | 15 +++++--- backend_sonyupdr150.c | 16 +++++--- 18 files changed, 241 insertions(+), 157 deletions(-) diff --git a/backend_canonselphy.c b/backend_canonselphy.c index 0ebcc8d..7540103 100644 --- a/backend_canonselphy.c +++ b/backend_canonselphy.c @@ -1073,10 +1073,23 @@ static void canonselphy_cmdline(void) DEBUG("\t\t[ -s ] # Query printer status\n"); } +static const char *canonselphy_prefixes[] = { + "canonselphy", + "selphycp10", "selphycp100", "selphycp200", "selphycp220", + "selphycp300", "selphycp330", "selphycp400", "selphycp500", + "selphycp510", "selphycp520", "selphycp530", "selphycp600", + "selphycp710", "selphycp720", "selphycp730", "selphycp740", + "selphycp750", "selphycp760", "selphycp770", "selphycp780", + "selpyhcp790", "selphycp800", "selphycp810", "selphycp900", + "selphyes1", "selphyes2", "selphyes20", "selphyes3", + "selphyes30", "selphyes40", + NULL +}; + struct dyesub_backend canonselphy_backend = { .name = "Canon SELPHY CP/ES", - .version = "0.95", - .uri_prefix = "canonselphy", + .version = "0.96", + .uri_prefixes = canonselphy_prefixes, .cmdline_usage = canonselphy_cmdline, .cmdline_arg = canonselphy_cmdline_arg, .init = canonselphy_init, @@ -1085,37 +1098,37 @@ struct dyesub_backend canonselphy_backend = { .read_parse = canonselphy_read_parse, .main_loop = canonselphy_main_loop, .devices = { - { USB_VID_CANON, USB_PID_CANON_CP10, P_CP10, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP100, P_CP_XXX, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP200, P_CP_XXX, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP220, P_CP_XXX, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP300, P_CP_XXX, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP330, P_CP_XXX, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP400, P_CP_XXX, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP500, P_CP_XXX, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP510, P_CP_XXX, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP520, P_CP_XXX, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP530, P_CP_XXX, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP600, P_CP_XXX, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP710, P_CP_XXX, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP720, P_CP_XXX, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP730, P_CP_XXX, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP740, P_CP_XXX, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP750, P_CP_XXX, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP760, P_CP_XXX, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP770, P_CP_XXX, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP780, P_CP_XXX, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP790, P_CP790, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP800, P_CP_XXX, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP810, P_CP_XXX, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP900, P_CP_XXX, NULL}, - { USB_VID_CANON, USB_PID_CANON_ES1, P_ES1, NULL}, - { USB_VID_CANON, USB_PID_CANON_ES2, P_ES2_20, NULL}, - { USB_VID_CANON, USB_PID_CANON_ES20, P_ES2_20, NULL}, - { USB_VID_CANON, USB_PID_CANON_ES3, P_ES3_30, NULL}, - { USB_VID_CANON, USB_PID_CANON_ES30, P_ES3_30, NULL}, - { USB_VID_CANON, USB_PID_CANON_ES40, P_ES40, NULL}, - { 0, 0, 0, NULL} + { USB_VID_CANON, USB_PID_CANON_CP10, P_CP10, NULL, "selphycp10"}, + { USB_VID_CANON, USB_PID_CANON_CP100, P_CP_XXX, NULL, "selphycp100"}, + { USB_VID_CANON, USB_PID_CANON_CP200, P_CP_XXX, NULL, "selphycp200"}, + { USB_VID_CANON, USB_PID_CANON_CP220, P_CP_XXX, NULL, "selphycp220"}, + { USB_VID_CANON, USB_PID_CANON_CP300, P_CP_XXX, NULL, "selpyhcp300"}, + { USB_VID_CANON, USB_PID_CANON_CP330, P_CP_XXX, NULL, "selphycp330"}, + { USB_VID_CANON, USB_PID_CANON_CP400, P_CP_XXX, NULL, "selphycp400"}, + { USB_VID_CANON, USB_PID_CANON_CP500, P_CP_XXX, NULL, "selphycp500"}, + { USB_VID_CANON, USB_PID_CANON_CP510, P_CP_XXX, NULL, "selphycp510"}, + { USB_VID_CANON, USB_PID_CANON_CP520, P_CP_XXX, NULL, "selphycp520"}, + { USB_VID_CANON, USB_PID_CANON_CP530, P_CP_XXX, NULL, "selphycp530"}, + { USB_VID_CANON, USB_PID_CANON_CP600, P_CP_XXX, NULL, "selphycp600"}, + { USB_VID_CANON, USB_PID_CANON_CP710, P_CP_XXX, NULL, "selphycp710"}, + { USB_VID_CANON, USB_PID_CANON_CP720, P_CP_XXX, NULL, "selphycp720"}, + { USB_VID_CANON, USB_PID_CANON_CP730, P_CP_XXX, NULL, "selphycp730"}, + { USB_VID_CANON, USB_PID_CANON_CP740, P_CP_XXX, NULL, "selphycp740"}, + { USB_VID_CANON, USB_PID_CANON_CP750, P_CP_XXX, NULL, "selphycp750"}, + { USB_VID_CANON, USB_PID_CANON_CP760, P_CP_XXX, NULL, "selphycp760"}, + { USB_VID_CANON, USB_PID_CANON_CP770, P_CP_XXX, NULL, "selphycp770"}, + { USB_VID_CANON, USB_PID_CANON_CP780, P_CP_XXX, NULL, "selphycp780"}, + { USB_VID_CANON, USB_PID_CANON_CP790, P_CP790, NULL, "selphycp790"}, + { USB_VID_CANON, USB_PID_CANON_CP800, P_CP_XXX, NULL, "selphycp800"}, + { USB_VID_CANON, USB_PID_CANON_CP810, P_CP_XXX, NULL, "selphycp810"}, + { USB_VID_CANON, USB_PID_CANON_CP900, P_CP_XXX, NULL, "selphycp900"}, + { USB_VID_CANON, USB_PID_CANON_ES1, P_ES1, NULL, "selphyes1"}, + { USB_VID_CANON, USB_PID_CANON_ES2, P_ES2_20, NULL, "selphyes2"}, + { USB_VID_CANON, USB_PID_CANON_ES20, P_ES2_20, NULL, "selphyes20"}, + { USB_VID_CANON, USB_PID_CANON_ES3, P_ES3_30, NULL, "selphyes3"}, + { USB_VID_CANON, USB_PID_CANON_ES30, P_ES3_30, NULL, "selphyes30"}, + { USB_VID_CANON, USB_PID_CANON_ES40, P_ES40, NULL, "selphyes40"}, + { 0, 0, 0, NULL, NULL} } }; /* diff --git a/backend_canonselphyneo.c b/backend_canonselphyneo.c index 16c2cc4..75050d6 100644 --- a/backend_canonselphyneo.c +++ b/backend_canonselphyneo.c @@ -427,10 +427,16 @@ static void selphyneo_cmdline(void) DEBUG("\t\t[ -s ] # Query printer status\n"); } +static const char *canonselphyneo_prefixes[] = { + "canonselphyneo", + "selphycp820", "selphycp910", "selphycp1000", "selphycp1200", "selphycp1300", + NULL +}; + struct dyesub_backend canonselphyneo_backend = { .name = "Canon SELPHY CPneo", - .version = "0.11", - .uri_prefix = "canonselphyneo", + .version = "0.12", + .uri_prefixes = canonselphyneo_prefixes, .cmdline_usage = selphyneo_cmdline, .cmdline_arg = selphyneo_cmdline_arg, .init = selphyneo_init, @@ -439,12 +445,12 @@ struct dyesub_backend canonselphyneo_backend = { .read_parse = selphyneo_read_parse, .main_loop = selphyneo_main_loop, .devices = { - { USB_VID_CANON, USB_PID_CANON_CP820, P_CP910, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP910, P_CP910, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP1000, P_CP910, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP1200, P_CP910, NULL}, - { USB_VID_CANON, USB_PID_CANON_CP1300, P_CP910, NULL}, - { 0, 0, 0, NULL} + { USB_VID_CANON, USB_PID_CANON_CP820, P_CP910, NULL, "selphycp820"}, + { USB_VID_CANON, USB_PID_CANON_CP910, P_CP910, NULL, "selphycp910"}, + { USB_VID_CANON, USB_PID_CANON_CP1000, P_CP910, NULL, "elphycp1000"}, + { USB_VID_CANON, USB_PID_CANON_CP1200, P_CP910, NULL, "selphycp1100"}, + { USB_VID_CANON, USB_PID_CANON_CP1300, P_CP910, NULL, "selphycp1200"}, + { 0, 0, 0, NULL, NULL} } }; /* diff --git a/backend_citizencw01.c b/backend_citizencw01.c index 23740fa..1180082 100644 --- a/backend_citizencw01.c +++ b/backend_citizencw01.c @@ -856,11 +856,16 @@ static int cw01_cmdline_arg(void *vctx, int argc, char **argv) return 0; } +static const char *citizencw01_prefixes[] = { + "citizencw01", + NULL, +}; + /* Exported */ struct dyesub_backend cw01_backend = { .name = "Citizen CW-01", - .version = "0.12", - .uri_prefix = "citizencw01", + .version = "0.13", + .uri_prefixes = citizencw01_prefixes, .cmdline_usage = cw01_cmdline, .cmdline_arg = cw01_cmdline_arg, .init = cw01_init, @@ -870,9 +875,9 @@ struct dyesub_backend cw01_backend = { .main_loop = cw01_main_loop, .query_serno = cw01_query_serno, .devices = { - { USB_VID_CITIZEN, USB_PID_CITIZEN_CW01, P_CITIZEN_CW01, NULL}, -// { USB_VID_CITIZEN, USB_PID_OLMEC_OP900, P_CITIZEN_CW01, NULL}, - { 0, 0, 0, NULL} + { USB_VID_CITIZEN, USB_PID_CITIZEN_CW01, P_CITIZEN_CW01, NULL, "citizencw01"}, +// { USB_VID_CITIZEN, USB_PID_OLMEC_OP900, P_CITIZEN_CW01, NULL, "citizenop900"}, // XXX add me + { 0, 0, 0, NULL, NULL} } }; diff --git a/backend_common.c b/backend_common.c index fbf82fb..76fe83f 100644 --- a/backend_common.c +++ b/backend_common.c @@ -365,7 +365,8 @@ static char *url_decode(char *str) { static int probe_device(struct libusb_device *device, struct libusb_device_descriptor *desc, - char *prefix, char *manuf_override, + const char *uri_prefix, + const char *prefix, char *manuf_override, int found, int num_claim_attempts, int scan_only, char *match_serno, uint8_t *r_iface, uint8_t *r_altset, @@ -570,7 +571,7 @@ candidate: strncpy(buf + k, product, sizeof(buf)-k); fprintf(stdout, "direct %s://%s?serial=%s&backend=%s \"%s\" \"%s\" \"%s\" \"\"\n", - prefix, buf, serial, backend->uri_prefix, + prefix, buf, serial, uri_prefix, descr, descr, ieee_id? ieee_id : ""); } @@ -668,6 +669,7 @@ static int find_and_enumerate(struct libusb_context *ctx, int num; int i, j = 0, k; int found = -1; + const char *prefix = NULL; STATE("+org.gutenprint-searching-for-device\n"); @@ -689,12 +691,14 @@ static int find_and_enumerate(struct libusb_context *ctx, extra_vid == desc.idVendor && extra_pid == desc.idProduct) { found = i; + prefix = backends[k]->uri_prefixes[0]; goto match; } } if (desc.idVendor == backends[k]->devices[j].vid && (desc.idProduct == backends[k]->devices[j].pid || desc.idProduct == 0xffff)) { + prefix = backends[k]->devices[j].prefix; found = i; goto match; } @@ -704,7 +708,7 @@ static int find_and_enumerate(struct libusb_context *ctx, continue; match: - found = probe_device((*list)[i], &desc, + found = probe_device((*list)[i], &desc, prefix, URI_PREFIX, backends[k]->devices[j].manuf_str, found, num_claim_attempts, scan_only, match_serno, @@ -732,9 +736,7 @@ static struct dyesub_backend *find_backend(char *uri_prefix) const char **alias; if (!backend) return NULL; - if (!strcmp(uri_prefix, backend->uri_prefix)) - return backend; - for (alias = backend->altprefixes ; alias && *alias ; alias++) { + for (alias = backend->uri_prefixes ; alias && *alias ; alias++) { if (!strcmp(uri_prefix, *alias)) return backend; } @@ -801,9 +803,9 @@ void print_help(char *argv0, struct dyesub_backend *backend) break; DEBUG("\t# %s version %s\n", backend->name, backend->version); - DEBUG(" BACKEND=%s", backend->uri_prefix); - for (alias = backend->altprefixes ; alias && *alias ; alias++) - DEBUG2(" %s", *alias); + DEBUG(" BACKEND="); + for (alias = backend->uri_prefixes ; alias && *alias ; alias++) + DEBUG2("%s ", *alias); DEBUG2("\n"); if (backend->cmdline_usage) @@ -813,9 +815,9 @@ void print_help(char *argv0, struct dyesub_backend *backend) const char **alias; DEBUG("Standalone %s backend version %s\n", backend->name, backend->version); - DEBUG("\t%s", backend->uri_prefix); - for (alias = backend->altprefixes ; alias && *alias ; alias++) - DEBUG2(" %s", *alias); + DEBUG("\t"); + for (alias = backend->uri_prefixes ; alias && *alias ; alias++) + DEBUG2("%s ", *alias); DEBUG2("\n"); DEBUG("\t[ -D ] [ -G ] [ -f ]\n"); diff --git a/backend_common.h b/backend_common.h index 58d5360..9857ef9 100644 --- a/backend_common.h +++ b/backend_common.h @@ -139,14 +139,14 @@ struct device_id { uint16_t pid; int type; /* P_** */ char *manuf_str; + char *prefix; }; /* Backend Functions */ struct dyesub_backend { const char *name; const char *version; - const char *uri_prefix; - const char **altprefixes; + const char **uri_prefixes; void (*cmdline_usage)(void); /* Optional */ void *(*init)(void); void (*attach)(void *ctx, struct libusb_device_handle *dev, diff --git a/backend_dnpds40.c b/backend_dnpds40.c index 3f66a61..57bf65d 100644 --- a/backend_dnpds40.c +++ b/backend_dnpds40.c @@ -2548,17 +2548,18 @@ static int dnpds40_cmdline_arg(void *vctx, int argc, char **argv) return 0; } -static const char *dnpds40_altprefixes[] = { - "dnpds40", +static const char *dnpds40_prefixes[] = { + "dnp_citizen", + "dnpds40", "dnpds80", "dnpds80dx", "dnpds620", "dnpds820", "dnprx1", + "citizencw02", "citizencx02", NULL }; /* Exported */ struct dyesub_backend dnpds40_backend = { - .name = "DNP DS40/DS80/DSRX1/DS620/DS820", + .name = "DNP DS-series / Citizen C-series", .version = "0.98", - .uri_prefix = "dnp_citizen", - .altprefixes = dnpds40_altprefixes, + .uri_prefixes = dnpds40_prefixes, .cmdline_usage = dnpds40_cmdline, .cmdline_arg = dnpds40_cmdline_arg, .init = dnpds40_init, @@ -2568,15 +2569,15 @@ struct dyesub_backend dnpds40_backend = { .main_loop = dnpds40_main_loop, .query_serno = dnpds40_query_serno, .devices = { - { USB_VID_CITIZEN, USB_PID_DNP_DS40, P_DNP_DS40, NULL}, - { USB_VID_CITIZEN, USB_PID_DNP_DS80, P_DNP_DS80, NULL}, - { USB_VID_CITIZEN, USB_PID_DNP_DSRX1, P_DNP_DSRX1, NULL}, - { USB_VID_CITIZEN, USB_PID_DNP_DS620_OLD, P_DNP_DS620, NULL}, - { USB_VID_DNP, USB_PID_DNP_DS620, P_DNP_DS620, NULL}, - { USB_VID_DNP, USB_PID_DNP_DS80D, P_DNP_DS80D, NULL}, - { USB_VID_CITIZEN, USB_PID_CITIZEN_CW02, P_CITIZEN_OP900II, NULL}, - { USB_VID_CITIZEN, USB_PID_CITIZEN_CX02, P_DNP_DS620, NULL}, - { USB_VID_DNP, USB_PID_DNP_DS820, P_DNP_DS820, NULL}, - { 0, 0, 0, NULL} + { USB_VID_CITIZEN, USB_PID_DNP_DS40, P_DNP_DS40, NULL, "dnpds40"}, + { USB_VID_CITIZEN, USB_PID_DNP_DS80, P_DNP_DS80, NULL, "dnpds80"}, + { USB_VID_CITIZEN, USB_PID_DNP_DSRX1, P_DNP_DSRX1, NULL, "dnpdx1"}, + { USB_VID_CITIZEN, USB_PID_DNP_DS620_OLD, P_DNP_DS620, NULL, "dnpds620"}, + { USB_VID_DNP, USB_PID_DNP_DS620, P_DNP_DS620, NULL, "dnpds620"}, + { USB_VID_DNP, USB_PID_DNP_DS80D, P_DNP_DS80D, NULL, "dnpds80dx"}, + { USB_VID_CITIZEN, USB_PID_CITIZEN_CW02, P_CITIZEN_OP900II, NULL, "citizencw02"}, + { USB_VID_CITIZEN, USB_PID_CITIZEN_CX02, P_DNP_DS620, NULL, "citizencx02"}, + { USB_VID_DNP, USB_PID_DNP_DS820, P_DNP_DS820, NULL, "dnpds820"}, + { 0, 0, 0, NULL, NULL} } }; diff --git a/backend_kodak1400.c b/backend_kodak1400.c index d1b12bb..09bf62d 100644 --- a/backend_kodak1400.c +++ b/backend_kodak1400.c @@ -614,10 +614,15 @@ top: #define USB_PID_MITSU_3020D 0x038B #define USB_PID_MITSU_3020DA 0x03AA +static const char *kodak1400_prefixes[] = { + "kodak1400", "kodak805", "mitsu3020d", "mitsu3020da", + NULL, +}; + struct dyesub_backend kodak1400_backend = { .name = "Kodak 1400/805", - .version = "0.34", - .uri_prefix = "kodak1400", + .version = "0.35", + .uri_prefixes = kodak1400_prefixes, .cmdline_usage = kodak1400_cmdline, .cmdline_arg = kodak1400_cmdline_arg, .init = kodak1400_init, @@ -626,11 +631,11 @@ struct dyesub_backend kodak1400_backend = { .read_parse = kodak1400_read_parse, .main_loop = kodak1400_main_loop, .devices = { - { USB_VID_KODAK, USB_PID_KODAK_1400, P_KODAK_1400_805, "Kodak"}, - { USB_VID_KODAK, USB_PID_KODAK_805, P_KODAK_1400_805, "Kodak"}, - { USB_VID_MITSU, USB_PID_MITSU_3020D, P_KODAK_1400_805, NULL}, - { USB_VID_MITSU, USB_PID_MITSU_3020DA, P_KODAK_1400_805, NULL}, - { 0, 0, 0, NULL} + { USB_VID_KODAK, USB_PID_KODAK_1400, P_KODAK_1400_805, "Kodak", "kodak1400"}, + { USB_VID_KODAK, USB_PID_KODAK_805, P_KODAK_1400_805, "Kodak", "kodak805"}, + { USB_VID_MITSU, USB_PID_MITSU_3020D, P_KODAK_1400_805, NULL, "mitsu3020d"}, + { USB_VID_MITSU, USB_PID_MITSU_3020DA, P_KODAK_1400_805, NULL, "mitsu3020da" }, + { 0, 0, 0, NULL, NULL} } }; diff --git a/backend_kodak605.c b/backend_kodak605.c index a5470e5..1bff486 100644 --- a/backend_kodak605.c +++ b/backend_kodak605.c @@ -673,11 +673,16 @@ static int kodak605_cmdline_arg(void *vctx, int argc, char **argv) return 0; } +static const char *kodak605_prefixes[] = { + "kodak605", + NULL, +}; + /* Exported */ struct dyesub_backend kodak605_backend = { .name = "Kodak 605", - .version = "0.27", - .uri_prefix = "kodak605", + .version = "0.28", + .uri_prefixes = kodak605_prefixes, .cmdline_usage = kodak605_cmdline, .cmdline_arg = kodak605_cmdline_arg, .init = kodak605_init, @@ -686,8 +691,8 @@ struct dyesub_backend kodak605_backend = { .read_parse = kodak605_read_parse, .main_loop = kodak605_main_loop, .devices = { - { USB_VID_KODAK, USB_PID_KODAK_605, P_KODAK_605, "Kodak"}, - { 0, 0, 0, NULL} + { USB_VID_KODAK, USB_PID_KODAK_605, P_KODAK_605, "Kodak", "kodaka605"}, + { 0, 0, 0, NULL, NULL} } }; diff --git a/backend_kodak6800.c b/backend_kodak6800.c index 8b61a19..43de3d2 100644 --- a/backend_kodak6800.c +++ b/backend_kodak6800.c @@ -1256,8 +1256,9 @@ static int kodak6800_main_loop(void *vctx, int copies) { return CUPS_BACKEND_OK; } -static const char *kodak6800_altprefixes[] = { - "kodak6800", +static const char *kodak6800_prefixes[] = { + "kodak68x0", + "kodak6800", "kodak6850", NULL }; @@ -1265,8 +1266,7 @@ static const char *kodak6800_altprefixes[] = { struct dyesub_backend kodak6800_backend = { .name = "Kodak 6800/6850", .version = "0.59", - .uri_prefix = "kodak68x0", - .altprefixes = kodak6800_altprefixes, + .uri_prefixes = kodak6800_prefixes, .cmdline_usage = kodak6800_cmdline, .cmdline_arg = kodak6800_cmdline_arg, .init = kodak6800_init, @@ -1276,9 +1276,9 @@ struct dyesub_backend kodak6800_backend = { .main_loop = kodak6800_main_loop, .query_serno = kodak6800_query_serno, .devices = { - { USB_VID_KODAK, USB_PID_KODAK_6800, P_KODAK_6800, "Kodak"}, - { USB_VID_KODAK, USB_PID_KODAK_6850, P_KODAK_6850, "Kodak"}, - { 0, 0, 0, NULL} + { USB_VID_KODAK, USB_PID_KODAK_6800, P_KODAK_6800, "Kodak", "kodak6800"}, + { USB_VID_KODAK, USB_PID_KODAK_6850, P_KODAK_6850, "Kodak", "kodak6850"}, + { 0, 0, 0, NULL, NULL} } }; diff --git a/backend_magicard.c b/backend_magicard.c index 8234979..6dc5a68 100644 --- a/backend_magicard.c +++ b/backend_magicard.c @@ -887,10 +887,16 @@ static int magicard_cmdline_arg(void *vctx, int argc, char **argv) return 0; } +static const char *magicard_prefixes[] = { + "magicard", + "tango2e", "enduro", "enduroplus", + NULL +}; + struct dyesub_backend magicard_backend = { .name = "Magicard family", - .version = "0.09", - .uri_prefix = "magicard", + .version = "0.10", + .uri_prefixes = magicard_prefixes, .cmdline_arg = magicard_cmdline_arg, .cmdline_usage = magicard_cmdline, .init = magicard_init, @@ -899,11 +905,11 @@ struct dyesub_backend magicard_backend = { .read_parse = magicard_read_parse, .main_loop = magicard_main_loop, .devices = { - { USB_VID_MAGICARD, USB_PID_MAGICARD_TANGO2E, P_MAGICARD, NULL}, - { USB_VID_MAGICARD, USB_PID_MAGICARD_ENDURO, P_MAGICARD, NULL}, - { USB_VID_MAGICARD, USB_PID_MAGICARD_ENDUROPLUS, P_MAGICARD, NULL}, - { USB_VID_MAGICARD, 0xFFFF, P_MAGICARD, NULL}, - { 0, 0, 0, NULL} + { USB_VID_MAGICARD, USB_PID_MAGICARD_TANGO2E, P_MAGICARD, NULL, "tango2e"}, + { USB_VID_MAGICARD, USB_PID_MAGICARD_ENDURO, P_MAGICARD, NULL, "enduro"}, + { USB_VID_MAGICARD, USB_PID_MAGICARD_ENDUROPLUS, P_MAGICARD, NULL, "enduroplus"}, + { USB_VID_MAGICARD, 0xFFFF, P_MAGICARD, NULL, "magicard"}, + { 0, 0, 0, NULL, "magicard"} } }; diff --git a/backend_mitsu70x.c b/backend_mitsu70x.c index 5faa07e..f6e5329 100644 --- a/backend_mitsu70x.c +++ b/backend_mitsu70x.c @@ -1989,12 +1989,17 @@ static int mitsu70x_cmdline_arg(void *vctx, int argc, char **argv) return 0; } +static const char *mitsu70x_prefixes[] = { + "mitsu70x", + "mitsud80", "mitsuk60", "kodak305", "fujiask300", + NULL, +}; /* Exported */ struct dyesub_backend mitsu70x_backend = { - .name = "Mitsubishi CP-D70/D707/K60/D80", - .version = "0.75", - .uri_prefix = "mitsu70x", + .name = "Mitsubishi CP-D70 family", + .version = "0.76", + .uri_prefixes = mitsu70x_prefixes, .cmdline_usage = mitsu70x_cmdline, .cmdline_arg = mitsu70x_cmdline_arg, .init = mitsu70x_init, @@ -2004,13 +2009,13 @@ struct dyesub_backend mitsu70x_backend = { .main_loop = mitsu70x_main_loop, .query_serno = mitsu70x_query_serno, .devices = { - { USB_VID_MITSU, USB_PID_MITSU_D70X, P_MITSU_D70X, NULL}, - { USB_VID_MITSU, USB_PID_MITSU_K60, P_MITSU_K60, NULL}, - { USB_VID_MITSU, USB_PID_MITSU_D80, P_MITSU_D80, NULL}, -// { USB_VID_MITSU, USB_PID_MITSU_D90, P_MITSU_D90, NULL}, - { USB_VID_KODAK, USB_PID_KODAK305, P_KODAK_305, NULL}, - { USB_VID_FUJIFILM, USB_PID_FUJI_ASK300, P_FUJI_ASK300, NULL}, - { 0, 0, 0, NULL} + { USB_VID_MITSU, USB_PID_MITSU_D70X, P_MITSU_D70X, NULL, "mitsu70x"}, + { USB_VID_MITSU, USB_PID_MITSU_K60, P_MITSU_K60, NULL, "mitsuk60"}, + { USB_VID_MITSU, USB_PID_MITSU_D80, P_MITSU_D80, NULL, "mitsud80"}, +// { USB_VID_MITSU, USB_PID_MITSU_D90, P_MITSU_D90, NULL, "mitsud90"}, // XXX add me in! + { USB_VID_KODAK, USB_PID_KODAK305, P_KODAK_305, NULL, "kodak305"}, + { USB_VID_FUJIFILM, USB_PID_FUJI_ASK300, P_FUJI_ASK300, NULL, "fujiask300"}, + { 0, 0, 0, NULL, NULL} } }; diff --git a/backend_mitsu9550.c b/backend_mitsu9550.c index 58d9417..1b779d5 100644 --- a/backend_mitsu9550.c +++ b/backend_mitsu9550.c @@ -1268,8 +1268,9 @@ static int mitsu9550_cmdline_arg(void *vctx, int argc, char **argv) return 0; } -static const char *mitsu9550_altprefixes[] = { - "mitsu9550", +static const char *mitsu9550_prefixes[] = { + "mitsu9xxx", + "mitsu9000", "mitsu9500", "mitsu9550", "mitsi9600", "mitsu9800", "mitsu9810", NULL }; @@ -1277,8 +1278,7 @@ static const char *mitsu9550_altprefixes[] = { struct dyesub_backend mitsu9550_backend = { .name = "Mitsubishi CP9xxx family", .version = "0.31", - .uri_prefix = "mitsu9xxx", - .altprefixes = mitsu9550_altprefixes, + .uri_prefixes = mitsu9550_prefixes, .cmdline_usage = mitsu9550_cmdline, .cmdline_arg = mitsu9550_cmdline_arg, .init = mitsu9550_init, @@ -1288,23 +1288,23 @@ struct dyesub_backend mitsu9550_backend = { .main_loop = mitsu9550_main_loop, .query_serno = mitsu9550_query_serno, .devices = { - { USB_VID_MITSU, USB_PID_MITSU_9000AM, P_MITSU_9550, NULL}, - { USB_VID_MITSU, USB_PID_MITSU_9000D, P_MITSU_9550, NULL}, - { USB_VID_MITSU, USB_PID_MITSU_9500D, P_MITSU_9550, NULL}, - { USB_VID_MITSU, USB_PID_MITSU_9550D, P_MITSU_9550, NULL}, - { USB_VID_MITSU, USB_PID_MITSU_9550DS, P_MITSU_9550S, NULL}, - { USB_VID_MITSU, USB_PID_MITSU_9600D, P_MITSU_9600, NULL}, -// { USB_VID_MITSU, USB_PID_MITSU_9600D, P_MITSU_9600S, NULL}, - { USB_VID_MITSU, USB_PID_MITSU_9800D, P_MITSU_9800, NULL}, - { USB_VID_MITSU, USB_PID_MITSU_9800DS, P_MITSU_9800S, NULL}, - { USB_VID_MITSU, USB_PID_MITSU_98__D, P_MITSU_9810, NULL}, -// { USB_VID_MITSU, USB_PID_MITSU_9810D, P_MITSU_9810, NULL}, -// { USB_VID_MITSU, USB_PID_MITSU_9820DS, P_MITSU_9820S, NULL}, - { 0, 0, 0, NULL} + { USB_VID_MITSU, USB_PID_MITSU_9000AM, P_MITSU_9550, NULL, "mitsu9000"}, + { USB_VID_MITSU, USB_PID_MITSU_9000D, P_MITSU_9550, NULL, "mitsu9000"}, + { USB_VID_MITSU, USB_PID_MITSU_9500D, P_MITSU_9550, NULL, "mitsu9500"}, + { USB_VID_MITSU, USB_PID_MITSU_9550D, P_MITSU_9550, NULL, "mitsu9550"}, + { USB_VID_MITSU, USB_PID_MITSU_9550DS, P_MITSU_9550S, NULL, "mitsu9550"}, + { USB_VID_MITSU, USB_PID_MITSU_9600D, P_MITSU_9600, NULL, "mitsu9600"}, +// { USB_VID_MITSU, USB_PID_MITSU_9600D, P_MITSU_9600S, NULL, "mitsu9600"}, + { USB_VID_MITSU, USB_PID_MITSU_9800D, P_MITSU_9800, NULL, "mitsu9800"}, + { USB_VID_MITSU, USB_PID_MITSU_9800DS, P_MITSU_9800S, NULL, "mitsu9800"}, + { USB_VID_MITSU, USB_PID_MITSU_98__D, P_MITSU_9810, NULL, "mitsu9810"}, +// { USB_VID_MITSU, USB_PID_MITSU_9810D, P_MITSU_9810, NULL, "mitsu9810"}, +// { USB_VID_MITSU, USB_PID_MITSU_9820DS, P_MITSU_9820S, NULL, "mitsu9820"}, // XXX add "mitsu9820" + { 0, 0, 0, NULL, NULL} } }; -/* Mitsubish CP-9500/9550/9600/9800/9810 spool format: +/* Mitsubish CP-9500/9550/9600/9800/9810/9820 spool format: Spool file consists of 3 (or 4) 50-byte headers, followed by three image planes, each with a 12-byte header, then a 4-byte footer. diff --git a/backend_mitsup95d.c b/backend_mitsup95d.c index cb9b469..9f26454 100644 --- a/backend_mitsup95d.c +++ b/backend_mitsup95d.c @@ -505,6 +505,11 @@ static int mitsup95d_get_status(struct mitsup95d_ctx *ctx) return CUPS_BACKEND_OK; } +static void mitsup95d_cmdline(void) +{ + DEBUG("\t\t[ -s ] # Query status\n"); +} + static int mitsup95d_cmdline_arg(void *vctx, int argc, char **argv) { struct mitsup95d_ctx *ctx = vctx; @@ -529,21 +534,28 @@ static int mitsup95d_cmdline_arg(void *vctx, int argc, char **argv) return 0; } +static const char *mitsup95d_prefixes[] = { + "mitsup9x", + "mitsup95d", "mitsup93d", + NULL +}; + /* Exported */ struct dyesub_backend mitsup95d_backend = { .name = "Mitsubishi P93D/P95D", - .version = "0.06", - .uri_prefix = "mitsup95d", + .version = "0.07", + .uri_prefixes = mitsup95d_prefixes, .cmdline_arg = mitsup95d_cmdline_arg, + .cmdline_usage = mitsup95d_cmdline, .init = mitsup95d_init, .attach = mitsup95d_attach, .teardown = mitsup95d_teardown, .read_parse = mitsup95d_read_parse, .main_loop = mitsup95d_main_loop, .devices = { - { USB_VID_MITSU, USB_PID_MITSU_P93D, P_MITSU_P93D, NULL}, - { USB_VID_MITSU, USB_PID_MITSU_P95D, P_MITSU_P95D, NULL}, - { 0, 0, 0, NULL} + { USB_VID_MITSU, USB_PID_MITSU_P93D, P_MITSU_P93D, NULL, "mitsup95d"}, + { USB_VID_MITSU, USB_PID_MITSU_P95D, P_MITSU_P95D, NULL, "mitsup93d"}, + { 0, 0, 0, NULL, NULL} } }; diff --git a/backend_shinkos1245.c b/backend_shinkos1245.c index ba1d0e6..ca9a19f 100644 --- a/backend_shinkos1245.c +++ b/backend_shinkos1245.c @@ -1641,10 +1641,15 @@ static int shinkos1245_query_serno(struct libusb_device_handle *dev, uint8_t end #define USB_VID_SHINKO 0x10CE #define USB_PID_SHINKO_S1245 0x0007 +static const char *shinkos1245_prefixes[] = { + "shinkos1245", + NULL +}; + struct dyesub_backend shinkos1245_backend = { .name = "Shinko/Sinfonia CHC-S1245", - .version = "0.18", - .uri_prefix = "shinkos1245", + .version = "0.19", + .uri_prefixes = shinkos1245_prefixes, .cmdline_usage = shinkos1245_cmdline, .cmdline_arg = shinkos1245_cmdline_arg, .init = shinkos1245_init, @@ -1654,8 +1659,8 @@ struct dyesub_backend shinkos1245_backend = { .main_loop = shinkos1245_main_loop, .query_serno = shinkos1245_query_serno, .devices = { - { USB_VID_SHINKO, USB_PID_SHINKO_S1245, P_SHINKO_S1245, NULL}, - { 0, 0, 0, NULL} + { USB_VID_SHINKO, USB_PID_SHINKO_S1245, P_SHINKO_S1245, NULL, "shinkos1245"}, + { 0, 0, 0, NULL, NULL} } }; diff --git a/backend_shinkos2145.c b/backend_shinkos2145.c index 436f300..75d22c5 100644 --- a/backend_shinkos2145.c +++ b/backend_shinkos2145.c @@ -1750,10 +1750,15 @@ static int shinkos2145_query_serno(struct libusb_device_handle *dev, uint8_t end #define USB_VID_SHINKO 0x10CE #define USB_PID_SHINKO_S2145 0x000E +static const char *shinkos2145_prefixes[] = { + "shinkos2145", + NULL +}; + struct dyesub_backend shinkos2145_backend = { .name = "Shinko/Sinfonia CHC-S2145", - .version = "0.49", - .uri_prefix = "shinkos2145", + .version = "0.50", + .uri_prefixes = shinkos2145_prefixes, .cmdline_usage = shinkos2145_cmdline, .cmdline_arg = shinkos2145_cmdline_arg, .init = shinkos2145_init, @@ -1763,8 +1768,8 @@ struct dyesub_backend shinkos2145_backend = { .main_loop = shinkos2145_main_loop, .query_serno = shinkos2145_query_serno, .devices = { - { USB_VID_SHINKO, USB_PID_SHINKO_S2145, P_SHINKO_S2145, NULL}, - { 0, 0, 0, NULL} + { USB_VID_SHINKO, USB_PID_SHINKO_S2145, P_SHINKO_S2145, NULL, "shinkos2145"}, + { 0, 0, 0, NULL, NULL} } }; diff --git a/backend_shinkos6145.c b/backend_shinkos6145.c index 7cb999b..c8e44dd 100644 --- a/backend_shinkos6145.c +++ b/backend_shinkos6145.c @@ -2488,10 +2488,15 @@ static int shinkos6145_query_serno(struct libusb_device_handle *dev, uint8_t end #define USB_PID_SHINKO_S6145 0x0019 #define USB_PID_SHINKO_S6145D 0x001E /* Aka CIAAT Brava 21 */ +static const char *shinkos6145_prefixes[] = { + "shinkos6145", "brava21", + NULL +}; + struct dyesub_backend shinkos6145_backend = { .name = "Shinko/Sinfonia CHC-S6145", - .version = "0.22", - .uri_prefix = "shinkos6145", + .version = "0.23", + .uri_prefixes = shinkos6145_prefixes, .cmdline_usage = shinkos6145_cmdline, .cmdline_arg = shinkos6145_cmdline_arg, .init = shinkos6145_init, @@ -2501,9 +2506,9 @@ struct dyesub_backend shinkos6145_backend = { .main_loop = shinkos6145_main_loop, .query_serno = shinkos6145_query_serno, .devices = { - { USB_VID_SHINKO, USB_PID_SHINKO_S6145, P_SHINKO_S6145, NULL}, - { USB_VID_SHINKO, USB_PID_SHINKO_S6145D, P_SHINKO_S6145D, NULL}, - { 0, 0, 0, NULL} + { USB_VID_SHINKO, USB_PID_SHINKO_S6145, P_SHINKO_S6145, NULL, "shinkos6145"}, + { USB_VID_SHINKO, USB_PID_SHINKO_S6145D, P_SHINKO_S6145D, NULL, "brava21"}, + { 0, 0, 0, NULL, NULL} } }; diff --git a/backend_shinkos6245.c b/backend_shinkos6245.c index 177d072..593e33d 100644 --- a/backend_shinkos6245.c +++ b/backend_shinkos6245.c @@ -1897,10 +1897,15 @@ static int shinkos6245_query_serno(struct libusb_device_handle *dev, uint8_t end #define USB_VID_HITI 0x0D16 #define USB_PID_HITI_P910L 0x000E +static const char *shinkos6245_prefixes[] = { + "shinkos6245", "hitip910", + NULL +}; + struct dyesub_backend shinkos6245_backend = { .name = "Shinko/Sinfonia CHC-S6245", - .version = "0.08WIP", - .uri_prefix = "shinkos6245", + .version = "0.09WIP", + .uri_prefixes = shinkos6245_prefixes, .cmdline_usage = shinkos6245_cmdline, .cmdline_arg = shinkos6245_cmdline_arg, .init = shinkos6245_init, @@ -1910,9 +1915,9 @@ struct dyesub_backend shinkos6245_backend = { .main_loop = shinkos6245_main_loop, .query_serno = shinkos6245_query_serno, .devices = { - { USB_VID_SHINKO, USB_PID_SHINKO_S6245, P_SHINKO_S6245, NULL}, - { USB_VID_HITI, USB_PID_HITI_P910L, P_SHINKO_S6245, NULL}, - { 0, 0, 0, NULL} + { USB_VID_SHINKO, USB_PID_SHINKO_S6245, P_SHINKO_S6245, NULL, "shinkos6245"}, + { USB_VID_HITI, USB_PID_HITI_P910L, P_SHINKO_S6245, NULL, "hitip910"}, + { 0, 0, 0, NULL, NULL} } }; diff --git a/backend_sonyupdr150.c b/backend_sonyupdr150.c index 1c385c0..2166b3d 100644 --- a/backend_sonyupdr150.c +++ b/backend_sonyupdr150.c @@ -277,10 +277,14 @@ static int updr150_cmdline_arg(void *vctx, int argc, char **argv) return 0; } +static const char *sonyupdr150_prefixes[] = { + "sonyupdr150", "sonyupdr200", "sonyupcr10" +}; + struct dyesub_backend updr150_backend = { .name = "Sony UP-DR150/UP-DR200/UP-CR10", - .version = "0.19", - .uri_prefix = "sonyupdr150", + .version = "0.20", + .uri_prefixes = sonyupdr150_prefixes, .cmdline_arg = updr150_cmdline_arg, .init = updr150_init, .attach = updr150_attach, @@ -288,10 +292,10 @@ struct dyesub_backend updr150_backend = { .read_parse = updr150_read_parse, .main_loop = updr150_main_loop, .devices = { - { USB_VID_SONY, USB_PID_SONY_UPDR150, P_SONY_UPDR150, NULL}, - { USB_VID_SONY, USB_PID_SONY_UPDR200, P_SONY_UPDR150, NULL}, - { USB_VID_SONY, USB_PID_SONY_UPCR10, P_SONY_UPCR10, NULL}, - { 0, 0, 0, NULL} + { USB_VID_SONY, USB_PID_SONY_UPDR150, P_SONY_UPDR150, NULL, "sonyupdr150"}, + { USB_VID_SONY, USB_PID_SONY_UPDR200, P_SONY_UPDR150, NULL, "sonyupdr200"}, + { USB_VID_SONY, USB_PID_SONY_UPCR10, P_SONY_UPCR10, NULL, "sonyupcr10"}, + { 0, 0, 0, NULL, NULL} } };