1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-05-08 07:03:50 +00:00

AZTEC: add manual FNC1 support:

improve P/S vs P/L choice when have ECI;
  add ZINT_DEBUG_TEST dump
AUSPOST: allow variable length data input
DATAMATRIX: do `EXTRA_ESCAPE_MODE` processing up front & check have
  non-zero length afterwards;
  disallow `READER_INIT` and `EXTRA_ESCAPE_MODE`;
general: add new `z_zero_fill()` func & use;
  add new `z_extra_escape_position_fnc1()` helper;
  in `z_ct_set_seg_extra_escapes_eci` check position FNC1 whether
  or not have ECI
library: escape_char_process: note escaped backslash followed by
  caret by passes `EXTRA_ESCAPE_MODE` check
test suite: BWIPP: update to latest; support AUSPOST variants;
  process `EXTRA_ESCAPE_MODE` escaping up front
This commit is contained in:
gitlost
2026-04-27 01:02:25 +01:00
parent b40393723f
commit 0a3ffc1dc2
31 changed files with 1968 additions and 905 deletions

View File

@@ -41,7 +41,7 @@ INTERNAL int zint_c25_inter_common(struct zint_symbol *symbol, unsigned char sou
/* Interleaved 2-of-5 (ITF-14) */
INTERNAL int zint_itf14(struct zint_symbol *symbol, unsigned char source[], int length) {
int i, error_number, zeroes;
int i, error_number;
unsigned char local_source[14];
unsigned char have_check_digit = '\0';
unsigned char check_digit;
@@ -70,11 +70,7 @@ INTERNAL int zint_itf14(struct zint_symbol *symbol, unsigned char source[], int
}
/* Add leading zeros as required */
zeroes = 13 - length;
for (i = 0; i < zeroes; i++) {
local_source[i] = '0';
}
memcpy(local_source + zeroes, source, length);
z_zero_fill(source, length, local_source, 13);
/* Calculate the check digit - the same method used for EAN-13 */
check_digit = (unsigned char) zint_gs1_check_digit(local_source, 13);
@@ -128,7 +124,6 @@ INTERNAL int zint_dpleit(struct zint_symbol *symbol, unsigned char source[], int
unsigned int count;
int factor;
unsigned char local_source[14];
int zeroes;
count = 0;
if (length > 13) {
@@ -139,10 +134,7 @@ INTERNAL int zint_dpleit(struct zint_symbol *symbol, unsigned char source[], int
"Invalid character at position %d in input (digits only)", i);
}
zeroes = 13 - length;
for (i = 0; i < zeroes; i++)
local_source[i] = '0';
memcpy(local_source + zeroes, source, length);
z_zero_fill(source, length, local_source, 13);
factor = 4;
for (i = 12; i >= 0; i--) {
@@ -169,7 +161,7 @@ INTERNAL int zint_dpleit(struct zint_symbol *symbol, unsigned char source[], int
/* Deutsche Post Identcode */
/* See dpleit() for (sort of) documentation reference */
INTERNAL int zint_dpident(struct zint_symbol *symbol, unsigned char source[], int length) {
int i, error_number, zeroes;
int i, error_number;
unsigned int count;
int factor;
unsigned char local_source[12];
@@ -183,10 +175,7 @@ INTERNAL int zint_dpident(struct zint_symbol *symbol, unsigned char source[], in
"Invalid character at position %d in input (digits only)", i);
}
zeroes = 11 - length;
for (i = 0; i < zeroes; i++)
local_source[i] = '0';
memcpy(local_source + zeroes, source, length);
z_zero_fill(source, length, local_source, 11);
factor = 4;
for (i = 10; i >= 0; i--) {