1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-01-28 14:25:59 +00:00

CLI: add ZINT_TEST-only "--test" option (currently just ensures

the barcode name table is sorted so binary chop works), adding
  `ZINT_HAVE_GS1SE` define to "zint_add_test.cmake" - allows
  `test_barcode_symbology()` in "test_args.c" to be a lot less
  verbose; `const`-up various variables;
manual: use better MAILMAKE_4S example data and mention special
  fixed string international destination
This commit is contained in:
gitlost
2025-12-26 18:22:48 +00:00
parent e8d9b7195a
commit a3f6c75bc0
8 changed files with 231 additions and 336 deletions

View File

@@ -11,6 +11,9 @@ macro(zint_add_test test_name test_command)
if(NOT (ZINT_USE_PNG AND PNG_FOUND))
target_compile_definitions(${test_command} PRIVATE ZINT_NO_PNG)
endif()
if(ZINT_USE_GS1SE AND GS1SE)
target_compile_definitions(${test_command} PRIVATE ZINT_HAVE_GS1SE)
endif()
add_test(${test_name} ${test_command})
if(MSVC)
@@ -28,6 +31,9 @@ macro(zint_add_test test_name test_command)
if(NOT (ZINT_USE_PNG AND PNG_FOUND))
target_compile_definitions(${test_command}-static PRIVATE ZINT_NO_PNG)
endif()
if(ZINT_USE_GS1SE AND GS1SE)
target_compile_definitions(${test_command}-static PRIVATE ZINT_HAVE_GS1SE)
endif()
add_test(${test_name}-static ${test_command}-static)
if(MSVC)
string(REPLACE ";" "\\;" env_path "$ENV{PATH}")

View File

@@ -4,6 +4,6 @@
<desc>Zint Generated Symbol</desc>
<g id="barcode" fill="#000000">
<rect x="0" y="0" width="1048" height="68" fill="#FFFFFF"/>
<path d="M80 0h8v42.63h-8ZM160 0h8v42.63h-8ZM176 0h8v42.63h-8ZM256 0h8v42.63h-8ZM272 0h8v42.63h-8ZM352 0h8v42.63h-8ZM368 0h8v42.63h-8ZM496 0h8v42.63h-8ZM512 0h8v42.63h-8ZM544 0h8v42.63h-8ZM560 0h8v42.63h-8ZM608 0h8v42.63h-8ZM640 0h8v42.63h-8ZM656 0h8v42.63h-8ZM720 0h8v67.95h-8ZM736 0h8v42.63h-8ZM752 0h8v67.95h-8ZM832 0h8v42.63h-8ZM848 0h8v42.63h-8ZM928 0h8v42.63h-8ZM944 0h8v42.63h-8ZM960 0h8v67.95h-8ZM992 0h8v67.95h-8ZM1008 0h8v42.63h-8ZM1024 0h8v67.95h-8ZM1040 0h8v67.95h-8ZM0 25.31h8v17.32h-8ZM16 25.31h8v17.32h-8ZM32 25.31h8v42.63h-8ZM48 25.31h8v17.32h-8ZM64 25.31h8v17.32h-8ZM96 25.31h8v17.32h-8ZM112 25.31h8v17.32h-8ZM128 25.31h8v42.63h-8ZM144 25.31h8v17.32h-8ZM192 25.31h8v17.32h-8ZM208 25.31h8v17.32h-8ZM224 25.31h8v42.63h-8ZM240 25.31h8v17.32h-8ZM288 25.31h8v17.32h-8ZM304 25.31h8v17.32h-8ZM320 25.31h8v42.63h-8ZM336 25.31h8v17.32h-8ZM384 25.31h8v17.32h-8ZM400 25.31h8v17.32h-8ZM416 25.31h8v42.63h-8ZM432 25.31h8v17.32h-8ZM448 25.31h8v17.32h-8ZM464 25.31h8v42.63h-8ZM480 25.31h8v42.63h-8ZM528 25.31h8v17.32h-8ZM576 25.31h8v42.63h-8ZM592 25.31h8v42.63h-8ZM624 25.31h8v17.32h-8ZM672 25.31h8v17.32h-8ZM688 25.31h8v42.63h-8ZM704 25.31h8v42.63h-8ZM768 25.31h8v17.32h-8ZM784 25.31h8v42.63h-8ZM800 25.31h8v42.63h-8ZM816 25.31h8v17.32h-8ZM864 25.31h8v42.63h-8ZM880 25.31h8v42.63h-8ZM896 25.31h8v42.63h-8ZM912 25.31h8v17.32h-8ZM976 25.31h8v42.63h-8Z"/>
<path d="M16 0h8v42.63h-8ZM32 0h8v42.63h-8ZM64 0h8v42.63h-8ZM128 0h8v42.63h-8ZM176 0h8v42.63h-8ZM192 0h8v42.63h-8ZM240 0h8v67.95h-8ZM256 0h8v42.63h-8ZM368 0h8v67.95h-8ZM400 0h8v67.95h-8ZM480 0h8v67.95h-8ZM496 0h8v67.95h-8ZM528 0h8v67.95h-8ZM560 0h8v42.63h-8ZM576 0h8v67.95h-8ZM608 0h8v42.63h-8ZM672 0h8v67.95h-8ZM688 0h8v67.95h-8ZM752 0h8v42.63h-8ZM784 0h8v42.63h-8ZM848 0h8v67.95h-8ZM864 0h8v42.63h-8ZM928 0h8v42.63h-8ZM944 0h8v67.95h-8ZM992 0h8v67.95h-8ZM1040 0h8v42.63h-8ZM0 25.31h8v42.63h-8ZM48 25.31h8v17.32h-8ZM80 25.31h8v17.32h-8ZM96 25.31h8v17.32h-8ZM112 25.31h8v17.32h-8ZM144 25.31h8v42.63h-8ZM160 25.31h8v17.32h-8ZM208 25.31h8v17.32h-8ZM224 25.31h8v17.32h-8ZM272 25.31h8v42.63h-8ZM288 25.31h8v42.63h-8ZM304 25.31h8v42.63h-8ZM320 25.31h8v42.63h-8ZM336 25.31h8v17.32h-8ZM352 25.31h8v17.32h-8ZM384 25.31h8v17.32h-8ZM416 25.31h8v42.63h-8ZM432 25.31h8v42.63h-8ZM448 25.31h8v42.63h-8ZM464 25.31h8v42.63h-8ZM512 25.31h8v42.63h-8ZM544 25.31h8v42.63h-8ZM592 25.31h8v17.32h-8ZM624 25.31h8v42.63h-8ZM640 25.31h8v42.63h-8ZM656 25.31h8v17.32h-8ZM704 25.31h8v17.32h-8ZM720 25.31h8v42.63h-8ZM736 25.31h8v42.63h-8ZM768 25.31h8v17.32h-8ZM800 25.31h8v42.63h-8ZM816 25.31h8v17.32h-8ZM832 25.31h8v17.32h-8ZM880 25.31h8v17.32h-8ZM896 25.31h8v17.32h-8ZM912 25.31h8v42.63h-8ZM960 25.31h8v42.63h-8ZM976 25.31h8v17.32h-8ZM1008 25.31h8v42.63h-8ZM1024 25.31h8v42.63h-8Z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -5968,9 +5968,9 @@ Mailmark</h3>
includes Reed- Solomon error correction.</p>
<figure>
<img src="images/mailmark_4s.svg" class="trk"
alt="zint -b MAILMARK_4S --compliantheight -d &quot;1100000000000XY11&quot;" />
alt="zint -b MAILMARK_4S --compliantheight -d &quot;21B2254800659JW5O9QA6Y&quot;" />
<figcaption><span class="figure-label">Figure 107:</span>
<code>zint -b MAILMARK_4S --compliantheight -d "1100000000000XY11"</code></figcaption>
<code>zint -b MAILMARK_4S --compliantheight -d "21B2254800659JW5O9QA6Y"</code></figcaption>
</figure>
<p>Input is a pre-formatted alphanumeric string of 22 (for Barcode C) or
26 (for Barcode L) characters, producing a symbol with 66 or 78 bars
@@ -6030,7 +6030,8 @@ Mailmark Destination+DPS Patterns</caption>
<code>'S'</code> for space.</p>
<p>Four of the permitted patterns include a number of trailing space
characters - these will be appended by Zint if not included in the input
data.</p>
data. A special fixed string <code>"XY11 "</code> (5 trailing
spaces, inclusion optional) designates an international destination.</p>
<p>For the two-dimensional Data Matrix-based version, see <a
href="#royal-mail-2d-mailmark-cmdm-data-matrix">6.6.2 Royal Mail 2D
Mailmark (CMDM) (Data Matrix)</a>.</p>

View File

