library: compat symbology 39 fix; ISBN: "X" check

WARN_FAIL_ALL: always return error: ZINT_ERROR_USES_ECI/NON_COMPLIANT
Fuller error messages; more comments zint.h
mainwindow.cpp: replace metaobject ENUM with array
  (suppresses virtual in constructor warning)
This commit is contained in:
gitlost
2021-07-06 19:53:31 +01:00
parent 7cd0d9ae22
commit 3c1869b032
53 changed files with 1453 additions and 1062 deletions

View File

@ -130,12 +130,12 @@ static int postnet(struct zint_symbol *symbol, unsigned char source[], char dest
int error_number;
if (length != 5 && length != 9 && length != 11) {
strcpy(symbol->errtxt, "480: Input wrong length");
strcpy(symbol->errtxt, "480: Input wrong length (5, 9 or 11 characters only)");
return ZINT_ERROR_TOO_LONG;
}
error_number = is_sane(NEON, source, length);
if (error_number == ZINT_ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "481: Invalid characters in data");
strcpy(symbol->errtxt, "481: Invalid character in data (digits only)");
return error_number;
}
sum = 0;
@ -191,12 +191,12 @@ static int planet(struct zint_symbol *symbol, unsigned char source[], char dest[
int error_number;
if (length != 11 && length != 13) {
strcpy(symbol->errtxt, "482: Input wrong length");
strcpy(symbol->errtxt, "482: Input wrong length (11 or 13 characters only)");
return ZINT_ERROR_TOO_LONG;
}
error_number = is_sane(NEON, source, length);
if (error_number == ZINT_ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "483: Invalid characters in data");
strcpy(symbol->errtxt, "483: Invalid character in data (digits only)");
return error_number;
}
sum = 0;
@ -252,12 +252,12 @@ INTERNAL int korea_post(struct zint_symbol *symbol, unsigned char source[], int
char localstr[8], dest[80];
if (length > 6) {
strcpy(symbol->errtxt, "484: Input too long");
strcpy(symbol->errtxt, "484: Input too long (6 character maximum)");
return ZINT_ERROR_TOO_LONG;
}
error_number = is_sane(NEON, source, length);
if (error_number == ZINT_ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "485: Invalid characters in data");
strcpy(symbol->errtxt, "485: Invalid character in data (digits only)");
return error_number;
}
zeroes = 6 - length;
@ -294,7 +294,7 @@ INTERNAL int fim(struct zint_symbol *symbol, unsigned char source[], int length)
char dest[16] = {0};
if (length > 1) {
strcpy(symbol->errtxt, "486: Input too long");
strcpy(symbol->errtxt, "486: Input too long (1 character maximum)");
return ZINT_ERROR_TOO_LONG;
}
@ -316,7 +316,7 @@ INTERNAL int fim(struct zint_symbol *symbol, unsigned char source[], int length)
strcpy(dest, "1111131311111");
break;
default:
strcpy(symbol->errtxt, "487: Invalid characters in data");
strcpy(symbol->errtxt, "487: Invalid character in data (\"A\", \"B\", \"C\" or \"D\" only)");
return ZINT_ERROR_INVALID_DATA;
break;
}
@ -416,13 +416,13 @@ INTERNAL int royal_plot(struct zint_symbol *symbol, unsigned char source[], int
strcpy(height_pattern, "");
if (length > 50) {
strcpy(symbol->errtxt, "488: Input too long");
strcpy(symbol->errtxt, "488: Input too long (50 character maximum)");
return ZINT_ERROR_TOO_LONG;
}
to_upper(source);
error_number = is_sane(KRSET, source, length);
if (error_number == ZINT_ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "489: Invalid characters in data");
strcpy(symbol->errtxt, "489: Invalid character in data (alphanumerics only)");
return error_number;
}
/*check = */rm4scc(source, height_pattern, length);
@ -472,13 +472,13 @@ INTERNAL int kix_code(struct zint_symbol *symbol, unsigned char source[], int le
strcpy(height_pattern, "");
if (length > 18) {
strcpy(symbol->errtxt, "490: Input too long");
strcpy(symbol->errtxt, "490: Input too long (18 character maximum)");
return ZINT_ERROR_TOO_LONG;
}
to_upper(source);
error_number = is_sane(KRSET, source, length);
if (error_number == ZINT_ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "491: Invalid characters in data");
strcpy(symbol->errtxt, "491: Invalid character in data (alphanumerics only)");
return error_number;
}
@ -527,14 +527,14 @@ INTERNAL int daft_code(struct zint_symbol *symbol, unsigned char source[], int l
strcpy(height_pattern, "");
if (length > 50) {
strcpy(symbol->errtxt, "492: Input too long");
strcpy(symbol->errtxt, "492: Input too long (50 character maximum)");
return ZINT_ERROR_TOO_LONG;
}
to_upper((unsigned char*) source);
error_number = is_sane(DAFTSET, (unsigned char*) source, length);
if (error_number == ZINT_ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "493: Invalid characters in data");
strcpy(symbol->errtxt, "493: Invalid character in data (\"D\", \"A\", \"F\" and \"T\" only)");
return error_number;
}
@ -593,12 +593,12 @@ INTERNAL int flattermarken(struct zint_symbol *symbol, unsigned char source[], i
char dest[512]; /* 90 * 4 + 1 ~ */
if (length > 90) {
strcpy(symbol->errtxt, "494: Input too long");
strcpy(symbol->errtxt, "494: Input too long (90 character maximum)");
return ZINT_ERROR_TOO_LONG;
}
error_number = is_sane(NEON, source, length);
if (error_number == ZINT_ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "495: Invalid characters in data");
strcpy(symbol->errtxt, "495: Invalid character in data (digits only)");
return error_number;
}
*dest = '\0';
@ -628,7 +628,7 @@ INTERNAL int japan_post(struct zint_symbol *symbol, unsigned char source[], int
#endif
if (length > 20) {
strcpy(symbol->errtxt, "496: Input too long");
strcpy(symbol->errtxt, "496: Input too long (20 character maximum)");
return ZINT_ERROR_TOO_LONG;
}
@ -636,7 +636,7 @@ INTERNAL int japan_post(struct zint_symbol *symbol, unsigned char source[], int
to_upper((unsigned char*) local_source);
if (is_sane(SHKASUTSET, (unsigned char*) local_source, length) == ZINT_ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "497: Invalid characters in data");
strcpy(symbol->errtxt, "497: Invalid character in data (alphanumerics and \"-\" only)");
return ZINT_ERROR_INVALID_DATA;
}
memset(inter, 'd', 20); /* Pad character CC4 */