Re commit [789e04] and [86363f] allow prefixes without check digit

This commit is contained in:
gitlost 2025-04-21 18:45:23 +01:00
parent 3592edd64e
commit 51ebca182c
12 changed files with 400 additions and 393 deletions

View file

@ -46,12 +46,12 @@ INTERNAL int itf14(struct zint_symbol *symbol, unsigned char source[], int lengt
unsigned char have_check_digit = '\0'; unsigned char have_check_digit = '\0';
unsigned char check_digit; unsigned char check_digit;
/* Allow and ignore any AI prefix, but only if have check digit */ /* Allow and ignore any AI prefix */
if (length == 18 && (memcmp(source, "[01]", 4) == 0 || memcmp(source, "(01)", 4) == 0)) { if ((length == 17 || length == 18) && (memcmp(source, "[01]", 4) == 0 || memcmp(source, "(01)", 4) == 0)) {
source += 4; source += 4;
length -= 4; length -= 4;
/* Likewise initial '01', if have check digit */ /* Likewise initial '01' */
} else if (length == 16 && source[0] == '0' && source[1] == '1') { } else if ((length == 15 || length == 16) && source[0] == '0' && source[1] == '1') {
source += 2; source += 2;
length -= 2; length -= 2;
} }

View file

@ -54,13 +54,14 @@ static int nve18_or_ean14(struct zint_symbol *symbol, const unsigned char source
unsigned char check_digit; unsigned char check_digit;
int error_number; int error_number;
/* Allow and ignore any AI prefix, but only if have check digit */ /* Allow and ignore any AI prefix */
if (length == data_len + 1 + 4 if ((length == data_len + 4 || length == data_len + 1 + 4)
&& (memcmp(source, prefix[idx][0], 4) == 0 || memcmp(source, prefix[idx][1], 4) == 0)) { && (memcmp(source, prefix[idx][0], 4) == 0 || memcmp(source, prefix[idx][1], 4) == 0)) {
source += 4; source += 4;
length -= 4; length -= 4;
/* Likewise initial '01' (EAN-14) or '00' (NVE-18), if have check digit */ /* Likewise initial '01' (EAN-14) or '00' (NVE-18) */
} else if (length == data_len + 1 + 2 && source[0] == prefix[idx][0][1] && source[1] == prefix[idx][0][2]) { } else if ((length == data_len + 2 || length == data_len + 1 + 2)
&& source[0] == prefix[idx][0][1] && source[1] == prefix[idx][0][2]) {
source += 2; source += 2;
length -= 2; length -= 2;
} }

View file

@ -278,6 +278,7 @@ INTERNAL int code49(struct zint_symbol *symbol, unsigned char source[], int leng
for (i = 0; i < rows - 1; i++) { for (i = 0; i < rows - 1; i++) {
for (j = 0; j < 4; j++) { for (j = 0; j < 4; j++) {
local_value = (c_grid[i][2 * j] * 49) + c_grid[i][(2 * j) + 1]; local_value = (c_grid[i][2 * j] * 49) + c_grid[i][(2 * j) + 1];
/* Maximum value of `x/y/z_count` is at most 8 × (4 × 44 × 48 × 52) = 3514368 so won't overflow */
x_count += c49_x_weight[posn_val] * local_value; x_count += c49_x_weight[posn_val] * local_value;
y_count += c49_y_weight[posn_val] * local_value; y_count += c49_y_weight[posn_val] * local_value;
z_count += c49_z_weight[posn_val] * local_value; z_count += c49_z_weight[posn_val] * local_value;
@ -287,8 +288,9 @@ INTERNAL int code49(struct zint_symbol *symbol, unsigned char source[], int leng
if (rows > 6) { if (rows > 6) {
/* Add Z Symbol Check */ /* Add Z Symbol Check */
c_grid[rows - 1][0] = (z_count % 2401) / 49; z_count %= 2401;
c_grid[rows - 1][1] = (z_count % 2401) % 49; c_grid[rows - 1][0] = z_count / 49;
c_grid[rows - 1][1] = z_count % 49;
} }
local_value = (c_grid[rows - 1][0] * 49) + c_grid[rows - 1][1]; local_value = (c_grid[rows - 1][0] * 49) + c_grid[rows - 1][1];
@ -297,15 +299,17 @@ INTERNAL int code49(struct zint_symbol *symbol, unsigned char source[], int leng
posn_val++; posn_val++;
/* Add Y Symbol Check */ /* Add Y Symbol Check */
c_grid[rows - 1][2] = (y_count % 2401) / 49; y_count %= 2401;
c_grid[rows - 1][3] = (y_count % 2401) % 49; c_grid[rows - 1][2] = y_count / 49;
c_grid[rows - 1][3] = y_count % 49;
local_value = (c_grid[rows - 1][2] * 49) + c_grid[rows - 1][3]; local_value = (c_grid[rows - 1][2] * 49) + c_grid[rows - 1][3];
x_count += c49_x_weight[posn_val] * local_value; x_count += c49_x_weight[posn_val] * local_value;
/* Add X Symbol Check */ /* Add X Symbol Check */
c_grid[rows - 1][4] = (x_count % 2401) / 49; x_count %= 2401;
c_grid[rows - 1][5] = (x_count % 2401) % 49; c_grid[rows - 1][4] = x_count / 49;
c_grid[rows - 1][5] = x_count % 49;
/* Add last row check character */ /* Add last row check character */
j = 0; j = 0;

View file

@ -30,7 +30,7 @@
*/ */
/* SPDX-License-Identifier: BSD-3-Clause */ /* SPDX-License-Identifier: BSD-3-Clause */
/* The functions "rss_combins" and "getRSSwidths" are copyright BSI and are /* The functions "dbar_combins" and "dbar_widths" are copyright BSI and are
released with permission under the following terms: released with permission under the following terms:
"Copyright subsists in all BSI publications. BSI also holds the copyright, in the "Copyright subsists in all BSI publications. BSI also holds the copyright, in the
@ -50,7 +50,7 @@
/* Includes numerous bugfixes thanks to Pablo Orduña @ the PIRAmIDE project */ /* Includes numerous bugfixes thanks to Pablo Orduña @ the PIRAmIDE project */
/* Note: This code reflects the symbol names as used in ISO/IEC 24724:2006. These names /* Note: The symbol names used in ISO/IEC 24724:2006
* were updated in ISO/IEC 24724:2011 as follows: * were updated in ISO/IEC 24724:2011 as follows:
* *
* RSS-14 > GS1 DataBar Omnidirectional * RSS-14 > GS1 DataBar Omnidirectional
@ -65,16 +65,17 @@
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
#include "common.h" #include "common.h"
#include "general_field.h"
#include "gs1.h"
#include "large.h" #include "large.h"
#include "rss.h" #include "rss.h"
#include "gs1.h"
#include "general_field.h"
/* `combins()' in ISO/IEC 24724:2011 Annex B */
/**************************************************************************** /****************************************************************************
* rss_combins(n,r): returns the number of Combinations of r selected from n: * dbar_combins(n,r): returns the number of Combinations of r selected from n:
* Combinations = n! / ((n - r)! * r!) * Combinations = n! / ((n - r)! * r!)
****************************************************************************/ ****************************************************************************/
static int rss_combins(const int n, const int r) { static int dbar_combins(const int n, const int r) {
int i, j; int i, j;
int maxDenom, minDenom; int maxDenom, minDenom;
int val; int val;
@ -101,9 +102,10 @@ static int rss_combins(const int n, const int r) {
return (val); return (val);
} }
/* `getRSSwidths()' in ISO/IEC 24724:2011 Annex B, modified to use arg `widths` instead of static */
/********************************************************************** /**********************************************************************
* getRSSwidths * dbar_widths
* routine to generate widths for RSS elements for a given value.# * routine to generate widths for RSS elements for a given value.
* *
* Calling arguments: * Calling arguments:
* int widths[] = element widths * int widths[] = element widths
@ -114,7 +116,7 @@ static int rss_combins(const int n, const int r) {
* noNarrow = 0 will skip patterns without a one module wide element * noNarrow = 0 will skip patterns without a one module wide element
* *
**********************************************************************/ **********************************************************************/
static void getRSSwidths(int widths[], int val, int n, const int elements, const int maxWidth, const int noNarrow) { static void dbar_widths(int widths[], int val, int n, const int elements, const int maxWidth, const int noNarrow) {
int bar; int bar;
int elmWidth; int elmWidth;
int mxwElement; int mxwElement;
@ -125,11 +127,11 @@ static void getRSSwidths(int widths[], int val, int n, const int elements, const
; ;
elmWidth++, narrowMask &= ~(1 << bar)) { elmWidth++, narrowMask &= ~(1 << bar)) {
/* Get all combinations */ /* Get all combinations */
subVal = rss_combins(n - elmWidth - 1, elements - bar - 2); subVal = dbar_combins(n - elmWidth - 1, elements - bar - 2);
/* Less combinations with no single-module element */ /* Less combinations with no single-module element */
if (!noNarrow && !narrowMask if (!noNarrow && !narrowMask
&& (n - elmWidth - (elements - bar - 1) >= elements - bar - 1)) { && (n - elmWidth - (elements - bar - 1) >= elements - bar - 1)) {
subVal -= rss_combins(n - elmWidth - (elements - bar), elements - bar - 2); subVal -= dbar_combins(n - elmWidth - (elements - bar), elements - bar - 2);
} }
/* Less combinations with elements > maxVal */ /* Less combinations with elements > maxVal */
if (elements - bar - 1 > 1) { if (elements - bar - 1 > 1) {
@ -137,7 +139,7 @@ static void getRSSwidths(int widths[], int val, int n, const int elements, const
for (mxwElement = n - elmWidth - (elements - bar - 2); for (mxwElement = n - elmWidth - (elements - bar - 2);
mxwElement > maxWidth; mxwElement > maxWidth;
mxwElement--) { mxwElement--) {
lessVal += rss_combins(n - elmWidth - mxwElement - 1, elements - bar - 3); lessVal += dbar_combins(n - elmWidth - mxwElement - 1, elements - bar - 3);
} }
subVal -= lessVal * (elements - 1 - bar); subVal -= lessVal * (elements - 1 - bar);
} else if (n - elmWidth > maxWidth) { } else if (n - elmWidth > maxWidth) {
@ -175,23 +177,26 @@ static void dbar_set_gtin14_hrt(struct zint_symbol *symbol, const unsigned char
} }
/* Expand from a width pattern to a bit pattern */ /* Expand from a width pattern to a bit pattern */
static int dbar_expand(struct zint_symbol *symbol, int writer, int *p_latch, const int width) { static int dbar_expand(struct zint_symbol *symbol, int writer, int latch, const int *const widths, const int start,
int j; const int end) {
int i, j;
if (*p_latch) { for (i = start; i < end; i++) {
for (j = 0; j < width; j++) { const int width = widths[i];
set_module(symbol, symbol->rows, writer); if (latch) {
writer++; for (j = 0; j < width; j++) {
} set_module(symbol, symbol->rows, writer);
} else { writer++;
for (j = 0; j < width; j++) { }
unset_module(symbol, symbol->rows, writer); } else {
writer++; for (j = 0; j < width; j++) {
unset_module(symbol, symbol->rows, writer);
writer++;
}
} }
latch = !latch;
} }
*p_latch = !*p_latch;
return writer; return writer;
} }
@ -292,19 +297,18 @@ INTERNAL int dbar_omn_cc(struct zint_symbol *symbol, unsigned char source[], int
int error_number = 0, i; int error_number = 0, i;
large_uint accum; large_uint accum;
uint64_t left_pair, right_pair; uint64_t left_pair, right_pair;
int data_character[4] = {0}, data_group[4] = {0}, v_odd[4], v_even[4]; int data_character[4] = {0}, data_group[4] = {0};
int data_widths[8][4], checksum, c_left, c_right, total_widths[46], writer; int data_widths[8][4], checksum, c_left, c_right, total_widths[46], writer;
int latch;
int separator_row = 0; int separator_row = 0;
int widths[4]; int widths[4];
const int raw_text = symbol->output_options & BARCODE_RAW_TEXT; const int raw_text = symbol->output_options & BARCODE_RAW_TEXT;
/* Allow and ignore any AI prefix, but only if have check digit */ /* Allow and ignore any AI prefix */
if (length == 18 && (memcmp(source, "[01]", 4) == 0 || memcmp(source, "(01)", 4) == 0)) { if ((length == 17 || length == 18) && (memcmp(source, "[01]", 4) == 0 || memcmp(source, "(01)", 4) == 0)) {
source += 4; source += 4;
length -= 4; length -= 4;
/* Likewise initial '01', if have check digit */ /* Likewise initial '01' */
} else if (length == 16 && source[0] == '0' && source[1] == '1') { } else if ((length == 15 || length == 16) && source[0] == '0' && source[1] == '1') {
source += 2; source += 2;
length -= 2; length -= 2;
} }
@ -404,40 +408,22 @@ INTERNAL int dbar_omn_cc(struct zint_symbol *symbol, unsigned char source[], int
data_group[2] = 4; data_group[2] = 4;
} }
v_odd[0] = (data_character[0] - dbar_g_sum_table[data_group[0]]) / dbar_t_table[data_group[0]];
v_even[0] = (data_character[0] - dbar_g_sum_table[data_group[0]]) % dbar_t_table[data_group[0]];
v_odd[1] = (data_character[1] - dbar_g_sum_table[data_group[1]]) % dbar_t_table[data_group[1]];
v_even[1] = (data_character[1] - dbar_g_sum_table[data_group[1]]) / dbar_t_table[data_group[1]];
v_odd[3] = (data_character[3] - dbar_g_sum_table[data_group[3]]) % dbar_t_table[data_group[3]];
v_even[3] = (data_character[3] - dbar_g_sum_table[data_group[3]]) / dbar_t_table[data_group[3]];
v_odd[2] = (data_character[2] - dbar_g_sum_table[data_group[2]]) / dbar_t_table[data_group[2]];
v_even[2] = (data_character[2] - dbar_g_sum_table[data_group[2]]) % dbar_t_table[data_group[2]];
/* Use DataBar subset width algorithm */ /* Use DataBar subset width algorithm */
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (i == 0 || i == 2) { const int dg = data_group[i];
getRSSwidths(widths, v_odd[i], dbar_modules_odd[data_group[i]], 4, dbar_widest_odd[data_group[i]], 1); const int v = data_character[i] - dbar_g_sum_table[dg];
data_widths[0][i] = widths[0]; const int v_div = v / dbar_t_table[dg];
data_widths[2][i] = widths[1]; const int v_mod = v % dbar_t_table[dg];
data_widths[4][i] = widths[2]; dbar_widths(widths, !(i & 1) ? v_div : v_mod, dbar_modules_odd[dg], 4, dbar_widest_odd[dg], !(i & 1));
data_widths[6][i] = widths[3]; data_widths[0][i] = widths[0];
getRSSwidths(widths, v_even[i], dbar_modules_even[data_group[i]], 4, dbar_widest_even[data_group[i]], 0); data_widths[2][i] = widths[1];
data_widths[1][i] = widths[0]; data_widths[4][i] = widths[2];
data_widths[3][i] = widths[1]; data_widths[6][i] = widths[3];
data_widths[5][i] = widths[2]; dbar_widths(widths, i & 1 ? v_div : v_mod, dbar_modules_even[dg], 4, dbar_widest_even[dg], i & 1);
data_widths[7][i] = widths[3]; data_widths[1][i] = widths[0];
} else { data_widths[3][i] = widths[1];
getRSSwidths(widths, v_odd[i], dbar_modules_odd[data_group[i]], 4, dbar_widest_odd[data_group[i]], 0); data_widths[5][i] = widths[2];
data_widths[0][i] = widths[0]; data_widths[7][i] = widths[3];
data_widths[2][i] = widths[1];
data_widths[4][i] = widths[2];
data_widths[6][i] = widths[3];
getRSSwidths(widths, v_even[i], dbar_modules_even[data_group[i]], 4, dbar_widest_even[data_group[i]], 1);
data_widths[1][i] = widths[0];
data_widths[3][i] = widths[1];
data_widths[5][i] = widths[2];
data_widths[7][i] = widths[3];
}
} }
checksum = 0; checksum = 0;
@ -461,7 +447,7 @@ INTERNAL int dbar_omn_cc(struct zint_symbol *symbol, unsigned char source[], int
c_right = checksum % 9; c_right = checksum % 9;
if (symbol->debug & ZINT_DEBUG_PRINT) { if (symbol->debug & ZINT_DEBUG_PRINT) {
printf("c_left: %d, c_right: %d\n", c_left, c_right); printf("checksum %d, c_left: %d, c_right: %d\n", checksum, c_left, c_right);
} }
/* Put element widths together */ /* Put element widths together */
@ -482,11 +468,7 @@ INTERNAL int dbar_omn_cc(struct zint_symbol *symbol, unsigned char source[], int
/* Put this data into the symbol */ /* Put this data into the symbol */
if (symbol->symbology == BARCODE_DBAR_OMN || symbol->symbology == BARCODE_DBAR_OMN_CC) { if (symbol->symbology == BARCODE_DBAR_OMN || symbol->symbology == BARCODE_DBAR_OMN_CC) {
writer = 0; writer = dbar_expand(symbol, 0 /*writer*/, 0 /*latch*/, total_widths, 0 /*start*/, 46 /*end*/);
latch = 0;
for (i = 0; i < 46; i++) {
writer = dbar_expand(symbol, writer, &latch, total_widths[i]);
}
if (symbol->width < writer) { if (symbol->width < writer) {
symbol->width = writer; symbol->width = writer;
} }
@ -517,11 +499,7 @@ INTERNAL int dbar_omn_cc(struct zint_symbol *symbol, unsigned char source[], int
} else if (symbol->symbology == BARCODE_DBAR_STK || symbol->symbology == BARCODE_DBAR_STK_CC) { } else if (symbol->symbology == BARCODE_DBAR_STK || symbol->symbology == BARCODE_DBAR_STK_CC) {
/* Top row */ /* Top row */
writer = 0; writer = dbar_expand(symbol, 0 /*writer*/, 0 /*latch*/, total_widths, 0 /*start*/, 23 /*end*/);
latch = 0;
for (i = 0; i < 23; i++) {
writer = dbar_expand(symbol, writer, &latch, total_widths[i]);
}
set_module(symbol, symbol->rows, writer); set_module(symbol, symbol->rows, writer);
unset_module(symbol, symbol->rows, writer + 1); unset_module(symbol, symbol->rows, writer + 1);
symbol->row_height[symbol->rows] = 5.0f; /* ISO/IEC 24724:2011 5.3.2.1 set to 5X */ symbol->row_height[symbol->rows] = 5.0f; /* ISO/IEC 24724:2011 5.3.2.1 set to 5X */
@ -530,11 +508,7 @@ INTERNAL int dbar_omn_cc(struct zint_symbol *symbol, unsigned char source[], int
symbol->rows += 2; symbol->rows += 2;
set_module(symbol, symbol->rows, 0); set_module(symbol, symbol->rows, 0);
unset_module(symbol, symbol->rows, 1); unset_module(symbol, symbol->rows, 1);
writer = 2; (void) dbar_expand(symbol, 2 /*writer*/, 1 /*latch*/, total_widths, 23 /*start*/, 46 /*end*/);
latch = 1;
for (i = 23; i < 46; i++) {
writer = dbar_expand(symbol, writer, &latch, total_widths[i]);
}
symbol->row_height[symbol->rows] = 7.0f; /* ISO/IEC 24724:2011 5.3.2.1 set to 7X */ symbol->row_height[symbol->rows] = 7.0f; /* ISO/IEC 24724:2011 5.3.2.1 set to 7X */
/* Separator pattern */ /* Separator pattern */
@ -570,11 +544,7 @@ INTERNAL int dbar_omn_cc(struct zint_symbol *symbol, unsigned char source[], int
} else if (symbol->symbology == BARCODE_DBAR_OMNSTK || symbol->symbology == BARCODE_DBAR_OMNSTK_CC) { } else if (symbol->symbology == BARCODE_DBAR_OMNSTK || symbol->symbology == BARCODE_DBAR_OMNSTK_CC) {
/* Top row */ /* Top row */
writer = 0; writer = dbar_expand(symbol, 0 /*writer*/, 0 /*latch*/, total_widths, 0 /*start*/, 23 /*end*/);
latch = 0;
for (i = 0; i < 23; i++) {
writer = dbar_expand(symbol, writer, &latch, total_widths[i]);
}
set_module(symbol, symbol->rows, writer); set_module(symbol, symbol->rows, writer);
unset_module(symbol, symbol->rows, writer + 1); unset_module(symbol, symbol->rows, writer + 1);
@ -582,11 +552,7 @@ INTERNAL int dbar_omn_cc(struct zint_symbol *symbol, unsigned char source[], int
symbol->rows += 4; symbol->rows += 4;
set_module(symbol, symbol->rows, 0); set_module(symbol, symbol->rows, 0);
unset_module(symbol, symbol->rows, 1); unset_module(symbol, symbol->rows, 1);
writer = 2; (void) dbar_expand(symbol, 2 /*writer*/, 1 /*latch*/, total_widths, 23 /*start*/, 46 /*end*/);
latch = 1;
for (i = 23; i < 46; i++) {
writer = dbar_expand(symbol, writer, &latch, total_widths[i]);
}
/* Middle separator */ /* Middle separator */
for (i = 5; i < 46; i += 2) { for (i = 5; i < 46; i += 2) {
@ -647,17 +613,16 @@ INTERNAL int dbar_ltd_cc(struct zint_symbol *symbol, unsigned char source[], int
int left_group, right_group, left_odd, left_even, right_odd, right_even; int left_group, right_group, left_odd, left_even, right_odd, right_even;
int left_widths[14], right_widths[14]; int left_widths[14], right_widths[14];
int checksum, check_elements[14], total_widths[47], writer; int checksum, check_elements[14], total_widths[47], writer;
int latch;
int separator_row = 0; int separator_row = 0;
int widths[7]; int widths[7];
const int raw_text = symbol->output_options & BARCODE_RAW_TEXT; const int raw_text = symbol->output_options & BARCODE_RAW_TEXT;
/* Allow and ignore any AI prefix, but only if have check digit */ /* Allow and ignore any AI prefix */
if (length == 18 && (memcmp(source, "[01]", 4) == 0 || memcmp(source, "(01)", 4) == 0)) { if ((length == 17 || length == 18) && (memcmp(source, "[01]", 4) == 0 || memcmp(source, "(01)", 4) == 0)) {
source += 4; source += 4;
length -= 4; length -= 4;
/* Likewise initial '01', if have check digit */ /* Likewise initial '01' */
} else if (length == 16 && source[0] == '0' && source[1] == '1') { } else if ((length == 15 || length == 16) && source[0] == '0' && source[1] == '1') {
source += 2; source += 2;
length -= 2; length -= 2;
} }
@ -750,19 +715,19 @@ INTERNAL int dbar_ltd_cc(struct zint_symbol *symbol, unsigned char source[], int
right_odd = (int) (right_character / dbar_ltd_t_even[right_group]); right_odd = (int) (right_character / dbar_ltd_t_even[right_group]);
right_even = (int) (right_character % dbar_ltd_t_even[right_group]); right_even = (int) (right_character % dbar_ltd_t_even[right_group]);
getRSSwidths(widths, left_odd, dbar_ltd_modules_odd[left_group], 7, dbar_ltd_widest_odd[left_group], 1); dbar_widths(widths, left_odd, dbar_ltd_modules_odd[left_group], 7, dbar_ltd_widest_odd[left_group], 1);
for (i = 0; i <= 6; i++) { for (i = 0; i <= 6; i++) {
left_widths[i * 2] = widths[i]; left_widths[i * 2] = widths[i];
} }
getRSSwidths(widths, left_even, dbar_ltd_modules_even[left_group], 7, dbar_ltd_widest_even[left_group], 0); dbar_widths(widths, left_even, dbar_ltd_modules_even[left_group], 7, dbar_ltd_widest_even[left_group], 0);
for (i = 0; i <= 6; i++) { for (i = 0; i <= 6; i++) {
left_widths[i * 2 + 1] = widths[i]; left_widths[i * 2 + 1] = widths[i];
} }
getRSSwidths(widths, right_odd, dbar_ltd_modules_odd[right_group], 7, dbar_ltd_widest_odd[right_group], 1); dbar_widths(widths, right_odd, dbar_ltd_modules_odd[right_group], 7, dbar_ltd_widest_odd[right_group], 1);
for (i = 0; i <= 6; i++) { for (i = 0; i <= 6; i++) {
right_widths[i * 2] = widths[i]; right_widths[i * 2] = widths[i];
} }
getRSSwidths(widths, right_even, dbar_ltd_modules_even[right_group], 7, dbar_ltd_widest_even[right_group], 0); dbar_widths(widths, right_even, dbar_ltd_modules_even[right_group], 7, dbar_ltd_widest_even[right_group], 0);
for (i = 0; i <= 6; i++) { for (i = 0; i <= 6; i++) {
right_widths[i * 2 + 1] = widths[i]; right_widths[i * 2 + 1] = widths[i];
} }
@ -793,11 +758,7 @@ INTERNAL int dbar_ltd_cc(struct zint_symbol *symbol, unsigned char source[], int
total_widths[i + 30] = right_widths[i]; total_widths[i + 30] = right_widths[i];
} }
writer = 0; writer = dbar_expand(symbol, 0 /*writer*/, 0 /*latch*/, total_widths, 0 /*start*/, 47 /*end*/);
latch = 0;
for (i = 0; i < 47; i++) {
writer = dbar_expand(symbol, writer, &latch, total_widths[i]);
}
if (symbol->width < writer) { if (symbol->width < writer) {
symbol->width = writer; symbol->width = writer;
} }
@ -1399,12 +1360,12 @@ INTERNAL int dbar_exp_cc(struct zint_symbol *symbol, unsigned char source[], int
v_even = (vs - dbar_exp_g_sum[group - 1]) % dbar_exp_t_even[group - 1]; v_even = (vs - dbar_exp_g_sum[group - 1]) % dbar_exp_t_even[group - 1];
if (debug_print) printf("%s%d", i == 0 || (i & 1) ? " " : ",", vs); if (debug_print) printf("%s%d", i == 0 || (i & 1) ? " " : ",", vs);
getRSSwidths(widths, v_odd, dbar_exp_modules_odd[group - 1], 4, dbar_exp_widest_odd[group - 1], 0); dbar_widths(widths, v_odd, dbar_exp_modules_odd[group - 1], 4, dbar_exp_widest_odd[group - 1], 0);
char_widths[i][0] = widths[0]; char_widths[i][0] = widths[0];
char_widths[i][2] = widths[1]; char_widths[i][2] = widths[1];
char_widths[i][4] = widths[2]; char_widths[i][4] = widths[2];
char_widths[i][6] = widths[3]; char_widths[i][6] = widths[3];
getRSSwidths(widths, v_even, dbar_exp_modules_even[group - 1], 4, dbar_exp_widest_even[group - 1], 1); dbar_widths(widths, v_even, dbar_exp_modules_even[group - 1], 4, dbar_exp_widest_even[group - 1], 1);
char_widths[i][1] = widths[0]; char_widths[i][1] = widths[0];
char_widths[i][3] = widths[1]; char_widths[i][3] = widths[1];
char_widths[i][5] = widths[2]; char_widths[i][5] = widths[2];
@ -1445,12 +1406,12 @@ INTERNAL int dbar_exp_cc(struct zint_symbol *symbol, unsigned char source[], int
c_odd = (check_char - dbar_exp_g_sum[c_group - 1]) / dbar_exp_t_even[c_group - 1]; c_odd = (check_char - dbar_exp_g_sum[c_group - 1]) / dbar_exp_t_even[c_group - 1];
c_even = (check_char - dbar_exp_g_sum[c_group - 1]) % dbar_exp_t_even[c_group - 1]; c_even = (check_char - dbar_exp_g_sum[c_group - 1]) % dbar_exp_t_even[c_group - 1];
getRSSwidths(widths, c_odd, dbar_exp_modules_odd[c_group - 1], 4, dbar_exp_widest_odd[c_group - 1], 0); dbar_widths(widths, c_odd, dbar_exp_modules_odd[c_group - 1], 4, dbar_exp_widest_odd[c_group - 1], 0);
check_widths[0] = widths[0]; check_widths[0] = widths[0];
check_widths[2] = widths[1]; check_widths[2] = widths[1];
check_widths[4] = widths[2]; check_widths[4] = widths[2];
check_widths[6] = widths[3]; check_widths[6] = widths[3];
getRSSwidths(widths, c_even, dbar_exp_modules_even[c_group - 1], 4, dbar_exp_widest_even[c_group - 1], 1); dbar_widths(widths, c_even, dbar_exp_modules_even[c_group - 1], 4, dbar_exp_widest_even[c_group - 1], 1);
check_widths[1] = widths[0]; check_widths[1] = widths[0];
check_widths[3] = widths[1]; check_widths[3] = widths[1];
check_widths[5] = widths[2]; check_widths[5] = widths[2];
@ -1500,11 +1461,7 @@ INTERNAL int dbar_exp_cc(struct zint_symbol *symbol, unsigned char source[], int
elements[pattern_width - 2] = 1; /* Right guard */ elements[pattern_width - 2] = 1; /* Right guard */
elements[pattern_width - 1] = 1; elements[pattern_width - 1] = 1;
writer = 0; writer = dbar_expand(symbol, 0 /*writer*/, 0 /*latch*/, elements, 0 /*start*/, pattern_width /*end*/);
latch = 0;
for (i = 0; i < pattern_width; i++) {
writer = dbar_expand(symbol, writer, &latch, elements[i]);
}
if (symbol->width < writer) { if (symbol->width < writer) {
symbol->width = writer; symbol->width = writer;
} }
@ -1599,10 +1556,7 @@ INTERNAL int dbar_exp_cc(struct zint_symbol *symbol, unsigned char source[], int
latch = (current_row & 1) || special_case_row ? 0 : 1; latch = (current_row & 1) || special_case_row ? 0 : 1;
writer = 0; writer = dbar_expand(symbol, 0 /*writer*/, latch, sub_elements, 0 /*start*/, elements_in_sub /*end*/);
for (i = 0; i < elements_in_sub; i++) {
writer = dbar_expand(symbol, writer, &latch, sub_elements[i]);
}
if (symbol->width < writer) { if (symbol->width < writer) {
symbol->width = writer; symbol->width = writer;
} }

View file

@ -255,15 +255,17 @@ static void test_input(const testCtx *const p_ctx) {
/* 12*/ { BARCODE_ITF14, -1, "12345678901231", 0, 1, 135, "" }, /* 12*/ { BARCODE_ITF14, -1, "12345678901231", 0, 1, 135, "" },
/* 13*/ { BARCODE_ITF14, -1, "12345678901234", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 850: Invalid check digit '4', expecting '1'" }, /* 13*/ { BARCODE_ITF14, -1, "12345678901234", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 850: Invalid check digit '4', expecting '1'" },
/* 14*/ { BARCODE_ITF14, -1, "1234567890123A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 312: Invalid character at position 14 in input (digits only)" }, /* 14*/ { BARCODE_ITF14, -1, "1234567890123A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 312: Invalid character at position 14 in input (digits only)" },
/* 15*/ { BARCODE_ITF14, -1, "0112345678901231", 0, 1, 135, "" }, /* Allow '01' prefix if have check digit */ /* 15*/ { BARCODE_ITF14, -1, "01345678901235", 0, 1, 135, "" },
/* 16*/ { BARCODE_ITF14, -1, "011234567890123", ZINT_ERROR_TOO_LONG, -1, -1, "Error 311: Input length 15 too long (maximum 14)" }, /* But not without */ /* 16*/ { BARCODE_ITF14, -1, "0134567890123", 0, 1, 135, "" },
/* 17*/ { BARCODE_ITF14, -1, "[01]12345678901231", 0, 1, 135, "" }, /* Allow '[01]' prefix if have check digit */ /* 17*/ { BARCODE_ITF14, -1, "0112345678901231", 0, 1, 135, "" }, /* Allow '01' prefix if have check digit */
/* 18*/ { BARCODE_ITF14, -1, "[01]1234567890123", ZINT_ERROR_TOO_LONG, -1, -1, "Error 311: Input length 17 too long (maximum 14)" }, /* But not without */ /* 18*/ { BARCODE_ITF14, -1, "011234567890123", 0, 1, 135, "" }, /* Or not */
/* 19*/ { BARCODE_ITF14, -1, "(01)12345678901231", 0, 1, 135, "" }, /* Allow '(01)' prefix if have check digit */ /* 19*/ { BARCODE_ITF14, -1, "[01]12345678901231", 0, 1, 135, "" }, /* Allow '[01]' prefix if have check digit */
/* 20*/ { BARCODE_ITF14, -1, "(01)1234567890123", ZINT_ERROR_TOO_LONG, -1, -1, "Error 311: Input length 17 too long (maximum 14)" }, /* But not without */ /* 20*/ { BARCODE_ITF14, -1, "[01]1234567890123", 0, 1, 135, "" }, /* Or not */
/* 21*/ { BARCODE_ITF14, -1, "0012345678901231", ZINT_ERROR_TOO_LONG, -1, -1, "Error 311: Input length 16 too long (maximum 14)" }, /* 21*/ { BARCODE_ITF14, -1, "(01)12345678901231", 0, 1, 135, "" }, /* Allow '(01)' prefix if have check digit */
/* 22*/ { BARCODE_ITF14, -1, "[00]12345678901231", ZINT_ERROR_TOO_LONG, -1, -1, "Error 311: Input length 18 too long (maximum 14)" }, /* 22*/ { BARCODE_ITF14, -1, "(01)1234567890123", 0, 1, 135, "" }, /* Or not */
/* 23*/ { BARCODE_ITF14, -1, "[01)12345678901231", ZINT_ERROR_TOO_LONG, -1, -1, "Error 311: Input length 18 too long (maximum 14)" }, /* 23*/ { BARCODE_ITF14, -1, "0012345678901231", ZINT_ERROR_TOO_LONG, -1, -1, "Error 311: Input length 16 too long (maximum 14)" },
/* 24*/ { BARCODE_ITF14, -1, "[00]12345678901231", ZINT_ERROR_TOO_LONG, -1, -1, "Error 311: Input length 18 too long (maximum 14)" },
/* 25*/ { BARCODE_ITF14, -1, "[01)12345678901231", ZINT_ERROR_TOO_LONG, -1, -1, "Error 311: Input length 18 too long (maximum 14)" },
}; };
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
int i, length, ret; int i, length, ret;

View file

@ -1025,16 +1025,18 @@ static void test_nve18_input(const testCtx *const p_ctx) {
/* 4*/ { ESCAPE_MODE, "\\d049\\d050\\d051\\d052A568901234567", ZINT_ERROR_INVALID_DATA, -1, "Error 346: Invalid character at position 5 in input (digits only)", "Position does not account for escape sequences" }, /* 4*/ { ESCAPE_MODE, "\\d049\\d050\\d051\\d052A568901234567", ZINT_ERROR_INVALID_DATA, -1, "Error 346: Invalid character at position 5 in input (digits only)", "Position does not account for escape sequences" },
/* 5*/ { -1, "123456789012345675", 0, 156, "(14) 105 102 0 12 34 56 78 90 12 34 56 75 42 106", "" }, /* 5*/ { -1, "123456789012345675", 0, 156, "(14) 105 102 0 12 34 56 78 90 12 34 56 75 42 106", "" },
/* 6*/ { -1, "12345678901234567", 0, 156, "(14) 105 102 0 12 34 56 78 90 12 34 56 75 42 106", "" }, /* 6*/ { -1, "12345678901234567", 0, 156, "(14) 105 102 0 12 34 56 78 90 12 34 56 75 42 106", "" },
/* 7*/ { -1, "00123456789012345675", 0, 156, "(14) 105 102 0 12 34 56 78 90 12 34 56 75 42 106", "'00' prefix allowed if check digit" }, /* 7*/ { -1, "003456789012345670", 0, 156, "(14) 105 102 0 0 34 56 78 90 12 34 56 70 54 106", "" },
/* 8*/ { -1, "0012345678901234567", ZINT_ERROR_TOO_LONG, -1, "Error 345: Input length 19 too long (maximum 18)", "But not without" }, /* 8*/ { -1, "00345678901234567", 0, 156, "(14) 105 102 0 0 34 56 78 90 12 34 56 70 54 106", "" },
/* 9*/ { -1, "[00]123456789012345675", 0, 156, "(14) 105 102 0 12 34 56 78 90 12 34 56 75 42 106", "'[00]' prefix allowed if check digit" }, /* 9*/ { -1, "00123456789012345675", 0, 156, "(14) 105 102 0 12 34 56 78 90 12 34 56 75 42 106", "'00' prefix allowed if check digit" },
/* 10*/ { -1, "[00]12345678901234567", ZINT_ERROR_TOO_LONG, -1, "Error 345: Input length 21 too long (maximum 18)", "But not without" }, /* 10*/ { -1, "0012345678901234567", 0, 156, "(14) 105 102 0 12 34 56 78 90 12 34 56 75 42 106", "Or not" },
/* 11*/ { -1, "(00)123456789012345675", 0, 156, "(14) 105 102 0 12 34 56 78 90 12 34 56 75 42 106", "'(00)' prefix allowed if check digit" }, /* 11*/ { -1, "[00]123456789012345675", 0, 156, "(14) 105 102 0 12 34 56 78 90 12 34 56 75 42 106", "'[00]' prefix allowed if check digit" },
/* 12*/ { -1, "(00)12345678901234567", ZINT_ERROR_TOO_LONG, -1, "Error 345: Input length 21 too long (maximum 18)", "But not without" }, /* 12*/ { -1, "[00]12345678901234567", 0, 156, "(14) 105 102 0 12 34 56 78 90 12 34 56 75 42 106", "Or not" },
/* 13*/ { -1, "01123456789012345675", ZINT_ERROR_TOO_LONG, -1, "Error 345: Input length 20 too long (maximum 18)", "" }, /* 13*/ { -1, "(00)123456789012345675", 0, 156, "(14) 105 102 0 12 34 56 78 90 12 34 56 75 42 106", "'(00)' prefix allowed if check digit" },
/* 14*/ { -1, "[01]123456789012345675", ZINT_ERROR_TOO_LONG, -1, "Error 345: Input length 22 too long (maximum 18)", "" }, /* 14*/ { -1, "(00)12345678901234567", 0, 156, "(14) 105 102 0 12 34 56 78 90 12 34 56 75 42 106", "Or not" },
/* 15*/ { -1, "(01)123456789012345675", ZINT_ERROR_TOO_LONG, -1, "Error 345: Input length 22 too long (maximum 18)", "" }, /* 15*/ { -1, "01123456789012345675", ZINT_ERROR_TOO_LONG, -1, "Error 345: Input length 20 too long (maximum 18)", "" },
/* 16*/ { -1, "(00]123456789012345675", ZINT_ERROR_TOO_LONG, -1, "Error 345: Input length 22 too long (maximum 18)", "" }, /* 16*/ { -1, "[01]123456789012345675", ZINT_ERROR_TOO_LONG, -1, "Error 345: Input length 22 too long (maximum 18)", "" },
/* 17*/ { -1, "(01)123456789012345675", ZINT_ERROR_TOO_LONG, -1, "Error 345: Input length 22 too long (maximum 18)", "" },
/* 18*/ { -1, "(00]123456789012345675", ZINT_ERROR_TOO_LONG, -1, "Error 345: Input length 22 too long (maximum 18)", "" },
}; };
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
int i, length, ret; int i, length, ret;
@ -1098,16 +1100,18 @@ static void test_ean14_input(const testCtx *const p_ctx) {
/* 3*/ { "123456789012A", ZINT_ERROR_INVALID_DATA, -1, "Error 346: Invalid character at position 13 in input (digits only)", "" }, /* 3*/ { "123456789012A", ZINT_ERROR_INVALID_DATA, -1, "Error 346: Invalid character at position 13 in input (digits only)", "" },
/* 4*/ { "1234567890123", 0, 134, "(12) 105 102 1 12 34 56 78 90 12 31 74 106", "" }, /* 4*/ { "1234567890123", 0, 134, "(12) 105 102 1 12 34 56 78 90 12 31 74 106", "" },
/* 5*/ { "12345678901231", 0, 134, "(12) 105 102 1 12 34 56 78 90 12 31 74 106", "" }, /* 5*/ { "12345678901231", 0, 134, "(12) 105 102 1 12 34 56 78 90 12 31 74 106", "" },
/* 6*/ { "0112345678901231", 0, 134, "(12) 105 102 1 12 34 56 78 90 12 31 74 106", "'01' prefix allowed if check digit" }, /* 6*/ { "0134567890123", 0, 134, "(12) 105 102 1 1 34 56 78 90 12 35 77 106", "" },
/* 7*/ { "011234567890123", ZINT_ERROR_TOO_LONG, -1, "Error 345: Input length 15 too long (maximum 14)", "But not without" }, /* 7*/ { "01345678901235", 0, 134, "(12) 105 102 1 1 34 56 78 90 12 35 77 106", "" },
/* 8*/ { "[01]12345678901231", 0, 134, "(12) 105 102 1 12 34 56 78 90 12 31 74 106", "'[01]' prefix allowed if check digit" }, /* 8*/ { "0112345678901231", 0, 134, "(12) 105 102 1 12 34 56 78 90 12 31 74 106", "'01' prefix allowed if check digit" },
/* 9*/ { "[01]1234567890123", ZINT_ERROR_TOO_LONG, -1, "Error 345: Input length 17 too long (maximum 14)", "But not without" }, /* 9*/ { "011234567890123", 0, 134, "(12) 105 102 1 12 34 56 78 90 12 31 74 106", "Or not" },
/* 10*/ { "(01)12345678901231", 0, 134, "(12) 105 102 1 12 34 56 78 90 12 31 74 106", "'(01)' prefix allowed if check digit" }, /* 10*/ { "[01]12345678901231", 0, 134, "(12) 105 102 1 12 34 56 78 90 12 31 74 106", "'[01]' prefix allowed if check digit" },
/* 11*/ { "(01)1234567890123", ZINT_ERROR_TOO_LONG, -1, "Error 345: Input length 17 too long (maximum 14)", "But not without" }, /* 11*/ { "[01]1234567890123", 0, 134, "(12) 105 102 1 12 34 56 78 90 12 31 74 106", "Or not" },
/* 12*/ { "0012345678901231", ZINT_ERROR_TOO_LONG, -1, "Error 345: Input length 16 too long (maximum 14)", "" }, /* 12*/ { "(01)12345678901231", 0, 134, "(12) 105 102 1 12 34 56 78 90 12 31 74 106", "'(01)' prefix allowed if check digit" },
/* 13*/ { "[00]12345678901231", ZINT_ERROR_TOO_LONG, -1, "Error 345: Input length 18 too long (maximum 14)", "" }, /* 13*/ { "(01)1234567890123", 0, 134, "(12) 105 102 1 12 34 56 78 90 12 31 74 106", "Or not" },
/* 14*/ { "(00)12345678901231", ZINT_ERROR_TOO_LONG, -1, "Error 345: Input length 18 too long (maximum 14)", "" }, /* 14*/ { "0012345678901231", ZINT_ERROR_TOO_LONG, -1, "Error 345: Input length 16 too long (maximum 14)", "" },
/* 15*/ { "(01]12345678901231", ZINT_ERROR_TOO_LONG, -1, "Error 345: Input length 18 too long (maximum 14)", "" }, /* 15*/ { "[00]12345678901231", ZINT_ERROR_TOO_LONG, -1, "Error 345: Input length 18 too long (maximum 14)", "" },
/* 16*/ { "(00)12345678901231", ZINT_ERROR_TOO_LONG, -1, "Error 345: Input length 18 too long (maximum 14)", "" },
/* 17*/ { "(01]12345678901231", ZINT_ERROR_TOO_LONG, -1, "Error 345: Input length 18 too long (maximum 14)", "" },
}; };
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
int i, length, ret; int i, length, ret;

View file

@ -35,6 +35,9 @@
#define FLAG_FULL_8BIT 0 #define FLAG_FULL_8BIT 0
#define FLAG_LATIN_1 1 #define FLAG_LATIN_1 1
#define FLAG_ASCII 2 #define FLAG_ASCII 2
#define FLAG_NUMERIC 4
#define FLAG_MASK 0xFF
#define FLAG_ZERO_FILL 0x100
struct random_item { struct random_item {
int data_flag; int data_flag;
@ -94,7 +97,7 @@ static void test_random(const testCtx *const p_ctx, const struct random_item *rd
arc4random_buf(data_buf, length); arc4random_buf(data_buf, length);
switch (rdata->data_flag) { switch (rdata->data_flag & FLAG_MASK) {
case FLAG_FULL_8BIT: /* Full 8-bit */ case FLAG_FULL_8BIT: /* Full 8-bit */
break; break;
case FLAG_LATIN_1: /* ASCII + Latin-1 only */ case FLAG_LATIN_1: /* ASCII + Latin-1 only */
@ -113,11 +116,23 @@ static void test_random(const testCtx *const p_ctx, const struct random_item *rd
data_buf[j] &= 0x7F; data_buf[j] &= 0x7F;
} }
break; break;
case FLAG_NUMERIC: /* Digits only */
for (j = 0; j < length; j++) {
data_buf[j] = '0' + (data_buf[j] % 10);
}
break;
default: default:
assert_nonzero(0, "i:%d invalid data_flag %d\n", i, rdata->data_flag); assert_nonzero(0, "i:%d invalid data_flag %d\n", i, rdata->data_flag);
break; break;
} }
if (rdata->data_flag & FLAG_ZERO_FILL) {
const int zeroes = rdata->max_len - length;
memmove(data_buf + zeroes, data_buf, length);
memset(data_buf, '0', zeroes);
length = rdata->max_len;
}
(void) testUtilSetSymbol(symbol, rdata->symbology, rdata->input_mode, rdata->eci, (void) testUtilSetSymbol(symbol, rdata->symbology, rdata->input_mode, rdata->eci,
rdata->option_1, rdata->option_2, rdata->option_3, rdata->output_options, rdata->option_1, rdata->option_2, rdata->option_3, rdata->output_options,
(const char *) data_buf, length, debug); (const char *) data_buf, length, debug);
@ -207,6 +222,14 @@ static void test_datamatrix_fast(const testCtx *const p_ctx) {
test_random(p_ctx, &rdata); test_random(p_ctx, &rdata);
} }
static void test_dbar_omn(const testCtx *const p_ctx) {
struct random_item rdata = {
FLAG_NUMERIC | FLAG_ZERO_FILL, BARCODE_DBAR_OMN, DATA_MODE, 0, -1, 0, 0, -1, 13
};
test_random(p_ctx, &rdata);
}
static void test_dotcode(const testCtx *const p_ctx) { static void test_dotcode(const testCtx *const p_ctx) {
struct random_item rdata = { struct random_item rdata = {
FLAG_FULL_8BIT, BARCODE_DOTCODE, DATA_MODE, 899, 1, 0, 0, -1, 620 FLAG_FULL_8BIT, BARCODE_DOTCODE, DATA_MODE, 899, 1, 0, 0, -1, 620
@ -281,6 +304,7 @@ int main(int argc, char *argv[]) {
{ "test_code128_ascii", test_code128_ascii }, { "test_code128_ascii", test_code128_ascii },
{ "test_datamatrix", test_datamatrix }, { "test_datamatrix", test_datamatrix },
{ "test_datamatrix_fast", test_datamatrix_fast }, { "test_datamatrix_fast", test_datamatrix_fast },
{ "test_dbar_omn", test_dbar_omn },
{ "test_dotcode", test_dotcode }, { "test_dotcode", test_dotcode },
{ "test_hanxin", test_hanxin }, { "test_hanxin", test_hanxin },
{ "test_maxicode", test_maxicode }, { "test_maxicode", test_maxicode },

View file

@ -116,6 +116,10 @@ static void test_binary_div_modulo_divisor(const testCtx *const p_ctx) {
/* 68*/ { BARCODE_DBAR_LTD_CC, "1999999999999", 100, 30, 6, 79, "0100001000000101010100000101011010110100100101010000101110001101011110010100000" }, /* 68*/ { BARCODE_DBAR_LTD_CC, "1999999999999", 100, 30, 6, 79, "0100001000000101010100000101011010110100100101010000101110001101011110010100000" },
/* 69*/ { BARCODE_DBAR_LTD, "1651257071912", 100, 30, 1, 79, "0100000111100011110101010101010111010100100101010101010101111110111111110100000" }, /* 69*/ { BARCODE_DBAR_LTD, "1651257071912", 100, 30, 1, 79, "0100000111100011110101010101010111010100100101010101010101111110111111110100000" },
/* 70*/ { BARCODE_DBAR_LTD_CC, "0987144605916", 100, 30, 6, 79, "0101010101010011111000011111011010110100100101010101010100111110000111110100000" }, /* 70*/ { BARCODE_DBAR_LTD_CC, "0987144605916", 100, 30, 6, 79, "0101010101010011111000011111011010110100100101010101010100111110000111110100000" },
/* 71*/ { BARCODE_DBAR_OMN, "08801234560009", 100, 30, 1, 96, "010000100001010001011100000000010110011001101100100001001001100101111111100011000010011010111101" },
/* 72*/ { BARCODE_DBAR_OMN, "0880000000000", 100, 30, 1, 96, "010000100001010001000111110000010111000101100110101101100110000101100000000111000010110111100101" },
/* 73*/ { BARCODE_DBAR_OMN, "02001234567893", 100, 30, 1, 96, "010100001000000101000100000000010100110100111100101111011100010101111111000001001001110111000101" },
/* 74*/ { BARCODE_DBAR_OMN, "01969232328964", 100, 30, 1, 96, "010100001000000101000111000000010110010111011110100111100100010101111110000011011101110111000101" },
}; };
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
int i, length, ret; int i, length, ret;
@ -1407,138 +1411,146 @@ static void test_input(const testCtx *const p_ctx) {
/* 4*/ { BARCODE_DBAR_OMN, GS1NOCHECK_MODE, -1, -1, "12345678901234", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '4', expecting '1'", 0, 0 }, /* Still checked */ /* 4*/ { BARCODE_DBAR_OMN, GS1NOCHECK_MODE, -1, -1, "12345678901234", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '4', expecting '1'", 0, 0 }, /* Still checked */
/* 5*/ { BARCODE_DBAR_OMN, -1, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14)", 0, 0 }, /* 5*/ { BARCODE_DBAR_OMN, -1, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14)", 0, 0 },
/* 6*/ { BARCODE_DBAR_OMN, GS1NOCHECK_MODE, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14)", 0, 0 }, /* 6*/ { BARCODE_DBAR_OMN, GS1NOCHECK_MODE, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14)", 0, 0 },
/* 7*/ { BARCODE_DBAR_OMN, -1, -1, -1, "0112345678901231", 0, 1, 96, "", 0, 0 }, /* Allow '01' prefix if check digit given */ /* 7*/ { BARCODE_DBAR_OMN, -1, -1, -1, "01345678901235", 0, 1, 96, "", 0, 0 },
/* 8*/ { BARCODE_DBAR_OMN, -1, -1, -1, "011234567890123", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14)", 0, 0 }, /* But not if no check digit given */ /* 8*/ { BARCODE_DBAR_OMN, -1, -1, -1, "0134567890123", 0, 1, 96, "", 0, 0 },
/* 9*/ { BARCODE_DBAR_OMN, -1, -1, -1, "[01]12345678901231", 0, 1, 96, "", 0, 0 }, /* Allow '[01]' prefix if check digit given */ /* 9*/ { BARCODE_DBAR_OMN, -1, -1, -1, "0112345678901231", 0, 1, 96, "", 0, 0 }, /* Allow '01' prefix if check digit given */
/* 10*/ { BARCODE_DBAR_OMN, -1, -1, -1, "[01]1234567890123", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 17 too long (maximum 14)", 0, 0 }, /* But not if no check digit given */ /* 10*/ { BARCODE_DBAR_OMN, -1, -1, -1, "011234567890123", 0, 1, 96, "", 0, 0 }, /* Or not */
/* 11*/ { BARCODE_DBAR_OMN, -1, -1, -1, "(01)12345678901231", 0, 1, 96, "", 0, 0 }, /* Allow '(01)' prefix if check digit given */ /* 11*/ { BARCODE_DBAR_OMN, -1, -1, -1, "[01]12345678901231", 0, 1, 96, "", 0, 0 }, /* Allow '[01]' prefix if check digit given */
/* 12*/ { BARCODE_DBAR_OMN, -1, -1, -1, "(01)1234567890123", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 17 too long (maximum 14)", 0, 0 }, /* But not if no check digit given */ /* 12*/ { BARCODE_DBAR_OMN, -1, -1, -1, "[01]1234567890123", 0, 1, 96, "", 0, 0 }, /* Or not */
/* 13*/ { BARCODE_DBAR_OMN, -1, -1, -1, "[01)12345678901231", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 18 too long (maximum 14)", 0, 0 }, /* 13*/ { BARCODE_DBAR_OMN, -1, -1, -1, "(01)12345678901231", 0, 1, 96, "", 0, 0 }, /* Allow '(01)' prefix if check digit given */
/* 14*/ { BARCODE_DBAR_LTD, -1, -1, -1, "1234567890123", 0, 1, 79, "", 0, 0 }, /* 14*/ { BARCODE_DBAR_OMN, -1, -1, -1, "(01)1234567890123", 0, 1, 96, "", 0, 0 }, /* Or not */
/* 15*/ { BARCODE_DBAR_LTD, -1, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 383: Invalid character at position 13 in input (digits only)", 0, 0 }, /* 15*/ { BARCODE_DBAR_OMN, -1, -1, -1, "[01)12345678901231", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 18 too long (maximum 14)", 0, 0 },
/* 16*/ { BARCODE_DBAR_LTD, GS1NOCHECK_MODE, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 383: Invalid character at position 13 in input (digits only)", 0, 0 }, /* 16*/ { BARCODE_DBAR_LTD, -1, -1, -1, "1234567890123", 0, 1, 79, "", 0, 0 },
/* 17*/ { BARCODE_DBAR_LTD, -1, -1, -1, "12345678901235", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 389: Invalid check digit '5', expecting '1'", 0, 0 }, /* 17*/ { BARCODE_DBAR_LTD, -1, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 383: Invalid character at position 13 in input (digits only)", 0, 0 },
/* 18*/ { BARCODE_DBAR_LTD, GS1NOCHECK_MODE, -1, -1, "12345678901235", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 389: Invalid check digit '5', expecting '1'", 0, 0 }, /* Still checked */ /* 18*/ { BARCODE_DBAR_LTD, GS1NOCHECK_MODE, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 383: Invalid character at position 13 in input (digits only)", 0, 0 },
/* 19*/ { BARCODE_DBAR_LTD, -1, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 382: Input length 15 too long (maximum 14)", 0, 0 }, /* 19*/ { BARCODE_DBAR_LTD, -1, -1, -1, "12345678901235", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 389: Invalid check digit '5', expecting '1'", 0, 0 },
/* 20*/ { BARCODE_DBAR_LTD, GS1NOCHECK_MODE, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 382: Input length 15 too long (maximum 14)", 0, 0 }, /* 20*/ { BARCODE_DBAR_LTD, GS1NOCHECK_MODE, -1, -1, "12345678901235", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 389: Invalid check digit '5', expecting '1'", 0, 0 }, /* Still checked */
/* 21*/ { BARCODE_DBAR_LTD, -1, -1, -1, "2234567890123", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 384: Input value out of range (0 to 1999999999999)", 0, 0 }, /* 21*/ { BARCODE_DBAR_LTD, -1, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 382: Input length 15 too long (maximum 14)", 0, 0 },
/* 22*/ { BARCODE_DBAR_LTD, GS1NOCHECK_MODE, -1, -1, "2234567890123", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 384: Input value out of range (0 to 1999999999999)", 0, 0 }, /* 22*/ { BARCODE_DBAR_LTD, GS1NOCHECK_MODE, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 382: Input length 15 too long (maximum 14)", 0, 0 },
/* 23*/ { BARCODE_DBAR_LTD, -1, -1, -1, "22345678901238", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 384: Input value out of range (0 to 1999999999999)", 0, 0 }, /* 23*/ { BARCODE_DBAR_LTD, -1, -1, -1, "2234567890123", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 384: Input value out of range (0 to 1999999999999)", 0, 0 },
/* 24*/ { BARCODE_DBAR_LTD, -1, -1, -1, "0112345678901231", 0, 1, 79, "", 0, 0 }, /* Allow '01' prefix if check digit given */ /* 24*/ { BARCODE_DBAR_LTD, GS1NOCHECK_MODE, -1, -1, "2234567890123", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 384: Input value out of range (0 to 1999999999999)", 0, 0 },
/* 25*/ { BARCODE_DBAR_LTD, -1, -1, -1, "011234567890123", ZINT_ERROR_TOO_LONG, -1, -1, "Error 382: Input length 15 too long (maximum 14)", 0, 0 }, /* But not if no check digit given */ /* 25*/ { BARCODE_DBAR_LTD, -1, -1, -1, "22345678901238", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 384: Input value out of range (0 to 1999999999999)", 0, 0 },
/* 26*/ { BARCODE_DBAR_LTD, -1, -1, -1, "[01]12345678901231", 0, 1, 79, "", 0, 0 }, /* Allow '[01]' prefix if check digit given */ /* 26*/ { BARCODE_DBAR_LTD, -1, -1, -1, "01345678901235", 0, 1, 79, "", 0, 0 },
/* 27*/ { BARCODE_DBAR_LTD, -1, -1, -1, "[01]1234567890123", ZINT_ERROR_TOO_LONG, -1, -1, "Error 382: Input length 17 too long (maximum 14)", 0, 0 }, /* But not if no check digit given */ /* 27*/ { BARCODE_DBAR_LTD, -1, -1, -1, "0134567890123", 0, 1, 79, "", 0, 0 },
/* 28*/ { BARCODE_DBAR_LTD, -1, -1, -1, "(01)12345678901231", 0, 1, 79, "", 0, 0 }, /* Allow '(01)' prefix if check digit given */ /* 28*/ { BARCODE_DBAR_LTD, -1, -1, -1, "0112345678901231", 0, 1, 79, "", 0, 0 }, /* Allow '01' prefix if check digit given */
/* 29*/ { BARCODE_DBAR_LTD, -1, -1, -1, "(01)1234567890123", ZINT_ERROR_TOO_LONG, -1, -1, "Error 382: Input length 17 too long (maximum 14)", 0, 0 }, /* But not if no check digit given */ /* 29*/ { BARCODE_DBAR_LTD, -1, -1, -1, "011234567890123", 0, 1, 79, "", 0, 0 }, /* Or not */
/* 30*/ { BARCODE_DBAR_LTD, -1, -1, -1, "[01)12345678901231", ZINT_ERROR_TOO_LONG, -1, -1, "Error 382: Input length 18 too long (maximum 14)", 0, 0 }, /* 30*/ { BARCODE_DBAR_LTD, -1, -1, -1, "[01]12345678901231", 0, 1, 79, "", 0, 0 }, /* Allow '[01]' prefix if check digit given */
/* 31*/ { BARCODE_DBAR_LTD, -1, -1, -1, "[10]12345678901231", ZINT_ERROR_TOO_LONG, -1, -1, "Error 382: Input length 18 too long (maximum 14)", 0, 0 }, /* 31*/ { BARCODE_DBAR_LTD, -1, -1, -1, "[01]1234567890123", 0, 1, 79, "", 0, 0 }, /* Or not */
/* 32*/ { BARCODE_DBAR_LTD, GS1NOCHECK_MODE, -1, -1, "22345678901238", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 384: Input value out of range (0 to 1999999999999)", 0, 0 }, /* 32*/ { BARCODE_DBAR_LTD, -1, -1, -1, "(01)12345678901231", 0, 1, 79, "", 0, 0 }, /* Allow '(01)' prefix if check digit given */
/* 33*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901234", ZINT_WARN_NONCOMPLIANT, 1, 134, "Warning 261: AI (01) position 14: Bad checksum '4', expected '1'", 0, 0 }, /* 33*/ { BARCODE_DBAR_LTD, -1, -1, -1, "(01)1234567890123", 0, 1, 79, "", 0, 0 }, /* Or not */
/* 34*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]12345678901234", 0, 1, 134, "", 0, 0 }, /* 34*/ { BARCODE_DBAR_LTD, -1, -1, -1, "[01)12345678901231", ZINT_ERROR_TOO_LONG, -1, -1, "Error 382: Input length 18 too long (maximum 14)", 0, 0 },
/* 35*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901231", 0, 1, 134, "", 0, 0 }, /* 35*/ { BARCODE_DBAR_LTD, -1, -1, -1, "[10]12345678901231", ZINT_ERROR_TOO_LONG, -1, -1, "Error 382: Input length 18 too long (maximum 14)", 0, 0 },
/* 36*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]1234567890123A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 385: Invalid character in Compressed Field data (digits only)", 0, 0 }, /* 36*/ { BARCODE_DBAR_LTD, GS1NOCHECK_MODE, -1, -1, "22345678901238", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 384: Input value out of range (0 to 1999999999999)", 0, 0 },
/* 37*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]1234567890123A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 385: Invalid character in Compressed Field data (digits only)", 0, 0 }, /* 37*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901234", ZINT_WARN_NONCOMPLIANT, 1, 134, "Warning 261: AI (01) position 14: Bad checksum '4', expected '1'", 0, 0 },
/* 38*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]123456789012315", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 259: Invalid data length for AI (01)", 0, 0 }, /* 38*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]12345678901234", 0, 1, 134, "", 0, 0 },
/* 39*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]123456789012315", 0, 1, 151, "", 0, 0 }, /* 39*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901231", 0, 1, 134, "", 0, 0 },
/* 40*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901234", ZINT_WARN_NONCOMPLIANT, 1, 134, "Warning 261: AI (01) position 14: Bad checksum '4', expected '1'", 0, 0 }, /* 40*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]1234567890123A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 385: Invalid character in Compressed Field data (digits only)", 0, 0 },
/* 41*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]12345678901234", 0, 1, 134, "", 0, 0 }, /* 41*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]1234567890123A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 385: Invalid character in Compressed Field data (digits only)", 0, 0 },
/* 42*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901231[91]!\"%&'()*+,-./:;<=>?_ ", ZINT_WARN_NONCOMPLIANT, 1, 526, "Warning 261: AI (91) position 21: Invalid CSET 82 character ' '", 0, 0 }, /* ISOIEC punc */ /* 42*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]123456789012315", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 259: Invalid data length for AI (01)", 0, 0 },
/* 43*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]12345678901231[91]!\"%&'()*+,-./:;<=>?_ ", 0, 1, 526, "", 0, 0 }, /* 43*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]123456789012315", 0, 1, 151, "", 0, 0 },
/* 44*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901231[91]!\"%&'()*+,-./:;<=>?_", 0, 1, 494, "", 0, 0 }, /* ISOIEC punc less space */ /* 44*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901234", ZINT_WARN_NONCOMPLIANT, 1, 134, "Warning 261: AI (01) position 14: Bad checksum '4', expected '1'", 0, 0 },
/* 45*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]12345678901231[91]!\"%&'()*+,-./:;<=>?_", 0, 1, 494, "", 0, 0 }, /* 45*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]12345678901234", 0, 1, 134, "", 0, 0 },
/* 46*/ { BARCODE_DBAR_STK, -1, -1, -1, "1234567890123", 0, 3, 50, "", 0, 0 }, /* 46*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901231[91]!\"%&'()*+,-./:;<=>?_ ", ZINT_WARN_NONCOMPLIANT, 1, 526, "Warning 261: AI (91) position 21: Invalid CSET 82 character ' '", 0, 0 }, /* ISOIEC punc */
/* 47*/ { BARCODE_DBAR_STK, GS1NOCHECK_MODE, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character at position 13 in input (digits only)", 0, 0 }, /* 47*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]12345678901231[91]!\"%&'()*+,-./:;<=>?_ ", 0, 1, 526, "", 0, 0 },
/* 48*/ { BARCODE_DBAR_STK, -1, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character at position 13 in input (digits only)", 0, 0 }, /* 48*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901231[91]!\"%&'()*+,-./:;<=>?_", 0, 1, 494, "", 0, 0 }, /* ISOIEC punc less space */
/* 49*/ { BARCODE_DBAR_STK, GS1NOCHECK_MODE, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character at position 13 in input (digits only)", 0, 0 }, /* 49*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]12345678901231[91]!\"%&'()*+,-./:;<=>?_", 0, 1, 494, "", 0, 0 },
/* 50*/ { BARCODE_DBAR_STK, -1, -1, -1, "12345678901235", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '5', expecting '1'", 0, 0 }, /* 50*/ { BARCODE_DBAR_STK, -1, -1, -1, "1234567890123", 0, 3, 50, "", 0, 0 },
/* 51*/ { BARCODE_DBAR_STK, GS1NOCHECK_MODE, -1, -1, "12345678901235", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '5', expecting '1'", 0, 0 }, /* Still checked */ /* 51*/ { BARCODE_DBAR_STK, GS1NOCHECK_MODE, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character at position 13 in input (digits only)", 0, 0 },
/* 52*/ { BARCODE_DBAR_STK, -1, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14)", 0, 0 }, /* 52*/ { BARCODE_DBAR_STK, -1, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character at position 13 in input (digits only)", 0, 0 },
/* 53*/ { BARCODE_DBAR_STK, GS1NOCHECK_MODE, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14)", 0, 0 }, /* 53*/ { BARCODE_DBAR_STK, GS1NOCHECK_MODE, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character at position 13 in input (digits only)", 0, 0 },
/* 54*/ { BARCODE_DBAR_STK, -1, -1, -1, "0112345678901231", 0, 3, 50, "", 0, 0 }, /* Allow '01' prefix if check digit given */ /* 54*/ { BARCODE_DBAR_STK, -1, -1, -1, "12345678901235", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '5', expecting '1'", 0, 0 },
/* 55*/ { BARCODE_DBAR_STK, -1, -1, -1, "011234567890123", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14)", 0, 0 }, /* But not if no check digit given */ /* 55*/ { BARCODE_DBAR_STK, GS1NOCHECK_MODE, -1, -1, "12345678901235", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '5', expecting '1'", 0, 0 }, /* Still checked */
/* 56*/ { BARCODE_DBAR_STK, -1, -1, -1, "[01]12345678901231", 0, 3, 50, "", 0, 0 }, /* Allow '[01]' prefix if check digit given */ /* 56*/ { BARCODE_DBAR_STK, -1, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14)", 0, 0 },
/* 57*/ { BARCODE_DBAR_STK, -1, -1, -1, "[01]1234567890123", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 17 too long (maximum 14)", 0, 0 }, /* But not if no check digit given */ /* 57*/ { BARCODE_DBAR_STK, GS1NOCHECK_MODE, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14)", 0, 0 },
/* 58*/ { BARCODE_DBAR_STK, -1, -1, -1, "(01)12345678901231", 0, 3, 50, "", 0, 0 }, /* Allow '(01)' prefix if check digit given */ /* 58*/ { BARCODE_DBAR_STK, -1, -1, -1, "01345678901235", 0, 3, 50, "", 0, 0 },
/* 59*/ { BARCODE_DBAR_STK, -1, -1, -1, "(01)1234567890123", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 17 too long (maximum 14)", 0, 0 }, /* But not if no check digit given */ /* 59*/ { BARCODE_DBAR_STK, -1, -1, -1, "0134567890123", 0, 3, 50, "", 0, 0 },
/* 60*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "1234567890123", 0, 5, 50, "", 0, 0 }, /* 60*/ { BARCODE_DBAR_STK, -1, -1, -1, "0112345678901231", 0, 3, 50, "", 0, 0 }, /* Allow '01' prefix if check digit given */
/* 61*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character at position 13 in input (digits only)", 0, 0 }, /* 61*/ { BARCODE_DBAR_STK, -1, -1, -1, "011234567890123", 0, 3, 50, "", 0, 0 }, /* Or not */
/* 62*/ { BARCODE_DBAR_OMNSTK, GS1NOCHECK_MODE, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character at position 13 in input (digits only)", 0, 0 }, /* 62*/ { BARCODE_DBAR_STK, -1, -1, -1, "[01]12345678901231", 0, 3, 50, "", 0, 0 }, /* Allow '[01]' prefix if check digit given */
/* 63*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "12345678901236", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '6', expecting '1'", 0, 0 }, /* 63*/ { BARCODE_DBAR_STK, -1, -1, -1, "[01]1234567890123", 0, 3, 50, "", 0, 0 }, /* Or not */
/* 64*/ { BARCODE_DBAR_OMNSTK, GS1NOCHECK_MODE, -1, -1, "12345678901236", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '6', expecting '1'", 0, 0 }, /* Still checked */ /* 64*/ { BARCODE_DBAR_STK, -1, -1, -1, "(01)12345678901231", 0, 3, 50, "", 0, 0 }, /* Allow '(01)' prefix if check digit given */
/* 65*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14)", 0, 0 }, /* 65*/ { BARCODE_DBAR_STK, -1, -1, -1, "(01)1234567890123", 0, 3, 50, "", 0, 0 }, /* Or not */
/* 66*/ { BARCODE_DBAR_OMNSTK, GS1NOCHECK_MODE, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14)", 0, 0 }, /* 66*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "1234567890123", 0, 5, 50, "", 0, 0 },
/* 67*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "0112345678901231", 0, 5, 50, "", 0, 0 }, /* Allow '01' prefix if check digit given */ /* 67*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character at position 13 in input (digits only)", 0, 0 },
/* 68*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "011234567890123", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14)", 0, 0 }, /* But not if no check digit given */ /* 68*/ { BARCODE_DBAR_OMNSTK, GS1NOCHECK_MODE, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character at position 13 in input (digits only)", 0, 0 },
/* 69*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "[01]12345678901231", 0, 5, 50, "", 0, 0 }, /* Allow '[01]' prefix if check digit given */ /* 69*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "12345678901236", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '6', expecting '1'", 0, 0 },
/* 70*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "[01]1234567890123", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 17 too long (maximum 14)", 0, 0 }, /* But not if no check digit given */ /* 70*/ { BARCODE_DBAR_OMNSTK, GS1NOCHECK_MODE, -1, -1, "12345678901236", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '6', expecting '1'", 0, 0 }, /* Still checked */
/* 71*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "(01)12345678901231", 0, 5, 50, "", 0, 0 }, /* Allow '(01)' prefix if check digit given */ /* 71*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14)", 0, 0 },
/* 72*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "(01)1234567890123", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 17 too long (maximum 14)", 0, 0 }, /* But not if no check digit given */ /* 72*/ { BARCODE_DBAR_OMNSTK, GS1NOCHECK_MODE, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14)", 0, 0 },
/* 73*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "(00)12345678901231", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 18 too long (maximum 14)", 0, 0 }, /* 73*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "01345678901235", 0, 5, 50, "", 0, 0 },
/* 74*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[01]12345678901234", ZINT_WARN_NONCOMPLIANT, 5, 102, "Warning 261: AI (01) position 14: Bad checksum '4', expected '1'", 2, 0 }, /* 74*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "0134567890123", 0, 5, 50, "", 0, 0 },
/* 75*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, -1, -1, "[01]12345678901234", 0, 5, 102, "", 2, 0 }, /* 75*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "0112345678901231", 0, 5, 50, "", 0, 0 }, /* Allow '01' prefix if check digit given */
/* 76*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[01]12345678901231", 0, 5, 102, "", 2, 0 }, /* 76*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "011234567890123", 0, 5, 50, "", 0, 0 }, /* Or not */
/* 77*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[01]1234567890123A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 385: Invalid character in Compressed Field data (digits only)", 0, 0 }, /* 77*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "[01]12345678901231", 0, 5, 50, "", 0, 0 }, /* Allow '[01]' prefix if check digit given */
/* 78*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, -1, -1, "[01]1234567890123A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 385: Invalid character in Compressed Field data (digits only)", 0, 0 }, /* 78*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "[01]1234567890123", 0, 5, 50, "", 0, 0 }, /* Or not */
/* 79*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[01]123456789012315", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 259: Invalid data length for AI (01)", 0, 0 }, /* 79*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "(01)12345678901231", 0, 5, 50, "", 0, 0 }, /* Allow '(01)' prefix if check digit given */
/* 80*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, -1, -1, "[01]123456789012315", 0, 5, 102, "", 2, 0 }, /* 80*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "(01)1234567890123", 0, 5, 50, "", 0, 0 }, /* Or not */
/* 81*/ { BARCODE_DBAR_EXPSTK, -1, 12, -1, "[01]12345678901231", 0, 5, 102, "", 2, 0 }, /* Cols > 11 ignored */ /* 81*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "(00)12345678901231", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 18 too long (maximum 14)", 0, 0 },
/* 82*/ { BARCODE_DBAR_EXPSTK, -1, -1, 12, "[01]12345678901231", 0, 5, 102, "", 2, 0 }, /* Rows > 11 ignored */ /* 82*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[01]12345678901234", ZINT_WARN_NONCOMPLIANT, 5, 102, "Warning 261: AI (01) position 14: Bad checksum '4', expected '1'", 2, 0 },
/* 83*/ { BARCODE_DBAR_EXPSTK, -1, 1, -1, "[01]12345678901231", 0, 9, 53, "", 1, 0 }, /* 83*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, -1, -1, "[01]12345678901234", 0, 5, 102, "", 2, 0 },
/* 84*/ { BARCODE_DBAR_EXPSTK, -1, 2, -1, "[01]12345678901231", 0, 5, 102, "", 2, 0 }, /* 84*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[01]12345678901231", 0, 5, 102, "", 2, 0 },
/* 85*/ { BARCODE_DBAR_EXPSTK, -1, 3, -1, "[01]12345678901231", 0, 1, 134, "", 3, 0 }, /* 85*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[01]1234567890123A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 385: Invalid character in Compressed Field data (digits only)", 0, 0 },
/* 86*/ { BARCODE_DBAR_EXPSTK, -1, 4, -1, "[01]12345678901231", 0, 1, 134, "", 4, 0 }, /* 86*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, -1, -1, "[01]1234567890123A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 385: Invalid character in Compressed Field data (digits only)", 0, 0 },
/* 87*/ { BARCODE_DBAR_EXPSTK, -1, -1, 2, "[01]12345678901231", 0, 5, 102, "", 2, 2 }, /* 87*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[01]123456789012315", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 259: Invalid data length for AI (01)", 0, 0 },
/* 88*/ { BARCODE_DBAR_EXPSTK, -1, -1, 3, "[01]12345678901231", 0, 5, 102, "", 2, 3 }, /* 88*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, -1, -1, "[01]123456789012315", 0, 5, 102, "", 2, 0 },
/* 89*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[8110]106141416543213500110000310123196000", 0, 13, 102, "", 2, 0 }, /* 89*/ { BARCODE_DBAR_EXPSTK, -1, 12, -1, "[01]12345678901231", 0, 5, 102, "", 2, 0 }, /* Cols > 11 ignored */
/* 90*/ { BARCODE_DBAR_EXPSTK, -1, 1, -1, "[8110]106141416543213500110000310123196000", 0, 25, 53, "", 1, 0 }, /* 90*/ { BARCODE_DBAR_EXPSTK, -1, -1, 12, "[01]12345678901231", 0, 5, 102, "", 2, 0 }, /* Rows > 11 ignored */
/* 91*/ { BARCODE_DBAR_EXPSTK, -1, 2, -1, "[8110]106141416543213500110000310123196000", 0, 13, 102, "", 2, 0 }, /* 91*/ { BARCODE_DBAR_EXPSTK, -1, 1, -1, "[01]12345678901231", 0, 9, 53, "", 1, 0 },
/* 92*/ { BARCODE_DBAR_EXPSTK, -1, 3, -1, "[8110]106141416543213500110000310123196000", 0, 9, 151, "", 3, 0 }, /* 92*/ { BARCODE_DBAR_EXPSTK, -1, 2, -1, "[01]12345678901231", 0, 5, 102, "", 2, 0 },
/* 93*/ { BARCODE_DBAR_EXPSTK, -1, 4, -1, "[8110]106141416543213500110000310123196000", 0, 5, 200, "", 4, 0 }, /* 93*/ { BARCODE_DBAR_EXPSTK, -1, 3, -1, "[01]12345678901231", 0, 1, 134, "", 3, 0 },
/* 94*/ { BARCODE_DBAR_EXPSTK, -1, 5, -1, "[8110]106141416543213500110000310123196000", 0, 5, 249, "", 5, 0 }, /* 94*/ { BARCODE_DBAR_EXPSTK, -1, 4, -1, "[01]12345678901231", 0, 1, 134, "", 4, 0 },
/* 95*/ { BARCODE_DBAR_EXPSTK, -1, -1, 2, "[8110]106141416543213500110000310123196000", 0, 5, 200, "", 4, 2 }, /* 95*/ { BARCODE_DBAR_EXPSTK, -1, -1, 2, "[01]12345678901231", 0, 5, 102, "", 2, 2 },
/* 96*/ { BARCODE_DBAR_EXPSTK, -1, -1, 3, "[8110]106141416543213500110000310123196000", 0, 9, 151, "", 3, 3 }, /* 96*/ { BARCODE_DBAR_EXPSTK, -1, -1, 3, "[01]12345678901231", 0, 5, 102, "", 2, 3 },
/* 97*/ { BARCODE_DBAR_EXPSTK, -1, -1, 4, "[8110]106141416543213500110000310123196000", 0, 13, 102, "", 2, 4 }, /* 97*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[8110]106141416543213500110000310123196000", 0, 13, 102, "", 2, 0 },
/* 98*/ { BARCODE_DBAR_EXPSTK, -1, -1, 5, "[8110]106141416543213500110000310123196000", 0, 13, 102, "", 2, 5 }, /* 98*/ { BARCODE_DBAR_EXPSTK, -1, 1, -1, "[8110]106141416543213500110000310123196000", 0, 25, 53, "", 1, 0 },
/* 99*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[91]123456789012345678901", 0, 9, 102, "", 2, 0 }, /* 99*/ { BARCODE_DBAR_EXPSTK, -1, 2, -1, "[8110]106141416543213500110000310123196000", 0, 13, 102, "", 2, 0 },
/*100*/ { BARCODE_DBAR_EXPSTK, -1, 1, -1, "[91]123456789012345678901", 0, 17, 53, "", 1, 0 }, /*100*/ { BARCODE_DBAR_EXPSTK, -1, 3, -1, "[8110]106141416543213500110000310123196000", 0, 9, 151, "", 3, 0 },
/*101*/ { BARCODE_DBAR_EXPSTK, -1, 2, -1, "[91]123456789012345678901", 0, 9, 102, "", 2, 0 }, /*101*/ { BARCODE_DBAR_EXPSTK, -1, 4, -1, "[8110]106141416543213500110000310123196000", 0, 5, 200, "", 4, 0 },
/*102*/ { BARCODE_DBAR_EXPSTK, -1, 3, -1, "[91]123456789012345678901", 0, 5, 151, "", 3, 0 }, /*102*/ { BARCODE_DBAR_EXPSTK, -1, 5, -1, "[8110]106141416543213500110000310123196000", 0, 5, 249, "", 5, 0 },
/*103*/ { BARCODE_DBAR_EXPSTK, -1, 4, -1, "[91]123456789012345678901", 0, 5, 200, "", 4, 0 }, /*103*/ { BARCODE_DBAR_EXPSTK, -1, -1, 2, "[8110]106141416543213500110000310123196000", 0, 5, 200, "", 4, 2 },
/*104*/ { BARCODE_DBAR_EXPSTK, -1, -1, 2, "[91]123456789012345678901", 0, 5, 151, "", 3, 2 }, /*104*/ { BARCODE_DBAR_EXPSTK, -1, -1, 3, "[8110]106141416543213500110000310123196000", 0, 9, 151, "", 3, 3 },
/*105*/ { BARCODE_DBAR_EXPSTK, -1, -1, 3, "[91]123456789012345678901", 0, 9, 102, "", 2, 3 }, /*105*/ { BARCODE_DBAR_EXPSTK, -1, -1, 4, "[8110]106141416543213500110000310123196000", 0, 13, 102, "", 2, 4 },
/*106*/ { BARCODE_DBAR_EXPSTK, -1, -1, 4, "[91]123456789012345678901", 0, 9, 102, "", 2, 4 }, /*106*/ { BARCODE_DBAR_EXPSTK, -1, -1, 5, "[8110]106141416543213500110000310123196000", 0, 13, 102, "", 2, 5 },
/*107*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[91]123456789012345678901", 0, 9, 102, "", 2, 0 }, /*107*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[91]123456789012345678901", 0, 9, 102, "", 2, 0 },
/*108*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[91]1234567890123456789012345678901234567890123456789", 0, 17, 102, "", 2, 0 }, /*108*/ { BARCODE_DBAR_EXPSTK, -1, 1, -1, "[91]123456789012345678901", 0, 17, 53, "", 1, 0 },
/*109*/ { BARCODE_DBAR_EXPSTK, -1, 1, -1, "[91]1234567890123456789012345678901234567890123456789", 0, 33, 53, "", 1, 0 }, /*109*/ { BARCODE_DBAR_EXPSTK, -1, 2, -1, "[91]123456789012345678901", 0, 9, 102, "", 2, 0 },
/*110*/ { BARCODE_DBAR_EXPSTK, -1, 2, -1, "[91]1234567890123456789012345678901234567890123456789", 0, 17, 102, "", 2, 0 }, /*110*/ { BARCODE_DBAR_EXPSTK, -1, 3, -1, "[91]123456789012345678901", 0, 5, 151, "", 3, 0 },
/*111*/ { BARCODE_DBAR_EXPSTK, -1, 3, -1, "[91]1234567890123456789012345678901234567890123456789", 0, 9, 151, "", 3, 0 }, /*111*/ { BARCODE_DBAR_EXPSTK, -1, 4, -1, "[91]123456789012345678901", 0, 5, 200, "", 4, 0 },
/*112*/ { BARCODE_DBAR_EXPSTK, -1, 4, -1, "[91]1234567890123456789012345678901234567890123456789", 0, 9, 200, "", 4, 0 }, /*112*/ { BARCODE_DBAR_EXPSTK, -1, -1, 2, "[91]123456789012345678901", 0, 5, 151, "", 3, 2 },
/*113*/ { BARCODE_DBAR_EXPSTK, -1, 4, -1, "[91]1234567890123456789012345678901234567890123456789", 0, 9, 200, "", 4, 0 }, /*113*/ { BARCODE_DBAR_EXPSTK, -1, -1, 3, "[91]123456789012345678901", 0, 9, 102, "", 2, 3 },
/*114*/ { BARCODE_DBAR_EXPSTK, -1, 5, -1, "[91]1234567890123456789012345678901234567890123456789", 0, 5, 249, "", 5, 0 }, /*114*/ { BARCODE_DBAR_EXPSTK, -1, -1, 4, "[91]123456789012345678901", 0, 9, 102, "", 2, 4 },
/*115*/ { BARCODE_DBAR_EXPSTK, -1, 6, -1, "[91]1234567890123456789012345678901234567890123456789", 0, 5, 298, "", 6, 0 }, /*115*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[91]123456789012345678901", 0, 9, 102, "", 2, 0 },
/*116*/ { BARCODE_DBAR_EXPSTK, -1, 7, -1, "[91]1234567890123456789012345678901234567890123456789", 0, 5, 347, "", 7, 0 }, /*116*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[91]1234567890123456789012345678901234567890123456789", 0, 17, 102, "", 2, 0 },
/*117*/ { BARCODE_DBAR_EXPSTK, -1, 8, -1, "[91]1234567890123456789012345678901234567890123456789", 0, 5, 396, "", 8, 0 }, /*117*/ { BARCODE_DBAR_EXPSTK, -1, 1, -1, "[91]1234567890123456789012345678901234567890123456789", 0, 33, 53, "", 1, 0 },
/*118*/ { BARCODE_DBAR_EXPSTK, -1, 9, -1, "[91]1234567890123456789012345678901234567890123456789", 0, 1, 428, "", 9, 0 }, /*118*/ { BARCODE_DBAR_EXPSTK, -1, 2, -1, "[91]1234567890123456789012345678901234567890123456789", 0, 17, 102, "", 2, 0 },
/*119*/ { BARCODE_DBAR_EXPSTK, -1, -1, 2, "[91]1234567890123456789012345678901234567890123456789", 0, 5, 249, "", 5, 2 }, /*119*/ { BARCODE_DBAR_EXPSTK, -1, 3, -1, "[91]1234567890123456789012345678901234567890123456789", 0, 9, 151, "", 3, 0 },
/*120*/ { BARCODE_DBAR_EXPSTK, -1, -1, 3, "[91]1234567890123456789012345678901234567890123456789", 0, 9, 151, "", 3, 3 }, /*120*/ { BARCODE_DBAR_EXPSTK, -1, 4, -1, "[91]1234567890123456789012345678901234567890123456789", 0, 9, 200, "", 4, 0 },
/*121*/ { BARCODE_DBAR_EXPSTK, -1, -1, 4, "[91]1234567890123456789012345678901234567890123456789", 0, 9, 151, "", 3, 4 }, /*121*/ { BARCODE_DBAR_EXPSTK, -1, 4, -1, "[91]1234567890123456789012345678901234567890123456789", 0, 9, 200, "", 4, 0 },
/*122*/ { BARCODE_DBAR_EXPSTK, -1, -1, 5, "[91]1234567890123456789012345678901234567890123456789", 0, 17, 102, "", 2, 5 }, /*122*/ { BARCODE_DBAR_EXPSTK, -1, 5, -1, "[91]1234567890123456789012345678901234567890123456789", 0, 5, 249, "", 5, 0 },
/*123*/ { BARCODE_DBAR_EXPSTK, -1, -1, 6, "[91]1234567890123456789012345678901234567890123456789", 0, 17, 102, "", 2, 6 }, /*123*/ { BARCODE_DBAR_EXPSTK, -1, 6, -1, "[91]1234567890123456789012345678901234567890123456789", 0, 5, 298, "", 6, 0 },
/*124*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 21, 102, "", 2, 0 }, /*124*/ { BARCODE_DBAR_EXPSTK, -1, 7, -1, "[91]1234567890123456789012345678901234567890123456789", 0, 5, 347, "", 7, 0 },
/*125*/ { BARCODE_DBAR_EXPSTK, -1, 1, -1, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 41, 53, "", 1, 0 }, /*125*/ { BARCODE_DBAR_EXPSTK, -1, 8, -1, "[91]1234567890123456789012345678901234567890123456789", 0, 5, 396, "", 8, 0 },
/*126*/ { BARCODE_DBAR_EXPSTK, -1, 2, -1, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 21, 102, "", 2, 0 }, /*126*/ { BARCODE_DBAR_EXPSTK, -1, 9, -1, "[91]1234567890123456789012345678901234567890123456789", 0, 1, 428, "", 9, 0 },
/*127*/ { BARCODE_DBAR_EXPSTK, -1, 3, -1, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 13, 151, "", 3, 0 }, /*127*/ { BARCODE_DBAR_EXPSTK, -1, -1, 2, "[91]1234567890123456789012345678901234567890123456789", 0, 5, 249, "", 5, 2 },
/*128*/ { BARCODE_DBAR_EXPSTK, -1, 4, -1, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 9, 200, "", 4, 0 }, /*128*/ { BARCODE_DBAR_EXPSTK, -1, -1, 3, "[91]1234567890123456789012345678901234567890123456789", 0, 9, 151, "", 3, 3 },
/*129*/ { BARCODE_DBAR_EXPSTK, -1, 5, -1, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 9, 249, "", 5, 0 }, /*129*/ { BARCODE_DBAR_EXPSTK, -1, -1, 4, "[91]1234567890123456789012345678901234567890123456789", 0, 9, 151, "", 3, 4 },
/*130*/ { BARCODE_DBAR_EXPSTK, -1, 6, -1, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 5, 298, "", 6, 0 }, /*130*/ { BARCODE_DBAR_EXPSTK, -1, -1, 5, "[91]1234567890123456789012345678901234567890123456789", 0, 17, 102, "", 2, 5 },
/*131*/ { BARCODE_DBAR_EXPSTK, -1, 7, -1, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 5, 347, "", 7, 0 }, /*131*/ { BARCODE_DBAR_EXPSTK, -1, -1, 6, "[91]1234567890123456789012345678901234567890123456789", 0, 17, 102, "", 2, 6 },
/*132*/ { BARCODE_DBAR_EXPSTK, -1, -1, 1, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 21, 102, "", 2, 0 }, /*132*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 21, 102, "", 2, 0 },
/*133*/ { BARCODE_DBAR_EXPSTK, -1, -1, 2, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 5, 298, "", 6, 2 }, /*133*/ { BARCODE_DBAR_EXPSTK, -1, 1, -1, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 41, 53, "", 1, 0 },
/*134*/ { BARCODE_DBAR_EXPSTK, -1, -1, 3, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 9, 200, "", 4, 3 }, /*134*/ { BARCODE_DBAR_EXPSTK, -1, 2, -1, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 21, 102, "", 2, 0 },
/*135*/ { BARCODE_DBAR_EXPSTK, -1, -1, 4, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 13, 151, "", 3, 4 }, /*135*/ { BARCODE_DBAR_EXPSTK, -1, 3, -1, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 13, 151, "", 3, 0 },
/*136*/ { BARCODE_DBAR_EXPSTK, -1, -1, 5, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 13, 151, "", 3, 5 }, /*136*/ { BARCODE_DBAR_EXPSTK, -1, 4, -1, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 9, 200, "", 4, 0 },
/*137*/ { BARCODE_DBAR_EXPSTK, -1, -1, 6, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 21, 102, "", 2, 6 }, /*137*/ { BARCODE_DBAR_EXPSTK, -1, 5, -1, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 9, 249, "", 5, 0 },
/*138*/ { BARCODE_DBAR_EXPSTK, -1, -1, 7, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 21, 102, "", 2, 7 }, /*138*/ { BARCODE_DBAR_EXPSTK, -1, 6, -1, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 5, 298, "", 6, 0 },
/*139*/ { BARCODE_DBAR_EXPSTK, -1, 7, -1, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 5, 347, "", 7, 0 },
/*140*/ { BARCODE_DBAR_EXPSTK, -1, -1, 1, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 21, 102, "", 2, 0 },
/*141*/ { BARCODE_DBAR_EXPSTK, -1, -1, 2, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 5, 298, "", 6, 2 },
/*142*/ { BARCODE_DBAR_EXPSTK, -1, -1, 3, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 9, 200, "", 4, 3 },
/*143*/ { BARCODE_DBAR_EXPSTK, -1, -1, 4, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 13, 151, "", 3, 4 },
/*144*/ { BARCODE_DBAR_EXPSTK, -1, -1, 5, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 13, 151, "", 3, 5 },
/*145*/ { BARCODE_DBAR_EXPSTK, -1, -1, 6, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 21, 102, "", 2, 6 },
/*146*/ { BARCODE_DBAR_EXPSTK, -1, -1, 7, "[91]12345678901234567890123456789012345678901234567890123456789012", 0, 21, 102, "", 2, 7 },
}; };
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
int i, length, ret; int i, length, ret;

View file

@ -3091,7 +3091,7 @@ display a list of all of the valid options available, and also gives the
exact version of the software (the version by itself can be displayed exact version of the software (the version by itself can be displayed
with <code>-v</code> or <code>--version</code>).</p> with <code>-v</code> or <code>--version</code>).</p>
<p>The <code>-t</code> or <code>--types</code> option gives the table of <p>The <code>-t</code> or <code>--types</code> option gives the table of
symbologies along with the symbol ID numbers and names.</p> symbologies listing the symbol ID numbers and names.</p>
<p>The <code>-e</code> or <code>--ecinos</code> option gives a list of <p>The <code>-e</code> or <code>--ecinos</code> option gives a list of
the ECI codes.</p> the ECI codes.</p>
<h2 id="other-options">4.19 Other Options</h2> <h2 id="other-options">4.19 Other Options</h2>
@ -4973,7 +4973,7 @@ starting and ending with the letters A-D and containing between these
letters the numbers 0-9, dash (<code>-</code>), dollar (<code>$</code>), letters the numbers 0-9, dash (<code>-</code>), dollar (<code>$</code>),
colon (<code>:</code>), slash (<code>/</code>), full stop colon (<code>:</code>), slash (<code>/</code>), full stop
(<code>.</code>) or plus (<code>+</code>). No check character is (<code>.</code>) or plus (<code>+</code>). No check character is
generated by default, but a modulo-16 one can be added by setting generated by default, but a hidden modulo-16 one can be added by setting
<code>--vers=1</code> (API <code>option_2 = 1</code>). To have the check <code>--vers=1</code> (API <code>option_2 = 1</code>). To have the check
character appear in the Human Readable Text, set <code>--vers=2</code> character appear in the Human Readable Text, set <code>--vers=2</code>
(API <code>option_2 = 2</code>).</p> (API <code>option_2 = 2</code>).</p>
@ -5058,10 +5058,10 @@ aria-hidden="true"><code>zint -b GS1_128 --compliantheight -d "[01]9889876543210
symbology is defined by the GS1 General Specifications. Application symbology is defined by the GS1 General Specifications. Application
Identifiers (AIs) should be entered using [square bracket] notation. Identifiers (AIs) should be entered using [square bracket] notation.
These will be converted to parentheses (round brackets) for the Human These will be converted to parentheses (round brackets) for the Human
Readable Text. This will allow round brackets to be used in the data Readable Text. This method allows the inclusion of parentheses in the AI
strings to be encoded.</p> data.</p>
<p>For compatibility with data entry in other systems, if the data does <p>For compatibility with data entry in other systems, if the data does
not include round brackets, the option <code>--gs1parens</code> (API not include parentheses, the option <code>--gs1parens</code> (API
<code>input_mode |= GS1PARENS_MODE</code>) may be used to signal that <code>input_mode |= GS1PARENS_MODE</code>) may be used to signal that
AIs are encased in round brackets instead of square ones.</p> AIs are encased in round brackets instead of square ones.</p>
<p>Fixed length data should be entered at the appropriate length for <p>Fixed length data should be entered at the appropriate length for
@ -5205,7 +5205,7 @@ aria-hidden="true"><code>zint -b DBAR_OMN --compliantheight -d "0950110153001"</
code. A check digit and HRT-only Application Identifier of code. A check digit and HRT-only Application Identifier of
<code>"(01)"</code> are added by Zint. (A 14-digit code that appends the <code>"(01)"</code> are added by Zint. (A 14-digit code that appends the
standard GS1 check digit may be given, in which case the check digit standard GS1 check digit may be given, in which case the check digit
will be verified.)</p> will be verified.) Input less than 13 digits will be zero-filled.</p>
<p>GS1 DataBar Omnidirectional symbols should have a height of 33 or <p>GS1 DataBar Omnidirectional symbols should have a height of 33 or
greater. To produce a GS1 DataBar Truncated symbol set the symbol height greater. To produce a GS1 DataBar Truncated symbol set the symbol height
to a value between 13 and 32. Truncated symbols may not be scannable by to a value between 13 and 32. Truncated symbols may not be scannable by
@ -5229,7 +5229,8 @@ above. GS1 DataBar Limited, however, is limited to data starting with
digits 0 and 1 (i.e. numbers in the range 0 to 1999999999999). As with digits 0 and 1 (i.e. numbers in the range 0 to 1999999999999). As with
GS1 DataBar Omnidirectional a check digit and HRT-only Application GS1 DataBar Omnidirectional a check digit and HRT-only Application
Identifier of <code>"(01)"</code> are added by Zint, and a 14-digit code Identifier of <code>"(01)"</code> are added by Zint, and a 14-digit code
may be given in which case the check digit will be verified.</p> may be given in which case the check digit will be verified. Input less
than 13 digits will be zero-filled.</p>
<h4 id="gs1-databar-expanded">6.1.11.3 GS1 DataBar Expanded</h4> <h4 id="gs1-databar-expanded">6.1.11.3 GS1 DataBar Expanded</h4>
<figure> <figure>
<img src="images/dbar_exp.svg" title="fig:" class="lin" <img src="images/dbar_exp.svg" title="fig:" class="lin"
@ -5240,17 +5241,16 @@ aria-hidden="true"><code>zint -b DBAR_EXP --compliantheight -d "[01]988987654321
<p>Previously known as RSS Expanded this is a variable length symbology <p>Previously known as RSS Expanded this is a variable length symbology
capable of encoding data from a number of AIs in a single symbol. AIs capable of encoding data from a number of AIs in a single symbol. AIs
should be encased in [square brackets] in the input data, which will be should be encased in [square brackets] in the input data, which will be
converted to parentheses (round brackets) before being included in the displayed as parentheses (round brackets) in the Human Readable Text.
Human Readable Text attached to the symbol. This method allows the This method allows the inclusion of parentheses in the AI data. If the
inclusion of parentheses in the data to be encoded. If the data does not data does not include parentheses, the AIs may alternatively be encased
include parentheses, the AIs may alternatively be encased in parentheses in parentheses using the <code>--gs1parens</code> switch - see <a
using the <code>--gs1parens</code> switch. See <a
href="#gs1-128">6.1.10.3 GS1-128</a>.</p> href="#gs1-128">6.1.10.3 GS1-128</a>.</p>
<p>GTIN data AI (01) should also include the standard GS1 check digit <p>The GTIN-14 data for AI (01) must include the standard GS1 check
data as this is not calculated by Zint when this symbology is encoded. digit as this is not calculated by Zint when this symbology is encoded.
Fixed length data should be entered at the appropriate length for Data for fixed-length AIs must be entered at the appropriate length. The
correct encoding. The following is an example of a valid GS1 DataBar maximum capacity is 74 numerics or 41 alphanumerics. The following is an
Expanded input:</p> example of a valid GS1 DataBar Expanded input:</p>
<div class="sourceCode" id="cb105"><pre <div class="sourceCode" id="cb105"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb105-1"><a href="#cb105-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 31 <span class="at">-d</span> <span class="st">&quot;[01]98898765432106[3202]012345[15]991231&quot;</span></span></code></pre></div> class="sourceCode bash"><code class="sourceCode bash"><span id="cb105-1"><a href="#cb105-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 31 <span class="at">-d</span> <span class="st">&quot;[01]98898765432106[3202]012345[15]991231&quot;</span></span></code></pre></div>
<h3 id="korea-post-barcode">6.1.12 Korea Post Barcode</h3> <h3 id="korea-post-barcode">6.1.12 Korea Post Barcode</h3>
@ -5406,7 +5406,8 @@ alt="zint -b CODE16K --compliantheight -d &quot;ab0123456789&quot;" />
<figcaption <figcaption
aria-hidden="true"><code>zint -b CODE16K --compliantheight -d "ab0123456789"</code></figcaption> aria-hidden="true"><code>zint -b CODE16K --compliantheight -d "ab0123456789"</code></figcaption>
</figure> </figure>
<p>Code 16K uses a Code 128 based system which can stack up to 16 rows <p>Code 16K, invented by Ted Williams for LaserLight Systems in 1988,
uses a Code 128 based system which can stack up to 16 fixed-width rows
in a block. This gives a maximum data capacity of 77 characters or 154 in a block. This gives a maximum data capacity of 77 characters or 154
numerical digits and includes two modulo-107 check digits. Code 16K also numerical digits and includes two modulo-107 check digits. Code 16K also
supports ISO/IEC 8859-1 character encoding in the same manner as Code supports ISO/IEC 8859-1 character encoding in the same manner as Code
@ -5421,7 +5422,7 @@ alt="zint -b PDF417 -d &quot;PDF417&quot;" />
aria-hidden="true"><code>zint -b PDF417 -d "PDF417"</code></figcaption> aria-hidden="true"><code>zint -b PDF417 -d "PDF417"</code></figcaption>
</figure> </figure>
<p>Heavily used in the parcel industry, the PDF417 symbology can encode <p>Heavily used in the parcel industry, the PDF417 symbology can encode
a vast amount of data into a small space. Zint supports encoding up to a large amount of data into a small space. Zint supports encoding up to
the ISO standard maximum symbol size of 925 codewords which (at error the ISO standard maximum symbol size of 925 codewords which (at error
correction level 0) allows a maximum data size of 1850 text characters, correction level 0) allows a maximum data size of 1850 text characters,
or 2710 digits.</p> or 2710 digits.</p>
@ -5525,16 +5526,16 @@ aria-hidden="true"><code>zint -b DBAR_EXPSTK --compliantheight -d "[01]988987654
</figure> </figure>
<p>A stacked variation of the GS1 DataBar Expanded symbol for smaller <p>A stacked variation of the GS1 DataBar Expanded symbol for smaller
packages. Input is the same as for GS1 DataBar Expanded (see <a packages. Input is the same as for GS1 DataBar Expanded (see <a
href="#gs1-databar-expanded">6.1.11.3 GS1 DataBar Expanded</a>). In href="#gs1-databar-expanded">6.1.11.3 GS1 DataBar Expanded</a>), with
addition the width of the symbol can be altered using the the same maximum capacity. The width of the symbol can be altered using
<code>--cols</code> switch (API <code>option_2</code>). In this case the the <code>--cols</code> switch (API <code>option_2</code>). In this case
number of columns (values 1 to 11) relates to the number of character the number of columns (values 1 to 11) relates to the number of
pairs on each row of the symbol. Alternatively the <code>--rows</code> character pairs on each row of the symbol. Alternatively the
switch (API <code>option_3</code>) can be used to specify the maximum <code>--rows</code> switch (API <code>option_3</code>) can be used to
number of rows (values 2 to 11), and the number of columns will be specify the maximum number of rows (values 2 to 11), and the number of
adjusted accordingly. This symbol can be generated with a columns will be adjusted accordingly. This symbol can be generated with
two-dimensional component to make a composite symbol. For symbols with a a two-dimensional component to make a composite symbol. For such symbols
2D component the number of columns must be at least 2.</p> the number of columns must be at least 2.</p>
<h3 id="code-49">6.2.8 Code 49</h3> <h3 id="code-49">6.2.8 Code 49</h3>
<figure> <figure>
<img src="images/code49.svg" title="fig:" class="lin" <img src="images/code49.svg" title="fig:" class="lin"
@ -5544,11 +5545,11 @@ aria-hidden="true"><code>zint -b CODE49 --compliantheight -d "MULTIPLE ROWS IN C
</figure> </figure>
<p>Developed in 1987 at Intermec, Code 49 is a cross between UPC and <p>Developed in 1987 at Intermec, Code 49 is a cross between UPC and
Code 39. It is one of the earliest stacked symbologies and influenced Code 39. It is one of the earliest stacked symbologies and influenced
the design of Code 16K a few years later. It supports full 7-bit ASCII the design of Code 16K a year later. It supports full 7-bit ASCII input
input up to a maximum of 49 characters or 81 numeric digits. GS1 data up to a maximum of 49 characters or 81 numeric digits. GS1 data encoding
encoding is also supported. The minimum number of rows to use can be set is also supported. The minimum number of fixed-width rows to use can be
using the <code>--rows</code> option (API <code>option_1</code>), with set using the <code>--rows</code> option (API <code>option_1</code>),
values from 2 to 8.</p> with values from 2 to 8.</p>
<h2 id="gs1-composite-symbols-iso-24723">6.3 GS1 Composite Symbols (ISO <h2 id="gs1-composite-symbols-iso-24723">6.3 GS1 Composite Symbols (ISO
24723)</h2> 24723)</h2>
<p>GS1 Composite symbols employ a mixture of components to give more <p>GS1 Composite symbols employ a mixture of components to give more

View file

@ -1625,8 +1625,8 @@ line. The `-h` or `--help` option will display a list of all of the valid
options available, and also gives the exact version of the software (the version options available, and also gives the exact version of the software (the version
by itself can be displayed with `-v` or `--version`). by itself can be displayed with `-v` or `--version`).
The `-t` or `--types` option gives the table of symbologies along with the The `-t` or `--types` option gives the table of symbologies listing the symbol
symbol ID numbers and names. ID numbers and names.
The `-e` or `--ecinos` option gives a list of the ECI codes. The `-e` or `--ecinos` option gives a list of the ECI codes.
@ -3236,9 +3236,9 @@ adopted Codabar in 1979 as the standard barcode for blood products. Codabar can
encode up to 103 characters starting and ending with the letters A-D and encode up to 103 characters starting and ending with the letters A-D and
containing between these letters the numbers 0-9, dash (`-`), dollar (`$`), containing between these letters the numbers 0-9, dash (`-`), dollar (`$`),
colon (`:`), slash (`/`), full stop (`.`) or plus (`+`). No check character is colon (`:`), slash (`/`), full stop (`.`) or plus (`+`). No check character is
generated by default, but a modulo-16 one can be added by setting `--vers=1` generated by default, but a hidden modulo-16 one can be added by setting
(API `option_2 = 1`). To have the check character appear in the Human Readable `--vers=1` (API `option_2 = 1`). To have the check character appear in the Human
Text, set `--vers=2` (API `option_2 = 2`). Readable Text, set `--vers=2` (API `option_2 = 2`).
### 6.1.9 Pharmacode One-Track ### 6.1.9 Pharmacode One-Track
@ -3321,13 +3321,12 @@ still recognised.
A variation of Code 128 previously known as UCC/EAN-128, this symbology is A variation of Code 128 previously known as UCC/EAN-128, this symbology is
defined by the GS1 General Specifications. Application Identifiers (AIs) should defined by the GS1 General Specifications. Application Identifiers (AIs) should
be entered using [square bracket] notation. These will be converted to be entered using [square bracket] notation. These will be converted to
parentheses (round brackets) for the Human Readable Text. This will allow round parentheses (round brackets) for the Human Readable Text. This method allows the
brackets to be used in the data strings to be encoded. inclusion of parentheses in the AI data.
For compatibility with data entry in other systems, if the data does not include For compatibility with data entry in other systems, if the data does not include
round brackets, the option `--gs1parens` (API `input_mode |= GS1PARENS_MODE`) parentheses, the option `--gs1parens` (API `input_mode |= GS1PARENS_MODE`) may
may be used to signal that AIs are encased in round brackets instead of square be used to signal that AIs are encased in round brackets instead of square ones.
ones.
Fixed length data should be entered at the appropriate length for correct Fixed length data should be entered at the appropriate length for correct
encoding. GS1-128 does not support extended ASCII (ISO/IEC 8859-1) characters. encoding. GS1-128 does not support extended ASCII (ISO/IEC 8859-1) characters.
@ -3416,8 +3415,6 @@ A DPD Code can be marked as a "relabel" by specifying `--vers=1` (API
`option_2 = 1`), which omits the identification tag and prints the barcode at `option_2 = 1`), which omits the identification tag and prints the barcode at
half height. In this case, an input of 27 alphanumeric characters is required. half height. In this case, an input of 27 alphanumeric characters is required.
\clearpage
#### 6.1.10.8 UPU S10 #### 6.1.10.8 UPU S10
![`zint -b UPU_S10 --compliantheight -d ![`zint -b UPU_S10 --compliantheight -d
@ -3448,7 +3445,8 @@ GS1 DataBar symbol is to be printed with a 2D component as specified in ISO/IEC
Previously known as RSS-14 this standard encodes a 13-digit item code. A check Previously known as RSS-14 this standard encodes a 13-digit item code. A check
digit and HRT-only Application Identifier of `"(01)"` are added by Zint. (A digit and HRT-only Application Identifier of `"(01)"` are added by Zint. (A
14-digit code that appends the standard GS1 check digit may be given, in which 14-digit code that appends the standard GS1 check digit may be given, in which
case the check digit will be verified.) case the check digit will be verified.) Input less than 13 digits will be
zero-filled.
GS1 DataBar Omnidirectional symbols should have a height of 33 or greater. To GS1 DataBar Omnidirectional symbols should have a height of 33 or greater. To
produce a GS1 DataBar Truncated symbol set the symbol height to a value between produce a GS1 DataBar Truncated symbol set the symbol height to a value between
@ -3467,7 +3465,8 @@ can be used in the same way as GS1 DataBar Omnidirectional above. GS1 DataBar
Limited, however, is limited to data starting with digits 0 and 1 (i.e. numbers Limited, however, is limited to data starting with digits 0 and 1 (i.e. numbers
in the range 0 to 1999999999999). As with GS1 DataBar Omnidirectional a check in the range 0 to 1999999999999). As with GS1 DataBar Omnidirectional a check
digit and HRT-only Application Identifier of `"(01)"` are added by Zint, and a digit and HRT-only Application Identifier of `"(01)"` are added by Zint, and a
14-digit code may be given in which case the check digit will be verified. 14-digit code may be given in which case the check digit will be verified. Input
less than 13 digits will be zero-filled.
#### 6.1.11.3 GS1 DataBar Expanded #### 6.1.11.3 GS1 DataBar Expanded
@ -3476,16 +3475,17 @@ digit and HRT-only Application Identifier of `"(01)"` are added by Zint, and a
Previously known as RSS Expanded this is a variable length symbology capable of Previously known as RSS Expanded this is a variable length symbology capable of
encoding data from a number of AIs in a single symbol. AIs should be encased in encoding data from a number of AIs in a single symbol. AIs should be encased in
[square brackets] in the input data, which will be converted to parentheses [square brackets] in the input data, which will be displayed as parentheses
(round brackets) before being included in the Human Readable Text attached to (round brackets) in the Human Readable Text. This method allows the inclusion of
the symbol. This method allows the inclusion of parentheses in the data to be parentheses in the AI data. If the data does not include parentheses, the AIs
encoded. If the data does not include parentheses, the AIs may alternatively be may alternatively be encased in parentheses using the `--gs1parens` switch - see
encased in parentheses using the `--gs1parens` switch. See [6.1.10.3 GS1-128]. [6.1.10.3 GS1-128].
GTIN data AI (01) should also include the standard GS1 check digit data as this The GTIN-14 data for AI (01) must include the standard GS1 check digit as this
is not calculated by Zint when this symbology is encoded. Fixed length data is not calculated by Zint when this symbology is encoded. Data for fixed-length
should be entered at the appropriate length for correct encoding. The following AIs must be entered at the appropriate length. The maximum capacity is 74
is an example of a valid GS1 DataBar Expanded input: numerics or 41 alphanumerics. The following is an example of a valid GS1 DataBar
Expanded input:
```bash ```bash
zint -b 31 -d "[01]98898765432106[3202]012345[15]991231" zint -b 31 -d "[01]98898765432106[3202]012345[15]991231"
@ -3604,8 +3604,9 @@ modulo-49 check digit to the encoded data.
![`zint -b CODE16K --compliantheight -d ![`zint -b CODE16K --compliantheight -d
"ab0123456789"`](images/code16k.svg){.lin} "ab0123456789"`](images/code16k.svg){.lin}
Code 16K uses a Code 128 based system which can stack up to 16 rows in a block. Code 16K, invented by Ted Williams for LaserLight Systems in 1988, uses a Code
This gives a maximum data capacity of 77 characters or 154 numerical digits and 128 based system which can stack up to 16 fixed-width rows in a block. This
gives a maximum data capacity of 77 characters or 154 numerical digits and
includes two modulo-107 check digits. Code 16K also supports ISO/IEC 8859-1 includes two modulo-107 check digits. Code 16K also supports ISO/IEC 8859-1
character encoding in the same manner as Code 128. GS1 data encoding is also character encoding in the same manner as Code 128. GS1 data encoding is also
supported. The minimum number of rows to use can be set using the `--rows` supported. The minimum number of rows to use can be set using the `--rows`
@ -3615,7 +3616,7 @@ option (API `option_1`), with values from 2 to 16.
![`zint -b PDF417 -d "PDF417"`](images/pdf417.svg){.lin} ![`zint -b PDF417 -d "PDF417"`](images/pdf417.svg){.lin}
Heavily used in the parcel industry, the PDF417 symbology can encode a vast Heavily used in the parcel industry, the PDF417 symbology can encode a large
amount of data into a small space. Zint supports encoding up to the ISO standard amount of data into a small space. Zint supports encoding up to the ISO standard
maximum symbol size of 925 codewords which (at error correction level 0) allows maximum symbol size of 925 codewords which (at error correction level 0) allows
a maximum data size of 1850 text characters, or 2710 digits. a maximum data size of 1850 text characters, or 2710 digits.
@ -3701,14 +3702,14 @@ symbol.
A stacked variation of the GS1 DataBar Expanded symbol for smaller packages. A stacked variation of the GS1 DataBar Expanded symbol for smaller packages.
Input is the same as for GS1 DataBar Expanded (see [6.1.11.3 GS1 DataBar Input is the same as for GS1 DataBar Expanded (see [6.1.11.3 GS1 DataBar
Expanded]). In addition the width of the symbol can be altered using the Expanded]), with the same maximum capacity. The width of the symbol can be
`--cols` switch (API `option_2`). In this case the number of columns (values 1 altered using the `--cols` switch (API `option_2`). In this case the number of
to 11) relates to the number of character pairs on each row of the symbol. columns (values 1 to 11) relates to the number of character pairs on each row of
Alternatively the `--rows` switch (API `option_3`) can be used to specify the the symbol. Alternatively the `--rows` switch (API `option_3`) can be used to
maximum number of rows (values 2 to 11), and the number of columns will be specify the maximum number of rows (values 2 to 11), and the number of columns
adjusted accordingly. This symbol can be generated with a two-dimensional will be adjusted accordingly. This symbol can be generated with a
component to make a composite symbol. For symbols with a 2D component the number two-dimensional component to make a composite symbol. For such symbols the
of columns must be at least 2. number of columns must be at least 2.
### 6.2.8 Code 49 ### 6.2.8 Code 49
@ -3717,9 +3718,9 @@ of columns must be at least 2.
Developed in 1987 at Intermec, Code 49 is a cross between UPC and Code 39. It is Developed in 1987 at Intermec, Code 49 is a cross between UPC and Code 39. It is
one of the earliest stacked symbologies and influenced the design of Code 16K a one of the earliest stacked symbologies and influenced the design of Code 16K a
few years later. It supports full 7-bit ASCII input up to a maximum of 49 year later. It supports full 7-bit ASCII input up to a maximum of 49 characters
characters or 81 numeric digits. GS1 data encoding is also supported. The or 81 numeric digits. GS1 data encoding is also supported. The minimum number
minimum number of rows to use can be set using the `--rows` option (API of fixed-width rows to use can be set using the `--rows` option (API
`option_1`), with values from 2 to 8. `option_1`), with values from 2 to 8.
\clearpage \clearpage

View file

@ -1671,7 +1671,7 @@ line. The -h or --help option will display a list of all of the valid options
available, and also gives the exact version of the software (the version by available, and also gives the exact version of the software (the version by
itself can be displayed with -v or --version). itself can be displayed with -v or --version).
The -t or --types option gives the table of symbologies along with the symbol ID The -t or --types option gives the table of symbologies listing the symbol ID
numbers and names. numbers and names.
The -e or --ecinos option gives a list of the ECI codes. The -e or --ecinos option gives a list of the ECI codes.
@ -3122,7 +3122,7 @@ adopted Codabar in 1979 as the standard barcode for blood products. Codabar can
encode up to 103 characters starting and ending with the letters A-D and encode up to 103 characters starting and ending with the letters A-D and
containing between these letters the numbers 0-9, dash (-), dollar ($), colon containing between these letters the numbers 0-9, dash (-), dollar ($), colon
(:), slash (/), full stop (.) or plus (+). No check character is generated by (:), slash (/), full stop (.) or plus (+). No check character is generated by
default, but a modulo-16 one can be added by setting --vers=1 (API default, but a hidden modulo-16 one can be added by setting --vers=1 (API
option_2 = 1). To have the check character appear in the Human Readable Text, option_2 = 1). To have the check character appear in the Human Readable Text,
set --vers=2 (API option_2 = 2). set --vers=2 (API option_2 = 2).
@ -3197,11 +3197,11 @@ variant (nor for any other).
A variation of Code 128 previously known as UCC/EAN-128, this symbology is A variation of Code 128 previously known as UCC/EAN-128, this symbology is
defined by the GS1 General Specifications. Application Identifiers (AIs) should defined by the GS1 General Specifications. Application Identifiers (AIs) should
be entered using [square bracket] notation. These will be converted to be entered using [square bracket] notation. These will be converted to
parentheses (round brackets) for the Human Readable Text. This will allow round parentheses (round brackets) for the Human Readable Text. This method allows the
brackets to be used in the data strings to be encoded. inclusion of parentheses in the AI data.
For compatibility with data entry in other systems, if the data does not include For compatibility with data entry in other systems, if the data does not include
round brackets, the option --gs1parens (API input_mode |= GS1PARENS_MODE) may be parentheses, the option --gs1parens (API input_mode |= GS1PARENS_MODE) may be
used to signal that AIs are encased in round brackets instead of square ones. used to signal that AIs are encased in round brackets instead of square ones.
Fixed length data should be entered at the appropriate length for correct Fixed length data should be entered at the appropriate length for correct
@ -3311,7 +3311,8 @@ to find out how to generate DataBar symbols with 2D components.
Previously known as RSS-14 this standard encodes a 13-digit item code. A check Previously known as RSS-14 this standard encodes a 13-digit item code. A check
digit and HRT-only Application Identifier of "(01)" are added by Zint. (A digit and HRT-only Application Identifier of "(01)" are added by Zint. (A
14-digit code that appends the standard GS1 check digit may be given, in which 14-digit code that appends the standard GS1 check digit may be given, in which
case the check digit will be verified.) case the check digit will be verified.) Input less than 13 digits will be
zero-filled.
GS1 DataBar Omnidirectional symbols should have a height of 33 or greater. To GS1 DataBar Omnidirectional symbols should have a height of 33 or greater. To
produce a GS1 DataBar Truncated symbol set the symbol height to a value between produce a GS1 DataBar Truncated symbol set the symbol height to a value between
@ -3328,7 +3329,8 @@ can be used in the same way as GS1 DataBar Omnidirectional above. GS1 DataBar
Limited, however, is limited to data starting with digits 0 and 1 (i.e. numbers Limited, however, is limited to data starting with digits 0 and 1 (i.e. numbers
in the range 0 to 1999999999999). As with GS1 DataBar Omnidirectional a check in the range 0 to 1999999999999). As with GS1 DataBar Omnidirectional a check
digit and HRT-only Application Identifier of "(01)" are added by Zint, and a digit and HRT-only Application Identifier of "(01)" are added by Zint, and a
14-digit code may be given in which case the check digit will be verified. 14-digit code may be given in which case the check digit will be verified. Input
less than 13 digits will be zero-filled.
6.1.11.3 GS1 DataBar Expanded 6.1.11.3 GS1 DataBar Expanded
@ -3337,16 +3339,17 @@ digit and HRT-only Application Identifier of "(01)" are added by Zint, and a
Previously known as RSS Expanded this is a variable length symbology capable of Previously known as RSS Expanded this is a variable length symbology capable of
encoding data from a number of AIs in a single symbol. AIs should be encased in encoding data from a number of AIs in a single symbol. AIs should be encased in
[square brackets] in the input data, which will be converted to parentheses [square brackets] in the input data, which will be displayed as parentheses
(round brackets) before being included in the Human Readable Text attached to (round brackets) in the Human Readable Text. This method allows the inclusion of
the symbol. This method allows the inclusion of parentheses in the data to be parentheses in the AI data. If the data does not include parentheses, the AIs
encoded. If the data does not include parentheses, the AIs may alternatively be may alternatively be encased in parentheses using the --gs1parens switch - see
encased in parentheses using the --gs1parens switch. See 6.1.10.3 GS1-128. 6.1.10.3 GS1-128.
GTIN data AI (01) should also include the standard GS1 check digit data as this The GTIN-14 data for AI (01) must include the standard GS1 check digit as this
is not calculated by Zint when this symbology is encoded. Fixed length data is not calculated by Zint when this symbology is encoded. Data for fixed-length
should be entered at the appropriate length for correct encoding. The following AIs must be entered at the appropriate length. The maximum capacity is 74
is an example of a valid GS1 DataBar Expanded input: numerics or 41 alphanumerics. The following is an example of a valid GS1 DataBar
Expanded input:
zint -b 31 -d "[01]98898765432106[3202]012345[15]991231" zint -b 31 -d "[01]98898765432106[3202]012345[15]991231"
@ -3452,8 +3455,9 @@ check digit to the encoded data.
[zint -b CODE16K --compliantheight -d "ab0123456789"] [zint -b CODE16K --compliantheight -d "ab0123456789"]
Code 16K uses a Code 128 based system which can stack up to 16 rows in a block. Code 16K, invented by Ted Williams for LaserLight Systems in 1988, uses a Code
This gives a maximum data capacity of 77 characters or 154 numerical digits and 128 based system which can stack up to 16 fixed-width rows in a block. This
gives a maximum data capacity of 77 characters or 154 numerical digits and
includes two modulo-107 check digits. Code 16K also supports ISO/IEC 8859-1 includes two modulo-107 check digits. Code 16K also supports ISO/IEC 8859-1
character encoding in the same manner as Code 128. GS1 data encoding is also character encoding in the same manner as Code 128. GS1 data encoding is also
supported. The minimum number of rows to use can be set using the --rows option supported. The minimum number of rows to use can be set using the --rows option
@ -3463,7 +3467,7 @@ supported. The minimum number of rows to use can be set using the --rows option
[zint -b PDF417 -d "PDF417"] [zint -b PDF417 -d "PDF417"]
Heavily used in the parcel industry, the PDF417 symbology can encode a vast Heavily used in the parcel industry, the PDF417 symbology can encode a large
amount of data into a small space. Zint supports encoding up to the ISO standard amount of data into a small space. Zint supports encoding up to the ISO standard
maximum symbol size of 925 codewords which (at error correction level 0) allows maximum symbol size of 925 codewords which (at error correction level 0) allows
a maximum data size of 1850 text characters, or 2710 digits. a maximum data size of 1850 text characters, or 2710 digits.
@ -3546,14 +3550,14 @@ can be generated with a two-dimensional component to make a composite symbol.
A stacked variation of the GS1 DataBar Expanded symbol for smaller packages. A stacked variation of the GS1 DataBar Expanded symbol for smaller packages.
Input is the same as for GS1 DataBar Expanded (see 6.1.11.3 GS1 DataBar Input is the same as for GS1 DataBar Expanded (see 6.1.11.3 GS1 DataBar
Expanded). In addition the width of the symbol can be altered using the --cols Expanded), with the same maximum capacity. The width of the symbol can be
switch (API option_2). In this case the number of columns (values 1 to 11) altered using the --cols switch (API option_2). In this case the number of
relates to the number of character pairs on each row of the symbol. columns (values 1 to 11) relates to the number of character pairs on each row of
Alternatively the --rows switch (API option_3) can be used to specify the the symbol. Alternatively the --rows switch (API option_3) can be used to
maximum number of rows (values 2 to 11), and the number of columns will be specify the maximum number of rows (values 2 to 11), and the number of columns
adjusted accordingly. This symbol can be generated with a two-dimensional will be adjusted accordingly. This symbol can be generated with a
component to make a composite symbol. For symbols with a 2D component the number two-dimensional component to make a composite symbol. For such symbols the
of columns must be at least 2. number of columns must be at least 2.
6.2.8 Code 49 6.2.8 Code 49
@ -3561,10 +3565,10 @@ of columns must be at least 2.
Developed in 1987 at Intermec, Code 49 is a cross between UPC and Code 39. It is Developed in 1987 at Intermec, Code 49 is a cross between UPC and Code 39. It is
one of the earliest stacked symbologies and influenced the design of Code 16K a one of the earliest stacked symbologies and influenced the design of Code 16K a
few years later. It supports full 7-bit ASCII input up to a maximum of 49 year later. It supports full 7-bit ASCII input up to a maximum of 49 characters
characters or 81 numeric digits. GS1 data encoding is also supported. The or 81 numeric digits. GS1 data encoding is also supported. The minimum number of
minimum number of rows to use can be set using the --rows option (API option_1), fixed-width rows to use can be set using the --rows option (API option_1), with
with values from 2 to 8. values from 2 to 8.
6.3 GS1 Composite Symbols (ISO 24723) 6.3 GS1 Composite Symbols (ISO 24723)