mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-27 13:34:19 -04:00
CODE128: optimize for extended ASCII as well using techniques from
BWIPP minimal encoding by Bue Jensen (BWIPP PR #278); new extra escape `\^@` to turn off manual switching zint.h: increase `symbol->text` size 200 -> 256 (means that for the moment can no longer generate ZINT_WARN_HRT_TRUNCATED) GS1_128/GS1_128_CC: warn if READER_INIT option used CODE16K: move `c16k_set_a/b/c()` routines from "code128.c" and rename `c16k_` (also `C128_` defines to `C16K_`) common: make `itoc()` simple macro which adds '0' (>= 10 now ':', ';' etc) and adjust `expand()` accordingly for slight speed-up general: EXTRA_ESCAPE_MODE now implies ESCAPE_MODE tests: update BWIPP to latest and enable CODE128AB ("suppressc"); new test args '-n' (exclude func) and '-m' (match func)
This commit is contained in:
parent
c9909d3d91
commit
86b6a0553b
23 changed files with 1113 additions and 1017 deletions
|
@ -151,7 +151,7 @@ static char msi_check_digit_mod11(const unsigned char source[], const int length
|
|||
}
|
||||
}
|
||||
|
||||
return itoc((11 - x % 11) % 11); /* Will return 'A' for 10 */
|
||||
return itoc((11 - x % 11) % 11); /* Will return ':' for 10 */
|
||||
}
|
||||
|
||||
/* Plain MSI Plessey - does not calculate any check character */
|
||||
|
@ -241,7 +241,7 @@ static char *msi_plessey_mod11(struct zint_symbol *symbol, const unsigned char s
|
|||
|
||||
/* Append check digit */
|
||||
check_digit = msi_check_digit_mod11(source, length, wrap);
|
||||
if (check_digit == 'A') {
|
||||
if (check_digit == ':') {
|
||||
memcpy(d, MSITable[1], 8);
|
||||
d += 8;
|
||||
memcpy(d, MSITable[0], 8);
|
||||
|
@ -254,7 +254,7 @@ static char *msi_plessey_mod11(struct zint_symbol *symbol, const unsigned char s
|
|||
symbol->text[0] = '\0';
|
||||
ustrncat(symbol->text, source, length);
|
||||
if (!no_checktext) {
|
||||
if (check_digit == 'A') {
|
||||
if (check_digit == ':') {
|
||||
ustrcat(symbol->text, "10");
|
||||
} else {
|
||||
symbol->text[length] = check_digit;
|
||||
|
@ -279,7 +279,7 @@ static char *msi_plessey_mod1110(struct zint_symbol *symbol, const unsigned char
|
|||
|
||||
/* Append first (mod 11) digit */
|
||||
check_digit = msi_check_digit_mod11(source, length, wrap);
|
||||
if (check_digit == 'A') {
|
||||
if (check_digit == ':') {
|
||||
temp[temp_len++] = '1';
|
||||
temp[temp_len++] = '0';
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue