1
0
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:
gitlost
2026-04-22 21:25:16 +01:00
parent 7f688b9e58
commit b40393723f
24 changed files with 479 additions and 517 deletions

View File

@@ -36,15 +36,15 @@
#include "common.h"
#include "gs1.h"
static const char C25InterTable[10][5] = {
{'1','1','3','3','1'}, {'3','1','1','1','3'}, {'1','3','1','1','3'}, {'3','3','1','1','1'},
{'1','1','3','1','3'}, {'3','1','3','1','1'}, {'1','3','3','1','1'}, {'1','1','1','3','3'},
{'3','1','1','3','1'}, {'1','3','1','3','1'}
};
/* Common to Interleaved, and to ITF-14, DP Leitcode, DP Identcode */
INTERNAL int zint_c25_inter_common(struct zint_symbol *symbol, unsigned char source[], int length,
const int checkdigit_option, const int dont_set_height) {
static const char C25InterTable[10][5] = {
{'1','1','3','3','1'}, {'3','1','1','1','3'}, {'1','3','1','1','3'}, {'3','3','1','1','1'},
{'1','1','3','1','3'}, {'3','1','3','1','1'}, {'1','3','3','1','1'}, {'1','1','1','3','3'},
{'3','1','1','3','1'}, {'1','3','1','3','1'}
};
static const char stop_start[5] = { '3','1','1','1','1' }; /* 1st 3 stop, last 4 start */
int i, j, error_number = 0;
char dest[638]; /* 4 + (125 + 1) * 5 + 3 + 1 = 638 */
char *d = dest;
@@ -77,7 +77,7 @@ INTERNAL int zint_c25_inter_common(struct zint_symbol *symbol, unsigned char sou
}
/* Start character */
memcpy(d, "1111", 4);
memcpy(d, stop_start + 1, 4);
d += 4;
for (i = 0; i < length; i += 2) {
@@ -93,7 +93,7 @@ INTERNAL int zint_c25_inter_common(struct zint_symbol *symbol, unsigned char sou
}
/* Stop character */
memcpy(d, "311", 3);
memcpy(d, stop_start, 3);
d += 3;
z_expand(symbol, dest, (int) (d - dest));