mirror of
https://git.code.sf.net/p/zint/code
synced 2026-05-14 18:13:53 +00:00
AUSPOST: support Null FCC (DPID all zeroes); TODO: BWIPP support
CODE128: properly fix not switching before FNC1 in 2nd position after alpha (commit [7b0767]) PLANET/KIX: adapt POSTNET to cater for both general: use static strings to save a few bytes (start/stop in particular); various other code fiddles postal: move tables into funcs
This commit is contained in:
@@ -1671,9 +1671,14 @@ static void gs1se_gs_caret_sub(const unsigned char *src, const int length, unsig
|
||||
/* Use GS1 Syntax Engine to verify */
|
||||
static int gs1se_verify(struct zint_symbol *symbol, const unsigned char source[], const int length,
|
||||
unsigned char reduced[], int *p_reduced_length) {
|
||||
static const char linear_dummies[3][19] = {
|
||||
{ '[','0','1',']','1','2','3','4','5','6','7','8','9','0','1','2','3','1','|' }, /* Normal */
|
||||
{ '(','0','1',')','1','2','3','4','5','6','7','8','9','0','1','2','3','1','|' }, /* Parens */
|
||||
{ '^','0','1','1','2','3','4','5','6','7','8','9','0','1','2','3','1','|','^' }, /* Raw/caret */
|
||||
};
|
||||
int i, j;
|
||||
const int primary_len = z_is_composite(symbol->symbology) ? (int) strlen(symbol->primary) : 0;
|
||||
const int gs1parens_mode = symbol->input_mode & GS1PARENS_MODE;
|
||||
const int gs1parens_mode = !!(symbol->input_mode & GS1PARENS_MODE);
|
||||
const int gs1raw_mode = !!(symbol->input_mode & GS1RAW_MODE);
|
||||
const int gs1_caret = source[0] == '^';
|
||||
const int is_digital_link = !primary_len && !gs1_caret && gs1_is_digital_link(source, length);
|
||||
@@ -1742,7 +1747,7 @@ static int gs1se_verify(struct zint_symbol *symbol, const unsigned char source[]
|
||||
} else {
|
||||
/* Just use dummy "01" linear */
|
||||
if (gs1_caret || gs1raw_mode) {
|
||||
memcpy(local_source_buf, "^0112345678901231|^", 18 + gs1raw_mode);
|
||||
memcpy(local_source_buf, linear_dummies[2], 18 + gs1raw_mode);
|
||||
if (gs1_caret) {
|
||||
memcpy(local_source_buf + 18, source, length + 1); /* Include terminating NUL */
|
||||
} else {
|
||||
@@ -1750,7 +1755,7 @@ static int gs1se_verify(struct zint_symbol *symbol, const unsigned char source[]
|
||||
}
|
||||
local_length += 18 + gs1raw_mode;
|
||||
} else {
|
||||
memcpy(local_source_buf, gs1parens_mode ? "(01)12345678901231|" : "[01]12345678901231|", 19);
|
||||
memcpy(local_source_buf, linear_dummies[gs1parens_mode], 19);
|
||||
memcpy(local_source_buf + 19, source, length + 1); /* Include terminating NUL */
|
||||
local_length += 19;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user