@@ -4074,7 +4074,7 @@ Developed in 2014 as a replacement for RM4SCC this 4-state symbol includes Reed-
Solomon error correction.
![`zint -b MAILMARK_4S --compliantheight -d
"1100000000000XY11"`](images/mailmark_4s.svg){.trk}
"21B2254800659JW5O9QA6Y"`](images/mailmark_4s.svg){.trk}
Input is a pre-formatted alphanumeric string of 22 (for Barcode C) or 26 (for
Barcode L) characters, producing a symbol with 66 or 78 bars respectively. The
@@ -4104,7 +4104,9 @@ where `'A'` stands for full alphabetic (A-Z), `'L'` for limited alphabetic (A-Z
less `'CIKMOV'`), `'N'` for numeric (0-9), and `'S'` for space.
Four of the permitted patterns include a number of trailing space characters -
these will be appended by Zint if not included in the input data.
these will be appended by Zint if not included in the input data. A special
fixed string `"XY11 "` (5 trailing spaces, inclusion optional) designates an
international destination.
For the two-dimensional Data Matrix-based version, see [6.6.2 Royal Mail 2D
Mailmark (CMDM) (Data Matrix)].

View File

@@ -3898,7 +3898,7 @@ Zint.
Developed in 2014 as a replacement for RM4SCC this 4-state symbol includes Reed-
Solomon error correction.
[zint -b MAILMARK_4S --compliantheight -d "1100000000000XY11"]
[zint -b MAILMARK_4S --compliantheight -d "21B2254800659JW5O9QA6Y"]
Input is a pre-formatted alphanumeric string of 22 (for Barcode C) or 26 (for
Barcode L) characters, producing a symbol with 66 or 78 bars respectively. The
@@ -3930,7 +3930,9 @@ where 'A' stands for full alphabetic (A-Z), 'L' for limited alphabetic (A-Z less
'CIKMOV'), 'N' for numeric (0-9), and 'S' for space.
Four of the permitted patterns include a number of trailing space characters -
these will be appended by Zint if not included in the input data.
these will be appended by Zint if not included in the input data. A special
fixed string "XY11 " (5 trailing spaces, inclusion optional) designates an
international destination.
For the two-dimensional Data Matrix-based version, see 6.6.2 Royal Mail 2D
Mailmark (CMDM) (Data Matrix).

View File

@@ -114,7 +114,7 @@ zint -b AUSREPLY --compliantheight -d "12345678" --scale=$SCALE_TRACK -o images/
zint -b AUSREDIRECT --compliantheight -d "98765432" --scale=$SCALE_TRACK -o images/ausredirect.svg
zint -b KIX --compliantheight -d "2500GG30250" --scale=$SCALE_TRACK -o images/kix.svg
zint -b RM4SCC --compliantheight -d "W1J0TR01" --scale=$SCALE_TRACK -o images/rm4scc.svg
zint -b MAILMARK_4S --compliantheight -d "1100000000000XY11" --scale=$SCALE_TRACK -o images/mailmark_4s.svg
zint -b MAILMARK_4S --compliantheight -d "21B2254800659JW5O9QA6Y" --scale=$SCALE_TRACK -o images/mailmark_4s.svg
zint -b USPS_IMAIL --compliantheight -d "01234567094987654321-01234" --scale=$SCALE_TRACK -o images/usps_imail.svg
zint -b JAPANPOST --compliantheight -d "15400233-16-4-205" --scale=$SCALE_TRACK -o images/japanpost.svg
zint -b HIBC_DM -d "/ACMRN123456/V200912190833" --fast --square --scale=$SCALE_2D_BIGGER -o images/hibc_dm.svg

View File

@@ -19,6 +19,9 @@
*/
/* SPDX-License-Identifier: GPL-3.0-or-later */
#ifdef ZINT_TEST
#include <assert.h>
#endif
#include <errno.h>
#include <limits.h>
#include <stdio.h>
@@ -63,6 +66,10 @@ typedef char static_assert_int_at_least_32bits[sizeof(int) * CHAR_BIT < 32 ? -1
# define z_alloca(nmemb) alloca(nmemb)
#endif
#ifdef ZINT_TEST
static void test(void); /* Forward-ref */
#endif
/* Print list of supported symbologies */
static void types(void) {
/* Breaking up strings so don't get too long (i.e. 500 or so) */
@@ -129,12 +136,11 @@ static void version(const int no_png, const int have_gs1syntaxengine) {
const int version_major = zint_version / 10000;
const int version_minor = (zint_version % 10000) / 100;
int version_release = zint_version % 100;
int version_build;
if (version_release >= 9) {
/* This is a test release */
const int version_build = zint_version % 10;
version_release = version_release / 10;
version_build = zint_version % 10;
printf("Zint version %d.%d.%d.%d (dev)%s%s\n", version_major, version_minor, version_release, version_build,
no_png_lib, have_gs1syntaxengine_lib);
} else {
@@ -146,8 +152,8 @@ static void version(const int no_png, const int have_gs1syntaxengine) {
/* Output usage information */
static void usage(const int no_png, const int have_gs1syntaxengine) {
const char *no_png_type = no_png ? "" : "/PNG";
const char *no_png_ext = no_png ? "gif" : "png";
const char *const no_png_type = no_png ? "" : "/PNG";
const char *const no_png_ext = no_png ? "gif" : "png";
version(no_png, have_gs1syntaxengine);
@@ -265,7 +271,7 @@ static void show_eci(void) {
}
/* Do buffer-checking `strcpy()`-like copy */
static void cpy_str(char *buf, const int buf_size, const char *str) {
static void cpy_str(char *const buf, const int buf_size, const char *const str) {
const int str_len = (int) strlen(str);
const int max_len = str_len >= buf_size ? buf_size - 1 : str_len;
memcpy(buf, str, max_len);
@@ -273,7 +279,7 @@ static void cpy_str(char *buf, const int buf_size, const char *str) {
}
/* Do buffer-checking `strncpy()`-like copy */
static void ncpy_str(char *buf, const int buf_size, const char *str, const int str_max) {
static void ncpy_str(char *const buf, const int buf_size, const char *const str, const int str_max) {
const int str_len = (int) strlen(str);
const int max_str_len = str_len > str_max ? str_max : str_len;
const int max_len = max_str_len >= buf_size ? buf_size - 1 : max_str_len;
@@ -282,7 +288,7 @@ static void ncpy_str(char *buf, const int buf_size, const char *str, const int s
}
/* Verifies that a string (length <= 9) only uses digits. On success returns value in arg */
static int validate_int(const char source[], int len, int *p_val) {
static int validate_int(const char source[], int len, int *const p_val) {
int val = 0;
int i;
const int length = len == -1 ? (int) strlen(source) : len;
@@ -304,7 +310,7 @@ static int validate_int(const char source[], int len, int *p_val) {
/* Verifies that a string is a simplified form of floating point, max 7 significant decimal digits with
optional decimal point. On success returns val in arg. On failure sets `errbuf` */
static int validate_float(const char source[], const int allow_neg, float *p_val, char errbuf[64]) {
static int validate_float(const char source[], const int allow_neg, float *const p_val, char errbuf[64]) {
static const float fract_muls[7] = { 0.1f, 0.01f, 0.001f, 0.0001f, 0.00001f, 0.000001f, 0.0000001f };
int val = 0;
int neg = 0;
@@ -387,7 +393,11 @@ static void to_lower(char source[]) {
}
/* Return symbology id if `barcode_name` a barcode name */
static int get_barcode_name(const char *barcode_name) {
#ifdef ZINT_TEST
static int get_barcode_name(const char *const barcode_name, const int test) {
#else
static int get_barcode_name(const char *const barcode_name) {
#endif
/* Must be sorted for binary search to work */
static const struct { int symbology; const char *n; } names[] = {
{ BARCODE_C25LOGIC, "2of5datalogic" }, /* Synonym */
@@ -618,6 +628,19 @@ static int get_barcode_name(const char *barcode_name) {
char n[30];
int i, j, length;
#ifdef ZINT_TEST
if (test) {
/* Ensure array sorted */
for (i = 0; i < e; i++) {
if (strcmp(names[i].n, names[i + 1].n) >= 0) {
fprintf(stderr, "get_barcode_name: %d: %s >= %s\n", i, names[i].n, names[i + 1].n);
assert(0);
}
}
return 0;
}
#endif
/* Ignore case and any "BARCODE" prefix */
cpy_str(n, ARRAY_SIZE(n), barcode_name);
to_lower(n);
@@ -654,7 +677,7 @@ static int get_barcode_name(const char *barcode_name) {
}
/* Whether `filetype` supported by Zint. Sets `png_refused` if `no_png` and PNG requested */
static int supported_filetype(const char *filetype, const int no_png, int *png_refused) {
static int supported_filetype(const char *const filetype, const int no_png, int *const png_refused) {
static const char filetypes[][4] = {
"bmp", "emf", "eps", "gif", "pcx", "png", "svg", "tif", "txt",
};
@@ -664,6 +687,10 @@ static int supported_filetype(const char *filetype, const int no_png, int *png_r
if (png_refused) {
*png_refused = 0;
}
/* Disallow != 3, except for "tiff" */
if (strlen(filetype) != 3 && strcmp(filetype, "tiff") != 0 && strcmp(filetype, "TIFF") != 0) {
return 0;
}
ncpy_str(lc_filetype, ARRAY_SIZE(lc_filetype), filetype, 3);
to_lower(lc_filetype);
@@ -683,7 +710,7 @@ static int supported_filetype(const char *filetype, const int no_png, int *png_r
}
/* Get file extension, excluding those of 4 or more letters */
static char *get_extension(const char *file) {
static char *get_extension(const char *const file) {
char *dot;
dot = strrchr(file, '.');
@@ -695,7 +722,7 @@ static char *get_extension(const char *file) {
/* Set extension of `file` to `filetype`, replacing existing extension if any.
* Does nothing if file already has `filetype` extension */
static void set_extension(char file[256], const char *filetype) {
static void set_extension(char file[256], const char *const filetype) {
char lc_filetype[4];
char *extension;
char lc_extension[4];
@@ -722,7 +749,7 @@ static void set_extension(char file[256], const char *filetype) {
}
/* Whether `filetype` is raster type */
static int is_raster(const char *filetype, const int no_png) {
static int is_raster(const char *const filetype, const int no_png) {
static const char raster_filetypes[][4] = {
"bmp", "gif", "pcx", "png", "tif",
};
@@ -748,7 +775,7 @@ static int is_raster(const char *filetype, const int no_png) {
}
/* Helper for `validate_scalexdimdp()` to search for units, returning -2 on error, -1 if not found, else index */
static int validate_units(char *buf, const char units[][5], int units_size) {
static int validate_units(char *const buf, const char units[][5], const int units_size) {
int i;
char *unit;
@@ -769,7 +796,7 @@ static int validate_units(char *buf, const char units[][5], int units_size) {
}
/* Parse and validate argument "xdim[,resolution]" to "--scalexdimdp" */
static int validate_scalexdimdp(const char *arg, float *p_x_dim_mm, float *p_dpmm) {
static int validate_scalexdimdp(const char *const arg, float *const p_x_dim_mm, float *const p_dpmm) {
static const char x_units[][5] = { "mm", "in" };
static const char r_units[][5] = { "dpmm", "dpi" };
char x_buf[7 + 1 + 4 + 1]; /* Allow for 7 digits + dot + 4-char unit + NUL */
@@ -829,7 +856,7 @@ static int validate_scalexdimdp(const char *arg, float *p_x_dim_mm, float *p_dpm
}
/* Parse and validate Structured Append argument "index,count[,ID]" to "--structapp" */
static int validate_structapp(const char *arg, struct zint_structapp *structapp) {
static int validate_structapp(const char *const arg, struct zint_structapp *const structapp) {
char index[10], count[10];
const char *comma = strchr(arg, ',');
const char *comma2;
@@ -890,9 +917,9 @@ static int validate_structapp(const char *arg, struct zint_structapp *structapp)
}
/* Parse and validate the segment argument "ECI,DATA" to "--segN" */
static int validate_seg(const char *arg, const int N, struct zint_seg segs[10]) {
static int validate_seg(const char *const arg, const int N, struct zint_seg segs[10]) {
char eci[10];
const char *comma = strchr(arg, ',');
const char *const comma = strchr(arg, ',');
if (!comma || comma == arg || comma - arg > 9 || *(comma + 1) == '\0') {
fprintf(stderr, "Error 166: Invalid segment argument, expect \"ECI,DATA\"\n");
return 0;
@@ -912,19 +939,19 @@ static int validate_seg(const char *arg, const int N, struct zint_seg segs[10])
}
#ifdef _WIN32
static FILE *win_fopen(const char *filename, const char *mode); /* Forward ref */
static FILE *win_fopen(const char *const filename, const char *const mode); /* Forward ref */
#endif
/* Batch mode - output symbol for each line of text in `filename` */
static int batch_process(struct zint_symbol *symbol, const char *filename, const int mirror_mode,
const char *filetype, const int output_given, const int rotate_angle) {
static int batch_process(struct zint_symbol *const symbol, const char *const filename, const int mirror_mode,
const char *const filetype, const int output_given, const int rotate_angle) {
FILE *file;
unsigned char buffer[ZINT_MAX_DATA_LEN] = {0}; /* Maximum HanXin input */
unsigned char character = 0;
int buf_posn = 0, error_number = 0, warn_number = 0, line_count = 1;
char output_file[ARRAY_SIZE(symbol->outfile)];
char format_string[ARRAY_SIZE(symbol->outfile)];
int format_len, i, o, mirror_start_o = 0;
int i, mirror_start_o = 0;
const int from_stdin = strcmp(filename, "-") == 0; /* Suppress clang-19 warning clang-analyzer-unix.Stream */
if (mirror_mode) {
@@ -995,6 +1022,7 @@ static int batch_process(struct zint_symbol *symbol, const char *filename, const
char *rs = reversed_string;
int inpos = 0;
int local_line_count = line_count;
const int format_len = (int) strlen(format_string);
memset(output_file, 0, ARRAY_SIZE(output_file));
do {
number[inpos++] = (local_line_count % 10) + '0';
@@ -1005,7 +1033,6 @@ static int batch_process(struct zint_symbol *symbol, const char *filename, const
reverse_number[i] = number[inpos - i - 1];
}
format_len = (int) strlen(format_string);
for (i = format_len; i > 0; i--) {
char adjusted;
@@ -1050,8 +1077,8 @@ static int batch_process(struct zint_symbol *symbol, const char *filename, const
}
} else {
/* Name the output file from the data being processed */
int o = mirror_start_o;
i = 0;
o = mirror_start_o;
do {
if (buffer[i] < 0x20) {
output_file[o] = '_';
@@ -1366,7 +1393,7 @@ static WCHAR **win_CommandLineToArgvW(const WCHAR *cmdline, int *numargs) {
}
/* For Windows replace args with UTF-8 versions */
static void win_args(int *p_argc, char ***p_argv) {
static void win_args(int *const p_argc, char ***const p_argv) {
int i;
LPWSTR *szArgList = win_CommandLineToArgvW(GetCommandLineW(), &win_argc);
if (szArgList) {
@@ -1407,7 +1434,7 @@ static void win_args(int *p_argc, char ***p_argv) {
}
/* Do `fopen()` on Windows, assuming `filename` is UTF-8 encoded. Ticket #288, props Marcel */
static FILE *win_fopen(const char *filename, const char *mode) {
static FILE *win_fopen(const char *const filename, const char *const mode) {
wchar_t *filenameW, *modeW;
utf8_to_wide(filename, filenameW, NULL /*fail return*/);
@@ -1418,7 +1445,7 @@ static FILE *win_fopen(const char *filename, const char *mode) {
#endif /* _WIN32 */
/* Helper to free Windows args on exit */
static int do_exit(int error_number) {
static int do_exit(const int error_number) {
#ifdef _WIN32
win_free_args();
#endif
@@ -1456,7 +1483,7 @@ int main(int argc, char **argv) {
float x_dim_mm = 0.0f, dpmm = 0.0f;
float float_opt;
char errbuf[64]; /* For `validate_float()` */
arg_opt *arg_opts = (arg_opt *) z_alloca(sizeof(arg_opt) * argc);
arg_opt *const arg_opts = (arg_opt *) z_alloca(sizeof(arg_opt) * argc);
const int no_png = ZBarcode_NoPng();
const int have_gs1syntaxengine = ZBarcode_HaveGS1SyntaxEngine();
@@ -1490,8 +1517,11 @@ int main(int argc, char **argv) {
OPT_NOBACKGROUND, OPT_NOQUIETZONES, OPT_NOTEXT, OPT_PRIMARY, OPT_QUIETZONES,
OPT_ROTATE, OPT_ROWS, OPT_SCALE, OPT_SCALEXDIM, OPT_SCMVV, OPT_SECURE,
OPT_SEG1, OPT_SEG2, OPT_SEG3, OPT_SEG4, OPT_SEG5, OPT_SEG6, OPT_SEG7, OPT_SEG8, OPT_SEG9,
OPT_SEPARATOR, OPT_SMALL, OPT_SQUARE, OPT_STRUCTAPP, OPT_TEXTGAP,
OPT_VERBOSE, OPT_VERS, OPT_VWHITESP, OPT_WERROR
OPT_SEPARATOR, OPT_SMALL, OPT_SQUARE, OPT_STRUCTAPP,
#ifdef ZINT_TEST
OPT_TEST,
#endif
OPT_TEXTGAP, OPT_VERBOSE, OPT_VERS, OPT_VWHITESP, OPT_WERROR
};
static const struct option long_options[] = {
{"addongap", 1, NULL, OPT_ADDONGAP},
@@ -1568,6 +1598,9 @@ int main(int argc, char **argv) {
{"small", 0, NULL, OPT_SMALL},
{"square", 0, NULL, OPT_SQUARE},
{"structapp", 1, NULL, OPT_STRUCTAPP},
#ifdef ZINT_TEST
{"test", 0, NULL, OPT_TEST},
#endif
{"textgap", 1, NULL, OPT_TEXTGAP},
{"types", 0, NULL, 't'},
{"verbose", 0, NULL, OPT_VERBOSE}, /* Currently undocumented, output some debug info */
@@ -1987,6 +2020,12 @@ int main(int argc, char **argv) {
return do_exit(ZINT_ERROR_INVALID_OPTION);
}
break;
#ifdef ZINT_TEST
case OPT_TEST:
test();
help = 1; /* Mark as help to avoid "No data" warning */
break;
#endif
case OPT_TEXTGAP:
if (!validate_float(optarg, 1 /*allow_neg*/, &float_opt, errbuf)) {
fprintf(stderr, "Error 194: Invalid text gap floating point (%s)\n", errbuf);
@@ -2054,7 +2093,11 @@ int main(int argc, char **argv) {
break;
case 'b':
#ifdef ZINT_TEST
if (!validate_int(optarg, -1 /*len*/, &val) && !(val = get_barcode_name(optarg, 0 /*test*/))) {
#else
if (!validate_int(optarg, -1 /*len*/, &val) && !(val = get_barcode_name(optarg))) {
#endif
fprintf(stderr, "Error 119: Invalid barcode type '%s'\n", optarg);
return do_exit(ZINT_ERROR_INVALID_OPTION);
}
@@ -2327,4 +2370,10 @@ int main(int argc, char **argv) {
return do_exit(error_number ? error_number : warn_number);
}
#ifdef ZINT_TEST
static void test(void) {
(void)get_barcode_name(NULL, 1 /*test*/);
}
#endif
/* vim: set ts=4 sw=4 et : */

View File

@@ -225,6 +225,9 @@ static void arg_input_mode(char *cmd, int input_mode) {
if (input_mode & GS1NOCHECK_MODE) {
sprintf(cmd + strlen(cmd), "%s--gs1nocheck", strlen(cmd) ? " " : "");
}
if (input_mode & GS1SYNTAXENGINE_MODE) {
sprintf(cmd + strlen(cmd), "%s--gs1strict", strlen(cmd) ? " " : "");
}
if (input_mode & HEIGHTPERROW_MODE) {
sprintf(cmd + strlen(cmd), "%s--heightperrow", strlen(cmd) ? " " : "");
}
@@ -823,32 +826,34 @@ static void test_checks(const testCtx *const p_ctx) {
/* 11*/ { -1, -1, -1, -1, -1, -2, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 138: Invalid ECI code (digits only)" },
/* 12*/ { -1, -1, -1, -1, -1, 1000000, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 118: ECI code '1000000' out of range (0 to 999999), **IGNORED**" },
/* 13*/ { -1, -1, -1, -1, -1, -1, "jpg", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 142: File type 'jpg' not supported, **IGNORED**" },
/* 14*/ { -1, -1, -1, -1, -1, -1, NULL, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 183: Invalid symbol height floating point (negative value not permitted)" },
/* 15*/ { -1, -1, -1, -1, -1, -1, NULL, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 110: Symbol height '0' out of range (0.5 to 2000), **IGNORED**" },
/* 16*/ { -1, -1, -1, -1, -1, -1, NULL, 2001, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 110: Symbol height '2001' out of range (0.5 to 2000), **IGNORED**" },
/* 17*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 182: Invalid guard bar descent floating point (negative value not permitted)" },
/* 18*/ { -1, -1, -1, -1, -1, -1, NULL, -1, 50.1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 135: Guard bar descent '50.1' out of range (0 to 50), **IGNORED**" },
/* 19*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 148: Invalid mask value (digits only)" },
/* 20*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 147: Mask value '8' out of range (0 to 7), **IGNORED**" },
/* 21*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 116: Mode value '7' out of range (0 to 6), **IGNORED**" },
/* 22*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, "Error 117: Invalid rotation value (digits only)" },
/* 23*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 137: Rotation value '45' out of range (0, 90, 180 or 270 only), **IGNORED**" },
/* 24*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, "Error 132: Invalid rows value (digits only)" },
/* 25*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, "Warning 112: Number of rows '91' out of range (1 to 90), **IGNORED**" },
/* 26*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, "Error 184: Invalid scale floating point (negative value not permitted)" },
/* 27*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, 0.49, -1, -1, -1, -1, -1, -1, "Warning 146: Scaling less than 0.5 will be set to 0.5 for 'gif' output" },
/* 28*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, "Error 149: Invalid Structured Carrier Message version value (digits only)" },
/* 29*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, 100, -1, -1, -1, -1, -1, "Warning 150: Structured Carrier Message version '100' out of range (0 to 99), **IGNORED**" },
/* 30*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, "Error 134: Invalid ECC value (digits only)" },
/* 31*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, 9, -1, -1, -1, -1, "Warning 114: ECC level '9' out of range (0 to 8), **IGNORED**" },
/* 32*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, "Error 128: Invalid separator value (digits only)" },
/* 33*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, -1, -1, -1, "Warning 127: Separator value '5' out of range (0 to 4), **IGNORED**" },
/* 34*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, "Error 133: Invalid version value (digits only)" },
/* 35*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1000, -1, -1, "Warning 113: Version value '1000' out of range (1 to 999), **IGNORED**" },
/* 36*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, "Error 153: Invalid vertical whitespace value '-2' (digits only)" },
/* 37*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1001, -1, "Warning 154: Vertical whitespace value '1001' out of range (0 to 1000), **IGNORED**" },
/* 38*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, "Error 120: Invalid horizontal whitespace value '-2' (digits only)" },
/* 39*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1001, "Warning 121: Horizontal whitespace value '1001' out of range (0 to 1000), **IGNORED**" },
/* 14*/ { -1, -1, -1, -1, -1, -1, "giff", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 142: File type 'giff' not supported, **IGNORED**" },
/* 15*/ { -1, -1, -1, -1, -1, -1, "tiff", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "" }, /* Allow "tiff" */
/* 16*/ { -1, -1, -1, -1, -1, -1, NULL, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 183: Invalid symbol height floating point (negative value not permitted)" },
/* 17*/ { -1, -1, -1, -1, -1, -1, NULL, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 110: Symbol height '0' out of range (0.5 to 2000), **IGNORED**" },
/* 18*/ { -1, -1, -1, -1, -1, -1, NULL, 2001, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 110: Symbol height '2001' out of range (0.5 to 2000), **IGNORED**" },
/* 19*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 182: Invalid guard bar descent floating point (negative value not permitted)" },
/* 20*/ { -1, -1, -1, -1, -1, -1, NULL, -1, 50.1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 135: Guard bar descent '50.1' out of range (0 to 50), **IGNORED**" },
/* 21*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 148: Invalid mask value (digits only)" },
/* 22*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 147: Mask value '8' out of range (0 to 7), **IGNORED**" },
/* 23*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 116: Mode value '7' out of range (0 to 6), **IGNORED**" },
/* 24*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, "Error 117: Invalid rotation value (digits only)" },
/* 25*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 137: Rotation value '45' out of range (0, 90, 180 or 270 only), **IGNORED**" },
/* 26*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, "Error 132: Invalid rows value (digits only)" },
/* 27*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, "Warning 112: Number of rows '91' out of range (1 to 90), **IGNORED**" },
/* 28*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, "Error 184: Invalid scale floating point (negative value not permitted)" },
/* 29*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, 0.49, -1, -1, -1, -1, -1, -1, "Warning 146: Scaling less than 0.5 will be set to 0.5 for 'gif' output" },
/* 30*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, "Error 149: Invalid Structured Carrier Message version value (digits only)" },
/* 31*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, 100, -1, -1, -1, -1, -1, "Warning 150: Structured Carrier Message version '100' out of range (0 to 99), **IGNORED**" },
/* 32*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, "Error 134: Invalid ECC value (digits only)" },
/* 33*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, 9, -1, -1, -1, -1, "Warning 114: ECC level '9' out of range (0 to 8), **IGNORED**" },
/* 34*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, "Error 128: Invalid separator value (digits only)" },
/* 35*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, -1, -1, -1, "Warning 127: Separator value '5' out of range (0 to 4), **IGNORED**" },
/* 36*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, "Error 133: Invalid version value (digits only)" },
/* 37*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1000, -1, -1, "Warning 113: Version value '1000' out of range (1 to 999), **IGNORED**" },
/* 38*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, "Error 153: Invalid vertical whitespace value '-2' (digits only)" },
/* 39*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1001, -1, "Warning 154: Vertical whitespace value '1001' out of range (0 to 1000), **IGNORED**" },
/* 40*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, "Error 120: Invalid horizontal whitespace value '-2' (digits only)" },
/* 41*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1001, "Warning 121: Horizontal whitespace value '1001' out of range (0 to 1000), **IGNORED**" },
};
int data_size = ARRAY_SIZE(data);
int i;
@@ -917,214 +922,35 @@ static void test_barcode_symbology(const testCtx *const p_ctx) {
/* 0*/ { "_", "1", NULL, 1, "Error 119: Invalid barcode type '_'" },
/* 1*/ { "a", "1", NULL, 1, "Error 119: Invalid barcode type 'a'" },
/* 2*/ { "code128", "1", NULL, 0, "BARCODE_CODE128 (20)," },
/* 3*/ { "code218", "1", NULL, 1, "Error 119: Invalid barcode type 'code218'" },
/* 4*/ { "code12", "1", NULL, 1, "Error 119: Invalid barcode type 'code12'" },
/* 3*/ { "code12", "1", NULL, 1, "Error 119: Invalid barcode type 'code12'" },
/* 4*/ { "code1288", "1", NULL, 1, "Error 119: Invalid barcode type 'code1288'" },
/* 5*/ { "BARCODE_CODE11", "1", NULL, 0, "BARCODE_CODE11 (1)," },
/* 6*/ { "C25 Standard", "1", NULL, 0, "BARCODE_C25STANDARD (2)," },
/* 7*/ { "c25matrix", "1", NULL, 0, "BARCODE_C25STANDARD (2)," }, /* Legacy now supported */
/* 8*/ { "2 of 5 Standard", "1", NULL, 0, "BARCODE_C25STANDARD (2)," }, /* Synonym */
/* 9*/ { "2 of 5 Matrix", "1", NULL, 0, "BARCODE_C25STANDARD (2)," }, /* Synonym */
/* 10*/ { "Code 2 of 5 Standard", "1", NULL, 0, "BARCODE_C25STANDARD (2)," }, /* Synonym */
/* 11*/ { "Code 2 of 5 Matrix", "1", NULL, 0, "BARCODE_C25STANDARD (2)," }, /* Synonym */
/* 12*/ { "Standard Code 2 of 5", "1", NULL, 0, "BARCODE_C25STANDARD (2)," }, /* Synonym */
/* 13*/ { "C25INTER", "1", NULL, 0, "BARCODE_C25INTER (3)," },
/* 14*/ { "c25 interleaved", "1", NULL, 0, "BARCODE_C25INTER (3)," }, /* Synonym */
/* 15*/ { "code 2 of 5 inter", "1", NULL, 0, "BARCODE_C25INTER (3)," }, /* Synonym */
/* 16*/ { "code 2 of 5 interleaved", "1", NULL, 0, "BARCODE_C25INTER (3)," }, /* Synonym */
/* 17*/ { "2 of 5 inter", "1", NULL, 0, "BARCODE_C25INTER (3)," }, /* Synonym */
/* 18*/ { "2 of 5 interleaved", "1", NULL, 0, "BARCODE_C25INTER (3)," }, /* Synonym */
/* 19*/ { "interleaved 2 of 5", "1", NULL, 0, "BARCODE_C25INTER (3)," }, /* Synonym */
/* 20*/ { "interleaved code 2 of 5", "1", NULL, 0, "BARCODE_C25INTER (3)," }, /* Synonym */
/* 21*/ { "c25IATA", "1", NULL, 0, "BARCODE_C25IATA (4)," },
/* 22*/ { "2of5IATA", "1", NULL, 0, "BARCODE_C25IATA (4)," }, /* Synonym */
/* 23*/ { "code2of5IATA", "1", NULL, 0, "BARCODE_C25IATA (4)," }, /* Synonym */
/* 24*/ { "IATA2of5", "1", NULL, 0, "BARCODE_C25IATA (4)," }, /* Synonym */
/* 25*/ { "IATAcode2of5", "1", NULL, 0, "BARCODE_C25IATA (4)," }, /* Synonym */
/* 26*/ { "c25 Logic", "1", NULL, 0, "BARCODE_C25LOGIC (6)," },
/* 27*/ { "c25 Data Logic", "1", NULL, 0, "BARCODE_C25LOGIC (6)," }, /* Synonym */
/* 28*/ { "Code 2 of 5 Logic", "1", NULL, 0, "BARCODE_C25LOGIC (6)," }, /* Synonym */
/* 29*/ { "Code 2 of 5 Data Logic", "1", NULL, 0, "BARCODE_C25LOGIC (6)," }, /* Synonym */
/* 30*/ { "2 of 5 Logic", "1", NULL, 0, "BARCODE_C25LOGIC (6)," }, /* Synonym */
/* 31*/ { "2 of 5 Data Logic", "1", NULL, 0, "BARCODE_C25LOGIC (6)," }, /* Synonym */
/* 32*/ { "c25 Ind", "1", NULL, 0, "BARCODE_C25IND (7)," },
/* 33*/ { "c25 Industrial", "1", NULL, 0, "BARCODE_C25IND (7)," }, /* Synonym */
/* 34*/ { "code 2 of 5 Ind", "1", NULL, 0, "BARCODE_C25IND (7)," }, /* Synonym */
/* 35*/ { "code 2 of 5 Industrial", "1", NULL, 0, "BARCODE_C25IND (7)," }, /* Synonym */
/* 36*/ { "2 of 5 Ind", "1", NULL, 0, "BARCODE_C25IND (7)," }, /* Synonym */
/* 37*/ { "2 of 5 Industrial", "1", NULL, 0, "BARCODE_C25IND (7)," }, /* Synonym */
/* 38*/ { "Industrial 2 of 5", "1", NULL, 0, "BARCODE_C25IND (7)," }, /* Synonym */
/* 39*/ { "Industrial code 2 of 5", "1", NULL, 0, "BARCODE_C25IND (7)," }, /* Synonym */
/* 40*/ { "code39", "1", NULL, 0, "BARCODE_CODE39 (8)," },
/* 41*/ { "excode 39", "1", NULL, 0, "BARCODE_EXCODE39 (9)," },
/* 42*/ { "Extended Code 39", "1", NULL, 0, "BARCODE_EXCODE39 (9)," },
/* 43*/ { "eanx", "1", NULL, 0, "BARCODE_EANX (13)," },
/* 44*/ { "ean", "1", NULL, 0, "BARCODE_EANX (13)," },
/* 45*/ { "eanx chk", "1", NULL, 0, "BARCODE_EANX_CHK (14)," },
/* 46*/ { "eanxchk", "1", NULL, 0, "BARCODE_EANX_CHK (14)," },
/* 47*/ { "eanchk", "1", NULL, 0, "BARCODE_EANX_CHK (14)," },
/* 48*/ { "GS1128", "[01]12345678901231", NULL, 0, "BARCODE_GS1_128 (16)," },
/* 49*/ { "ean 128", "[01]12345678901231", NULL, 0, "BARCODE_GS1_128 (16)," },
/* 50*/ { "coda bar", "A1B", NULL, 0, "BARCODE_CODABAR (18)," },
/* 51*/ { "DPLEIT", "1", NULL, 0, "BARCODE_DPLEIT (21)," },
/* 52*/ { "DPIDENT", "1", NULL, 0, "BARCODE_DPIDENT (22)," },
/* 53*/ { "code16k", "1", NULL, 0, "BARCODE_CODE16K (23)," },
/* 54*/ { "CODE49", "1", NULL, 0, "BARCODE_CODE49 (24)," },
/* 55*/ { "CODE93", "1", NULL, 0, "BARCODE_CODE93 (25)," },
/* 56*/ { "flat", "1", NULL, 0, "BARCODE_FLAT (28)," },
/* 57*/ { "dbar omn", "1", NULL, 0, "BARCODE_DBAR_OMN (29)," },
/* 58*/ { "dbar omni", "1", NULL, 0, "BARCODE_DBAR_OMN (29)," },
/* 59*/ { "rss14", "1", NULL, 0, "BARCODE_DBAR_OMN (29)," },
/* 60*/ { "databar omn", "1", NULL, 0, "BARCODE_DBAR_OMN (29)," },
/* 61*/ { "databar omni", "1", NULL, 0, "BARCODE_DBAR_OMN (29)," },
/* 62*/ { "dbar ltd", "1", NULL, 0, "BARCODE_DBAR_LTD (30)," },
/* 63*/ { "dbar limited", "1", NULL, 0, "BARCODE_DBAR_LTD (30)," },
/* 64*/ { "rss ltd", "1", NULL, 0, "BARCODE_DBAR_LTD (30)," },
/* 65*/ { "databar ltd", "1", NULL, 0, "BARCODE_DBAR_LTD (30)," },
/* 66*/ { "databar limited", "1", NULL, 0, "BARCODE_DBAR_LTD (30)," },
/* 67*/ { "dbarexp", "[10]12", NULL, 0, "BARCODE_DBAR_EXP (31)," },
/* 68*/ { "dbarexpanded", "[10]12", NULL, 0, "BARCODE_DBAR_EXP (31)," },
/* 69*/ { "rss exp", "[10]12", NULL, 0, "BARCODE_DBAR_EXP (31)," },
/* 70*/ { "databarexp", "[10]12", NULL, 0, "BARCODE_DBAR_EXP (31)," },
/* 71*/ { "databarexpanded", "[10]12", NULL, 0, "BARCODE_DBAR_EXP (31)," },
/* 72*/ { "telepen", "1", NULL, 0, "BARCODE_TELEPEN (32)," },
/* 73*/ { "upc", "1", NULL, 1, "Error 119: Invalid barcode type 'upc'" },
/* 74*/ { "upca", "1", NULL, 0, "BARCODE_UPCA (34)," },
/* 75*/ { "upca_chk", "123456789012", NULL, 0, "BARCODE_UPCA_CHK (35)," },
/* 76*/ { "upce", "1", NULL, 0, "BARCODE_UPCE (37)," },
/* 77*/ { "upce chk", "12345670", NULL, 0, "BARCODE_UPCE_CHK (38)," },
/* 78*/ { "POSTNET ", "12345678901", NULL, 0, "BARCODE_POSTNET (40)," },
/* 79*/ { "msi", "1", NULL, 0, "BARCODE_MSI_PLESSEY (47)," },
/* 80*/ { "MSI Plessey ", "1", NULL, 0, "BARCODE_MSI_PLESSEY (47)," },
/* 81*/ { "fim ", "A", NULL, 0, "BARCODE_FIM (49)," },
/* 82*/ { "LOGMARS", "123456", NULL, 0, "BARCODE_LOGMARS (50)," },
/* 83*/ { " pharma", "123456", NULL, 0, "BARCODE_PHARMA (51)," },
/* 84*/ { " pzn ", "1", NULL, 0, "BARCODE_PZN (52)," },
/* 85*/ { "pharma two", "4", NULL, 0, "BARCODE_PHARMA_TWO (53)," },
/* 86*/ { "cepnet", "12345678", NULL, 0, "BARCODE_CEPNET (54)," },
/* 87*/ { "BARCODE_PDF417", "1", NULL, 0, "BARCODE_PDF417 (55)," },
/* 88*/ { "pdf", "1", NULL, 1, "Error 119: Invalid barcode type 'pdf'" },
/* 89*/ { "barcodepdf417comp", "1", NULL, 0, "BARCODE_PDF417COMP (56)," },
/* 90*/ { "pdf417trunc", "1", NULL, 0, "BARCODE_PDF417COMP (56)," },
/* 91*/ { "MaxiCode", "1", NULL, 0, "BARCODE_MAXICODE (57)," },
/* 92*/ { "QR CODE", "1", NULL, 0, "BARCODE_QRCODE (58)," },
/* 93*/ { "qr", "1", NULL, 0, "BARCODE_QRCODE (58)," }, /* Synonym */
/* 94*/ { "Code 128 B", "1", NULL, 0, "BARCODE_CODE128AB (60)," },
/* 95*/ { "Code 128 aB", "1", NULL, 0, "BARCODE_CODE128AB (60)," },
/* 96*/ { "AUS POST", "12345678901234567890123", NULL, 0, "BARCODE_AUSPOST (63)," },
/* 97*/ { "AusReply", "12345678", NULL, 0, "BARCODE_AUSREPLY (66)," },
/* 98*/ { "AUSROUTE", "12345678", NULL, 0, "BARCODE_AUSROUTE (67)," },
/* 99*/ { "AUS REDIRECT", "12345678", NULL, 0, "BARCODE_AUSREDIRECT (68)," },
/*100*/ { "isbnx", "123456789", NULL, 0, "BARCODE_ISBNX (69)," },
/*101*/ { "rm4scc", "1", NULL, 0, "BARCODE_RM4SCC (70)," },
/*102*/ { "DataMatrix", "1", NULL, 0, "BARCODE_DATAMATRIX (71)," },
/*103*/ { "EAN14", "1", NULL, 0, "BARCODE_EAN14 (72)," },
/*104*/ { "vin", "12345678701234567", NULL, 0, "BARCODE_VIN (73)" },
/*105*/ { "CodaBlock-F", "1", NULL, 0, "BARCODE_CODABLOCKF (74)," },
/*106*/ { "NVE18", "1", NULL, 0, "BARCODE_NVE18 (75)," },
/*107*/ { "Japan Post", "1", NULL, 0, "BARCODE_JAPANPOST (76)," },
/*108*/ { "Korea Post", "1", NULL, 0, "BARCODE_KOREAPOST (77)," },
/*109*/ { "DBar Stk", "1", NULL, 0, "BARCODE_DBAR_STK (79)," },
/*110*/ { "DBar Stacked", "1", NULL, 0, "BARCODE_DBAR_STK (79)," },
/*111*/ { "rss14stack", "1", NULL, 0, "BARCODE_DBAR_STK (79)," },
/*112*/ { "DataBar Stk", "1", NULL, 0, "BARCODE_DBAR_STK (79)," },
/*113*/ { "DataBar Stacked", "1", NULL, 0, "BARCODE_DBAR_STK (79)," },
/*114*/ { "DBar Omn Stk", "1", NULL, 0, "BARCODE_DBAR_OMNSTK (80)," },
/*115*/ { "DBar Stacked Omni", "1", NULL, 0, "BARCODE_DBAR_OMNSTK (80)," },
/*116*/ { "RSS14STACK OMNI", "1", NULL, 0, "BARCODE_DBAR_OMNSTK (80)," },
/*117*/ { "DataBar Omn Stk", "1", NULL, 0, "BARCODE_DBAR_OMNSTK (80)," },
/*118*/ { "DataBar Stacked Omn", "1", NULL, 0, "BARCODE_DBAR_OMNSTK (80)," },
/*119*/ { "DataBar Stacked Omni", "1", NULL, 0, "BARCODE_DBAR_OMNSTK (80)," },
/*120*/ { "DBar Exp Stk", "[20]01", NULL, 0, "BARCODE_DBAR_EXPSTK (81)," },
/*121*/ { "DBar Expanded Stacked", "[20]01", NULL, 0, "BARCODE_DBAR_EXPSTK (81)," },
/*122*/ { "rss_expstack", "[20]01", NULL, 0, "BARCODE_DBAR_EXPSTK (81)," },
/*123*/ { "DataBar Exp Stk", "[20]01", NULL, 0, "BARCODE_DBAR_EXPSTK (81)," },
/*124*/ { "DataBar Expanded Stk", "[20]01", NULL, 0, "BARCODE_DBAR_EXPSTK (81)," },
/*125*/ { "DataBar Expanded Stacked", "[20]01", NULL, 0, "BARCODE_DBAR_EXPSTK (81)," },
/*126*/ { "planet", "12345678901", NULL, 0, "BARCODE_PLANET (82)," },
/*127*/ { "MicroPDF417", "1", NULL, 0, "BARCODE_MICROPDF417 (84)," },
/*128*/ { "USPS IMail", "12345678901234567890", NULL, 0, "BARCODE_USPS_IMAIL (85)," },
/*129*/ { "OneCode", "12345678901234567890", NULL, 0, "BARCODE_USPS_IMAIL (85)," },
/*130*/ { "plessey", "1", NULL, 0, "BARCODE_PLESSEY (86)," },
/*131*/ { "telepen num", "1", NULL, 0, "BARCODE_TELEPEN_NUM (87)," },
/*132*/ { "ITF14", "1", NULL, 0, "BARCODE_ITF14 (89)," },
/*133*/ { "KIX", "1", NULL, 0, "BARCODE_KIX (90)," },
/*134*/ { "Aztec", "1", NULL, 0, "BARCODE_AZTEC (92)," },
/*135*/ { "Aztec Code", "1", NULL, 0, "BARCODE_AZTEC (92)," }, /* Synonym */
/*136*/ { "daft", "D", NULL, 0, "BARCODE_DAFT (93)," },
/*137*/ { "DPD", "0123456789012345678901234567", NULL, 0, "BARCODE_DPD (96)," },
/*138*/ { "Micro QR", "1", NULL, 0, "BARCODE_MICROQR (97)," },
/*139*/ { "Micro QR Code", "1", NULL, 0, "BARCODE_MICROQR (97)," },
/*140*/ { "hibc128", "1", NULL, 0, "BARCODE_HIBC_128 (98)," },
/*141*/ { "hibccode128", "1", NULL, 0, "BARCODE_HIBC_128 (98)," }, /* Synonym */
/*142*/ { "hibc39", "1", NULL, 0, "BARCODE_HIBC_39 (99)," },
/*143*/ { "hibccode39", "1", NULL, 0, "BARCODE_HIBC_39 (99)," }, /* Synonym */
/*144*/ { "hibcdatamatrix", "1", NULL, 0, "BARCODE_HIBC_DM (102)," }, /* Synonym */
/*145*/ { "hibcdm", "1", NULL, 0, "BARCODE_HIBC_DM (102)," },
/*146*/ { "HIBC qr", "1", NULL, 0, "BARCODE_HIBC_QR (104)," },
/*147*/ { "HIBC QR Code", "1", NULL, 0, "BARCODE_HIBC_QR (104)," }, /* Synonym */
/*148*/ { "HIBCPDF", "1", NULL, 0, "BARCODE_HIBC_PDF (106)," },
/*149*/ { "HIBCPDF417", "1", NULL, 0, "BARCODE_HIBC_PDF (106)," }, /* Synonym */
/*150*/ { "HIBCMICPDF", "1", NULL, 0, "BARCODE_HIBC_MICPDF (108)," },
/*151*/ { "HIBC Micro PDF", "1", NULL, 0, "BARCODE_HIBC_MICPDF (108)," }, /* Synonym */
/*152*/ { "HIBC Micro PDF417", "1", NULL, 0, "BARCODE_HIBC_MICPDF (108)," }, /* Synonym */
/*153*/ { "HIBC BlockF", "1", NULL, 0, "BARCODE_HIBC_BLOCKF (110)," },
/*154*/ { "HIBC CodaBlock-F", "1", NULL, 0, "BARCODE_HIBC_BLOCKF (110)," }, /* Synonym */
/*155*/ { "HIBC Aztec", "1", NULL, 0, "BARCODE_HIBC_AZTEC (112)," },
/*156*/ { "DotCode", "1", NULL, 0, "BARCODE_DOTCODE (115)," },
/*157*/ { "Han Xin", "1", NULL, 0, "BARCODE_HANXIN (116)," },
/*158*/ { "Mailmark", "01000000000000000AA00AA0A", NULL, 0, "BARCODE_MAILMARK_4S (121)," },
/*159*/ { "Mailmark 4-state", "01000000000000000AA00AA0A", NULL, 0, "BARCODE_MAILMARK_4S (121)," },
/*160*/ { "Mailmark 2D", "012100123412345678AB19XY1A 0", NULL, 0, "BARCODE_MAILMARK_2D (119)," },
/*161*/ { "azrune", "1", NULL, 0, "BARCODE_AZRUNE (128)," },
/*162*/ { "aztecrune", "1", NULL, 0, "BARCODE_AZRUNE (128)," }, /* Synonym */
/*163*/ { "aztecrunes", "1", NULL, 0, "BARCODE_AZRUNE (128)," }, /* Synonym */
/*164*/ { "code32", "1", NULL, 0, "BARCODE_CODE32 (129)," },
/*165*/ { "eanx cc", "[20]01", "1234567890128", 0, "BARCODE_EANX_CC (130)," },
/*166*/ { "eancc", "[20]01", "1234567890128", 0, "BARCODE_EANX_CC (130)," },
/*167*/ { "GS1 128 CC", "[01]12345678901231", "[20]01", 0, "BARCODE_GS1_128_CC (131)," },
/*168*/ { "EAN128 CC", "[01]12345678901231", "[20]01", 0, "BARCODE_GS1_128_CC (131)," },
/*169*/ { "dbaromncc", "[20]01", "1234567890123", 0, "BARCODE_DBAR_OMN_CC (132)," },
/*170*/ { "dbaromnicc", "[20]01", "1234567890123", 0, "BARCODE_DBAR_OMN_CC (132)," },
/*171*/ { "rss14 cc", "[20]01", "1234567890123", 0, "BARCODE_DBAR_OMN_CC (132)," },
/*172*/ { "databaromncc", "[20]01", "1234567890123", 0, "BARCODE_DBAR_OMN_CC (132)," },
/*173*/ { "databaromnicc", "[20]01", "1234567890123", 0, "BARCODE_DBAR_OMN_CC (132)," },
/*174*/ { "dbarltdcc", "[20]01", "1234567890123", 0, "BARCODE_DBAR_LTD_CC (133)," },
/*175*/ { "dbarlimitedcc", "[20]01", "1234567890123", 0, "BARCODE_DBAR_LTD_CC (133)," },
/*176*/ { "rss ltd cc", "[20]01", "1234567890123", 0, "BARCODE_DBAR_LTD_CC (133)," },
/*177*/ { "databarltdcc", "[20]01", "1234567890123", 0, "BARCODE_DBAR_LTD_CC (133)," },
/*178*/ { "databarlimitedcc", "[20]01", "1234567890123", 0, "BARCODE_DBAR_LTD_CC (133)," },
/*179*/ { "dbarexpcc", "[20]01", "[01]12345678901231", 0, "BARCODE_DBAR_EXP_CC (134)," },
/*180*/ { "rss exp cc", "[20]01", "[01]12345678901231", 0, "BARCODE_DBAR_EXP_CC (134)," },
/*181*/ { "databarexpcc", "[20]01", "[01]12345678901231", 0, "BARCODE_DBAR_EXP_CC (134)," },
/*182*/ { "databar expanded cc", "[20]01", "[01]12345678901231", 0, "BARCODE_DBAR_EXP_CC (134)," },
/*183*/ { "upcacc", "[20]01", "12345678901", 0, "BARCODE_UPCA_CC (135)," },
/*184*/ { "upcecc", "[20]01", "1234567", 0, "BARCODE_UPCE_CC (136)," },
/*185*/ { "dbar stk cc", "[20]01", "1234567890123", 0, "BARCODE_DBAR_STK_CC (137)," },
/*186*/ { "rss14stackcc", "[20]01", "1234567890123", 0, "BARCODE_DBAR_STK_CC (137)," },
/*187*/ { "databar stk cc", "[20]01", "1234567890123", 0, "BARCODE_DBAR_STK_CC (137)," },
/*188*/ { "databar stacked cc", "[20]01", "1234567890123", 0, "BARCODE_DBAR_STK_CC (137)," },
/*189*/ { "dbaromnstkcc", "[20]01", "1234567890123", 0, "BARCODE_DBAR_OMNSTK_CC (138)," },
/*190*/ { "BARCODE_RSS14_OMNI_CC", "[20]01", "1234567890123", 0, "BARCODE_DBAR_OMNSTK_CC (138)," },
/*191*/ { "databaromnstkcc", "[20]01", "1234567890123", 0, "BARCODE_DBAR_OMNSTK_CC (138)," },
/*192*/ { "databar stacked omncc", "[20]01", "1234567890123", 0, "BARCODE_DBAR_OMNSTK_CC (138)," },
/*193*/ { "databar stacked omni cc", "[20]01", "1234567890123", 0, "BARCODE_DBAR_OMNSTK_CC (138)," },
/*194*/ { "dbarexpstkcc", "[20]01", "[01]12345678901231", 0, "BARCODE_DBAR_EXPSTK_CC (139)," },
/*195*/ { "RSS EXPSTACK CC", "[20]01", "[01]12345678901231", 0, "BARCODE_DBAR_EXPSTK_CC (139)," },
/*196*/ { "databarexpstkcc", "[20]01", "[01]12345678901231", 0, "BARCODE_DBAR_EXPSTK_CC (139)," },
/*197*/ { "databar expanded stkcc", "[20]01", "[01]12345678901231", 0, "BARCODE_DBAR_EXPSTK_CC (139)," },
/*198*/ { "databar expanded stacked cc", "[20]01", "[01]12345678901231", 0, "BARCODE_DBAR_EXPSTK_CC (139)," },
/*199*/ { "Channel", "1", NULL, 0, "BARCODE_CHANNEL (140)," },
/*200*/ { "Channel Code", "1", NULL, 0, "BARCODE_CHANNEL (140)," },
/*201*/ { "CodeOne", "1", NULL, 0, "BARCODE_CODEONE (141)," },
/*202*/ { "Grid Matrix", "1", NULL, 0, "BARCODE_GRIDMATRIX (142)," },
/*203*/ { "UPN QR", "1", NULL, 0, "BARCODE_UPNQR (143)," },
/*204*/ { "UPN QR Code", "1", NULL, 0, "BARCODE_UPNQR (143)," }, /* Synonym */
/*205*/ { "ultra", "1", NULL, 0, "BARCODE_ULTRA (144)," },
/*206*/ { "ultracode", "1", NULL, 0, "BARCODE_ULTRA (144)," }, /* Synonym */
/*207*/ { "rMQR", "1", NULL, 0, "BARCODE_RMQR (145)," },
/*208*/ { "bc412", "1234567", NULL, 0, "BARCODE_BC412 (146)," },
/*209*/ { "x", "1", NULL, 1, "Error 119: Invalid barcode type 'x'" },
/*210*/ { "\177", "1", NULL, 1, "Error 119: Invalid barcode type '\177'" },
/* 7*/ { "Code 2 of 5 Standard", "1", NULL, 0, "BARCODE_C25STANDARD (2)," }, /* Synonym */
/* 8*/ { "Standard Code 2 of 5", "1", NULL, 0, "BARCODE_C25STANDARD (2)," }, /* Synonym */
/* 9*/ { "C25INTER", "1", NULL, 0, "BARCODE_C25INTER (3)," },
/* 10*/ { "interleaved code 2 of 5", "1", NULL, 0, "BARCODE_C25INTER (3)," }, /* Synonym */
/* 11*/ { "2of5datalogic", "1", NULL, 0, "BARCODE_C25LOGIC (6)," }, /* Synonym */
/* 12*/ { "ean8", "1", NULL, 0, "BARCODE_EAN8 (10)," },
/* 13*/ { "eanx", "1", NULL, 0, "BARCODE_EANX (13)," },
/* 14*/ { "ean", "1", NULL, 0, "BARCODE_EANX (13)," }, /* Synonym */
/* 15*/ { "eanx chk", "1", NULL, 0, "BARCODE_EANX_CHK (14)," },
/* 16*/ { "eanxchk", "1", NULL, 0, "BARCODE_EANX_CHK (14)," },
/* 17*/ { "ean13", "1", NULL, 0, "BARCODE_EAN13 (15)," },
/* 18*/ { "ean 128", "[01]12345678901231", NULL, 0, "BARCODE_GS1_128 (16)," }, /* Synonym */
/* 19*/ { "databar omn", "1", NULL, 0, "BARCODE_DBAR_OMN (29)," }, /* Synonym */
/* 20*/ { "databar omni", "1", NULL, 0, "BARCODE_DBAR_OMN (29)," }, /* Synonym */
/* 21*/ { "barcodeMailmark", "01000000000000000AA00AA0A", NULL, 0, "BARCODE_MAILMARK_4S (121)," }, /* Synonym */
/* 22*/ { "Mailmark 4s", "01000000000000000AA00AA0A", NULL, 0, "BARCODE_MAILMARK_4S (121)," }, /* Synonym */
/* 23*/ { "Mailmark 4-state", "01000000000000000AA00AA0A", NULL, 0, "BARCODE_MAILMARK_4S (121)," }, /* Synonym */
/* 24*/ { "Mailmark 2D", "012100123412345678AB19XY1A 0", NULL, 0, "BARCODE_MAILMARK_2D (119)," },
/* 25*/ { "v iN", "1FTCR10UXTPA78180", NULL, 0, "BARCODE_VIN (73)," },
/* 26*/ { "eanx cc", "[20]01", "1234567890128", 0, "BARCODE_EANX_CC (130)," },
/* 27*/ { "eancc", "[20]01", "1234567890128", 0, "BARCODE_EANX_CC (130)," }, /* Synonym */
/* 28*/ { "upcacc", "[20]01", "12345678901", 0, "BARCODE_UPCA_CC (135)," },
/* 29*/ { "upcecc", "[20]01", "1234567", 0, "BARCODE_UPCE_CC (136)," },
/* 30*/ { "x", "1", NULL, 1, "Error 119: Invalid barcode type 'x'" },
/* 31*/ { "\177", "1", NULL, 1, "Error 119: Invalid barcode type '\177'" },
};
int data_size = ARRAY_SIZE(data);
int i;
@@ -1158,6 +984,12 @@ static void test_barcode_symbology(const testCtx *const p_ctx) {
testFinish();
}
#ifdef ZINT_HAVE_GS1SE
#define TEST_OTHER_OPTS_GS1STRICT_ERROR "Error 267: AI (00): The numeric check digit is incorrect. (00)37610425002123456|8|"
#else
#define TEST_OTHER_OPTS_GS1STRICT_ERROR "Warning 261: AI (00) position 18: Bad checksum '8', expected '9'"
#endif
static void test_other_opts(const testCtx *const p_ctx) {
int debug = p_ctx->debug;
@@ -1173,71 +1005,74 @@ static void test_other_opts(const testCtx *const p_ctx) {
};
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
struct item data[] = {
/* 0*/ { BARCODE_CODE128, "1", -1, " --bg=", "EF9900", "", 0 },
/* 1*/ { BARCODE_CODE128, "1", -1, " -bg=", "EF9900", "", 0 },
/* 2*/ { BARCODE_CODE128, "1", -1, " --bg=", "EF9900AA", "", 0 },
/* 3*/ { BARCODE_CODE128, "1", -1, " --bg=", "GF9900", "Error 881: Malformed background RGB colour 'GF9900' (hexadecimal only)", 0 },
/* 4*/ { BARCODE_CODE128, "1", -1, " --bgcolor=", "EF9900", "", 0 },
/* 5*/ { BARCODE_CODE128, "1", -1, " --bgcolour=", "EF9900", "", 0 },
/* 6*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000", "", 0 },
/* 7*/ { BARCODE_CODE128, "1", -1, " --fg=", "00000000", "", 0 },
/* 8*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000F", "Error 880: Malformed foreground RGB colour (6 or 8 characters only)", 0 },
/* 9*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000FG", "Error 881: Malformed foreground RGB colour '000000FG' (hexadecimal only)", 0 },
/* 10*/ { BARCODE_CODE128, "1", -1, " --fg=", "0,0,0,100", "", 0 },
/* 11*/ { BARCODE_CODE128, "1", -1, " --fgcolor=", "111111", "", 0 },
/* 12*/ { BARCODE_CODE128, "1", -1, " --fgcolour=", "111111", "", 0 },
/* 13*/ { BARCODE_CODE128, "1", -1, " --compliantheight", "", "", 0 },
/* 14*/ { BARCODE_DATAMATRIX, "1", -1, " --dmiso144", "", "", 0 },
/* 15*/ { BARCODE_EANX, "123456", -1, " --guardwhitespace", "", "", 0 },
/* 16*/ { BARCODE_EANX, "123456", -1, " --embedfont", "", "", 0 },
/* 17*/ { BARCODE_CODE128, "1", -1, " --nobackground", "", "", 0 },
/* 18*/ { BARCODE_CODE128, "1", -1, " --noquietzones", "", "", 0 },
/* 19*/ { BARCODE_CODE128, "1", -1, " --notext", "", "", 0 },
/* 20*/ { BARCODE_CODE128, "1", -1, " --quietzones", "", "", 0 },
/* 21*/ { BARCODE_CODE128, "1", -1, " --reverse", "", "", 0 },
/* 22*/ { BARCODE_CODE128, "1", -1, " --werror", NULL, "", 0 },
/* 23*/ { 19, "1", -1, " --werror", NULL, "Error 207: Codabar 18 not supported", 0 },
/* 24*/ { BARCODE_GS1_128, "[01]12345678901231", -1, "", NULL, "", 0 },
/* 25*/ { BARCODE_GS1_128, "0112345678901231", -1, "", NULL, "Error 252: Data does not start with an AI", 0 },
/* 26*/ { BARCODE_GS1_128, "0112345678901231", -1, " --gs1nocheck", NULL, "Error 252: Data does not start with an AI", 0 },
/* 27*/ { BARCODE_GS1_128, "[00]376104250021234569", -1, "", NULL, "", 0 },
/* 28*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, "", NULL, "Warning 261: AI (00) position 18: Bad checksum '8', expected '9'", 0 },
/* 29*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, " --gs1nocheck", NULL, "", 0 },
/* 30*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, " --werror", NULL, "Error 261: AI (00) position 18: Bad checksum '8', expected '9'", 0 },
/* 31*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "1", "Error 155: Invalid Structured Append argument, expect \"index,count[,ID]\"", 0 },
/* 32*/ { BARCODE_AZTEC, "1", -1, " --structapp=", ",", "Error 156: Structured Append index too short", 0 },
/* 33*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "1234567890,", "Error 156: Structured Append index too long", 0 },
/* 34*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,", "Error 159: Structured Append count too short", 0 },
/* 35*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,1234567890", "Error 159: Structured Append count too long", 0 },
/* 36*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,", "Error 158: Structured Append ID too short", 0 },
/* 37*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,1234567890,", "Error 157: Structured Append count too long", 0 },
/* 38*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,123456789012345678901234567890123", "Error 158: Structured Append ID too long", 0 },
/* 39*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,12345678901234567890123456789012", "Error 701: Structured Append count '123456789' out of range (2 to 26)", 0 },
/* 40*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,26,12345678901234567890123456789012", "", 0 },
/* 41*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "A,26,12345678901234567890123456789012", "Error 160: Invalid Structured Append index (digits only)", 0 },
/* 42*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,A,12345678901234567890123456789012", "Error 161: Invalid Structured Append count (digits only)", 0 },
/* 43*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,1,12345678901234567890123456789012", "Error 162: Invalid Structured Append count '1', must be greater than or equal to 2", 0 },
/* 44*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "0,2,12345678901234567890123456789012", "Error 163: Structured Append index '0' out of range (1 to count '2')", 0 },
/* 45*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "3,2,12345678901234567890123456789012", "Error 163: Structured Append index '3' out of range (1 to count '2')", 0 },
/* 46*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "2,3,12345678901234567890123456789012", "", 0 },
/* 47*/ { BARCODE_PDF417, "1", -1, " --heightperrow", "", "", 0 },
/* 48*/ { -1, NULL, -1, " -v", NULL, "Zint version ", 1 },
/* 49*/ { -1, NULL, -1, " --version", NULL, "Zint version ", 1 },
/* 50*/ { -1, NULL, -1, " -h", NULL, "Encode input data in a barcode ", 1 },
/* 51*/ { -1, NULL, -1, " -e", NULL, "3: ISO/IEC 8859-1 ", 1 },
/* 52*/ { -1, NULL, -1, " -t", NULL, "1 CODE11 ", 1 },
/* 53*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "12345678", "Error 178: scalexdimdp X-dim invalid floating point (integer part must be 7 digits maximum)", 0 },
/* 54*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "1234567890123", "Error 176: scalexdimdp X-dim too long", 0 },
/* 55*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "123456.12", "Error 178: scalexdimdp X-dim invalid floating point (7 significant digits maximum)", 0 },
/* 56*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", ",12.34", "Error 174: scalexdimdp X-dim too short", 0 },
/* 57*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "12.34,", "Error 175: scalexdimdp resolution too short", 0 },
/* 58*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "12mm1", "Error 177: scalexdimdp X-dim units must occur at end", 0 },
/* 59*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "1inc", "Error 177: scalexdimdp X-dim units must occur at end", 0 },
/* 60*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "1234x", "Error 178: scalexdimdp X-dim invalid floating point (integer part must be digits only)", 0 },
/* 61*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "12.34in,123x", "Error 180: scalexdimdp resolution invalid floating point (integer part must be digits only)", 0 },
/* 62*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "12,123.45678", "Error 180: scalexdimdp resolution invalid floating point (7 significant digits maximum)", 0 },
/* 63*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "10.1,1000", "Warning 185: scalexdimdp X-dim '10.1' out of range (greater than 10), **IGNORED**", 0 },
/* 64*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "10,1000.1", "Warning 186: scalexdimdp resolution '1000.1' out of range (greater than 1000), **IGNORED**", 0 },
/* 0*/ { BARCODE_CODE128, "1", -1, " --test", "", "", 0 }, /* Do internal test */
/* 1*/ { BARCODE_CODE128, "1", -1, " --bg=", "EF9900", "", 0 },
/* 2*/ { BARCODE_CODE128, "1", -1, " -bg=", "EF9900", "", 0 },
/* 3*/ { BARCODE_CODE128, "1", -1, " --bg=", "EF9900AA", "", 0 },
/* 4*/ { BARCODE_CODE128, "1", -1, " --bg=", "GF9900", "Error 881: Malformed background RGB colour 'GF9900' (hexadecimal only)", 0 },
/* 5*/ { BARCODE_CODE128, "1", -1, " --bgcolor=", "EF9900", "", 0 },
/* 6*/ { BARCODE_CODE128, "1", -1, " --bgcolour=", "EF9900", "", 0 },
/* 7*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000", "", 0 },
/* 8*/ { BARCODE_CODE128, "1", -1, " --fg=", "00000000", "", 0 },
/* 9*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000F", "Error 880: Malformed foreground RGB colour (6 or 8 characters only)", 0 },
/* 10*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000FG", "Error 881: Malformed foreground RGB colour '000000FG' (hexadecimal only)", 0 },
/* 11*/ { BARCODE_CODE128, "1", -1, " --fg=", "0,0,0,100", "", 0 },
/* 12*/ { BARCODE_CODE128, "1", -1, " --fgcolor=", "111111", "", 0 },
/* 13*/ { BARCODE_CODE128, "1", -1, " --fgcolour=", "111111", "", 0 },
/* 14*/ { BARCODE_CODE128, "1", -1, " --compliantheight", "", "", 0 },
/* 15*/ { BARCODE_DATAMATRIX, "1", -1, " --dmiso144", "", "", 0 },
/* 16*/ { BARCODE_EANX, "123456", -1, " --guardwhitespace", "", "", 0 },
/* 17*/ { BARCODE_EANX, "123456", -1, " --embedfont", "", "", 0 },
/* 18*/ { BARCODE_CODE128, "1", -1, " --nobackground", "", "", 0 },
/* 19*/ { BARCODE_CODE128, "1", -1, " --noquietzones", "", "", 0 },
/* 20*/ { BARCODE_CODE128, "1", -1, " --notext", "", "", 0 },
/* 21*/ { BARCODE_CODE128, "1", -1, " --quietzones", "", "", 0 },
/* 22*/ { BARCODE_CODE128, "1", -1, " --reverse", "", "", 0 },
/* 23*/ { BARCODE_CODE128, "1", -1, " --werror", NULL, "", 0 },
/* 24*/ { 19, "1", -1, " --werror", NULL, "Error 207: Codabar 18 not supported", 0 },
/* 25*/ { BARCODE_GS1_128, "[01]12345678901231", -1, "", NULL, "", 0 },
/* 26*/ { BARCODE_GS1_128, "0112345678901231", -1, "", NULL, "Error 252: Data does not start with an AI", 0 },
/* 27*/ { BARCODE_GS1_128, "0112345678901231", -1, " --gs1nocheck", NULL, "Error 252: Data does not start with an AI", 0 },
/* 28*/ { BARCODE_GS1_128, "[00]376104250021234569", -1, "", NULL, "", 0 },
/* 29*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, "", NULL, "Warning 261: AI (00) position 18: Bad checksum '8', expected '9'", 0 },
/* 30*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, " --gs1nocheck", NULL, "", 0 },
/* 31*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, " --werror", NULL, "Error 261: AI (00) position 18: Bad checksum '8', expected '9'", 0 },
/* 32*/ { BARCODE_GS1_128, "[00]376104250021234569", -1, " --gs1strict", NULL, "", 0 },
/* 33*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, " --gs1strict", NULL, TEST_OTHER_OPTS_GS1STRICT_ERROR, 0 },
/* 34*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "1", "Error 155: Invalid Structured Append argument, expect \"index,count[,ID]\"", 0 },
/* 35*/ { BARCODE_AZTEC, "1", -1, " --structapp=", ",", "Error 156: Structured Append index too short", 0 },
/* 36*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "1234567890,", "Error 156: Structured Append index too long", 0 },
/* 37*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,", "Error 159: Structured Append count too short", 0 },
/* 38*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,1234567890", "Error 159: Structured Append count too long", 0 },
/* 39*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,", "Error 158: Structured Append ID too short", 0 },
/* 40*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,1234567890,", "Error 157: Structured Append count too long", 0 },
/* 41*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,123456789012345678901234567890123", "Error 158: Structured Append ID too long", 0 },
/* 42*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,12345678901234567890123456789012", "Error 701: Structured Append count '123456789' out of range (2 to 26)", 0 },
/* 43*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,26,12345678901234567890123456789012", "", 0 },
/* 44*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "A,26,12345678901234567890123456789012", "Error 160: Invalid Structured Append index (digits only)", 0 },
/* 45*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,A,12345678901234567890123456789012", "Error 161: Invalid Structured Append count (digits only)", 0 },
/* 46*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,1,12345678901234567890123456789012", "Error 162: Invalid Structured Append count '1', must be greater than or equal to 2", 0 },
/* 47*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "0,2,12345678901234567890123456789012", "Error 163: Structured Append index '0' out of range (1 to count '2')", 0 },
/* 48*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "3,2,12345678901234567890123456789012", "Error 163: Structured Append index '3' out of range (1 to count '2')", 0 },
/* 49*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "2,3,12345678901234567890123456789012", "", 0 },
/* 50*/ { BARCODE_PDF417, "1", -1, " --heightperrow", "", "", 0 },
/* 51*/ { -1, NULL, -1, " -v", NULL, "Zint version ", 1 },
/* 52*/ { -1, NULL, -1, " --version", NULL, "Zint version ", 1 },
/* 53*/ { -1, NULL, -1, " -h", NULL, "Encode input data in a barcode ", 1 },
/* 54*/ { -1, NULL, -1, " -e", NULL, "3: ISO/IEC 8859-1 ", 1 },
/* 55*/ { -1, NULL, -1, " -t", NULL, "1 CODE11 ", 1 },
/* 56*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "12345678", "Error 178: scalexdimdp X-dim invalid floating point (integer part must be 7 digits maximum)", 0 },
/* 57*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "1234567890123", "Error 176: scalexdimdp X-dim too long", 0 },
/* 58*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "123456.12", "Error 178: scalexdimdp X-dim invalid floating point (7 significant digits maximum)", 0 },
/* 59*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", ",12.34", "Error 174: scalexdimdp X-dim too short", 0 },
/* 60*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "12.34,", "Error 175: scalexdimdp resolution too short", 0 },
/* 61*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "12mm1", "Error 177: scalexdimdp X-dim units must occur at end", 0 },
/* 62*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "1inc", "Error 177: scalexdimdp X-dim units must occur at end", 0 },
/* 63*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "1234x", "Error 178: scalexdimdp X-dim invalid floating point (integer part must be digits only)", 0 },
/* 64*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "12.34in,123x", "Error 180: scalexdimdp resolution invalid floating point (integer part must be digits only)", 0 },
/* 65*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "12,123.45678", "Error 180: scalexdimdp resolution invalid floating point (7 significant digits maximum)", 0 },
/* 66*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "10.1,1000", "Warning 185: scalexdimdp X-dim '10.1' out of range (greater than 10), **IGNORED**", 0 },
/* 67*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "10,1000.1", "Warning 186: scalexdimdp resolution '1000.1' out of range (greater than 1000), **IGNORED**", 0 },
};
int data_size = ARRAY_SIZE(data);
int i;