1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-07-31 10:29:52 +00:00

AZTEC: add almost optimal encoding algorithm, previous algorithm

available via "--fast" (input_mode |= FAST_MODE) (ticket #347);
  add new option "--azfull" (option_3 = ZINT_AZTEC_FULL) to only
  consider Full symbols (not Compact ones) on automatic sizing
GUI: adjust Aztec tab to show feedback by selecting combos and
  shorten message to just actual ECC;
  grpCodabar min width
library: debug source input dump 200 -> 2000
common: some code fiddling (c -> ch, flg -> flag)
backend_tcl: add "-azfull" option & make capitalization of
  help more consistent
general: remove some trailing whitespace
manual: make Aztec ECCs more precise, i.e. ">=" rather than ">"
  (similarly in GUI)
CLI: code fiddling c -> opt
This commit is contained in:
gitlost
2026-02-02 14:20:10 +00:00
parent cf5ef9ec20
commit bcb3ceefe1
33 changed files with 4430 additions and 927 deletions
+34 -28
View File
@@ -1,7 +1,7 @@
/* main.c - Command line handling routines for Zint */
/*
libzint - the open source barcode library
Copyright (C) 2008-2025 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2008-2026 Robin Stuart <rstuart114@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -64,9 +64,9 @@ typedef char static_assert_int_at_least_32bits[sizeof(int) * CHAR_BIT < 32 ? -1
# define z_alloca(nmemb) alloca(nmemb)
#endif
#define z_isdigit(c) ((c) <= '9' && (c) >= '0')
#define z_isupper(c) ((c) >= 'A' && (c) <= 'Z')
#define z_islower(c) ((c) >= 'a' && (c) <= 'z')
#define z_isdigit(ch) ((ch) <= '9' && (ch) >= '0')
#define z_isupper(ch) ((ch) >= 'A' && (ch) <= 'Z')
#define z_islower(ch) ((ch) >= 'a' && (ch) <= 'z')
#define ZUCP(p) ((unsigned char *) (p))
#define ZCCP(p) ((const char *) (p))
@@ -170,30 +170,31 @@ static void usage(const int no_png, const int have_gs1syntaxengine) {
printf("Encode input data in a barcode and save as BMP/EMF/EPS/GIF/PCX%s/SVG/TIF/TXT\n\n", no_png_type);
fputs( " -b, --barcode=TYPE Number or name of barcode type. Default is 20 (CODE128)\n"
" --addongap=INTEGER Set add-on gap in multiples of X-dimension for EAN/UPC\n"
" --azfull Ignore Compact Aztec Codes on automatic size selection\n"
" --batch Treat each line of input file as a separate data set\n"
" --bg=COLOUR Specify a background colour (as RGB(A) or \"C,M,Y,K\")\n"
" --binary Treat input as raw binary data\n", stdout);
fputs( " --bind Add boundary bars\n"
" --bg=COLOUR Specify a background colour (as RGB(A) or \"C,M,Y,K\")\n", stdout);
fputs( " --binary Treat input as raw binary data\n"
" --bind Add boundary bars\n"
" --bindtop Add top boundary bar only\n"
" --bold Use bold text (HRT)\n"
" --border=INTEGER Set width of border in multiples of X-dimension\n"
" --box Add a box around the symbol\n", stdout);
fputs( " --cmyk Use CMYK colour space in EPS/TIF symbols\n"
" --border=INTEGER Set width of border in multiples of X-dimension\n", stdout);
fputs( " --box Add a box around the symbol\n"
" --cmyk Use CMYK colour space in EPS/TIF symbols\n"
" --cols=INTEGER Set the number of data columns in symbol\n"
" --compliantheight Warn if height not compliant, and use standard default\n"
" -d, --data=DATA Set the symbol data content (segment 0)\n"
" --direct Send output to stdout\n", stdout);
fputs( " --dmiso144 Use ISO format for 144x144 Data Matrix symbols\n"
" -d, --data=DATA Set the symbol data content (segment 0)\n", stdout);
fputs( " --direct Send output to stdout\n"
" --dmiso144 Use ISO format for 144x144 Data Matrix symbols\n"
" --dmre Allow Data Matrix Rectangular Extended\n"
" --dotsize=NUMBER Set radius of dots in dotty mode\n"
" --dotty Use dots instead of squares for matrix symbols\n"
" --dump Dump hexadecimal representation to stdout\n", stdout);
fputs( " -e, --ecinos Display ECI (Extended Channel Interpretation) table\n"
" --dotty Use dots instead of squares for matrix symbols\n", stdout);
fputs( " --dump Dump hexadecimal representation to stdout\n"
" -e, --ecinos Display ECI (Extended Channel Interpretation) table\n"
" --eci=INTEGER Set the ECI code for the data (segment 0)\n"
" --embedfont Embed font in vector output (SVG only)\n"
" --esc Process escape sequences in input data\n"
" --extraesc Process symbology-specific escape sequences (Code 128)\n", stdout);
fputs( " --fast Use faster encodation or other shortcuts if available\n"
" --esc Process escape sequences in input data\n", stdout);
fputs( " --extraesc Process symbology-specific escape sequences (Code 128)\n"
" --fast Use faster encodation or other shortcuts if available\n"
" --fg=COLOUR Specify a foreground colour (as RGB(A) or \"C,M,Y,K\")\n", stdout);
printf(" --filetype=TYPE Set output file type BMP/EMF/EPS/GIF/PCX%s/SVG/TIF/TXT\n", no_png_type);
fputs( " --fullmultibyte Use multibyte for binary/Latin (QR/Han Xin/Grid Matrix)\n"
@@ -1539,7 +1540,8 @@ int main(int argc, char **argv) {
opterr = 0; /* Disable `getopt_long_only()` printing errors */
while (1) {
enum options {
OPT_ADDONGAP = 128, OPT_BATCH, OPT_BINARY, OPT_BG, OPT_BIND, OPT_BIND_TOP, OPT_BOLD, OPT_BORDER, OPT_BOX,
OPT_ADDONGAP = 128, OPT_AZFULL,
OPT_BATCH, OPT_BINARY, OPT_BG, OPT_BIND, OPT_BIND_TOP, OPT_BOLD, OPT_BORDER, OPT_BOX,
OPT_CMYK, OPT_COLS, OPT_COMPLIANTHEIGHT,
OPT_DIRECT, OPT_DMISO144, OPT_DMRE, OPT_DOTSIZE, OPT_DOTTY, OPT_DUMP,
OPT_ECI, OPT_EMBEDFONT, OPT_ESC, OPT_EXTRAESC, OPT_FAST, OPT_FG, OPT_FILETYPE, OPT_FULLMULTIBYTE,
@@ -1557,6 +1559,7 @@ int main(int argc, char **argv) {
};
static const struct option long_options[] = {
{"addongap", 1, NULL, OPT_ADDONGAP},
{"azfull", 0, NULL, OPT_AZFULL},
{"barcode", 1, NULL, 'b'},
{"batch", 0, NULL, OPT_BATCH},
{"binary", 0, NULL, OPT_BINARY},
@@ -1643,10 +1646,10 @@ int main(int argc, char **argv) {
{"whitesp", 1, NULL, 'w'},
{NULL, 0, NULL, 0}
};
const int c = getopt_long_only(argc, argv, "b:d:ehi:o:rtvw:", long_options, NULL);
if (c == -1) break;
const int opt = getopt_long_only(argc, argv, "b:d:ehi:o:rtvw:", long_options, NULL);
if (opt == -1) break;
switch (c) {
switch (opt) {
case OPT_ADDONGAP:
if (!validate_int(optarg, -1 /*len*/, &val)) {
fprintf(stderr, "Error 139: Invalid add-on gap value (digits only)\n");
@@ -1660,6 +1663,9 @@ int main(int argc, char **argv) {
warn_number = ZINT_WARN_INVALID_OPTION;
}
break;
case OPT_AZFULL:
my_symbol->option_3 = ZINT_AZTEC_FULL | (my_symbol->option_3 & ~0xFF);
break;
case OPT_BATCH:
if (data_cnt == 0) {
/* Switch to batch processing mode */
@@ -2010,12 +2016,12 @@ int main(int argc, char **argv) {
case OPT_SEG8:
case OPT_SEG9:
if (batch_mode == 0) {
val = c - OPT_SEG1 + 1; /* Segment number */
val = opt - OPT_SEG1 + 1; /* Segment number */
if (segs[val].source) {
fprintf(stderr, "Error 164: Duplicate segment %d\n", val);
return do_exit(ZINT_ERROR_INVALID_OPTION);
}
if (!validate_seg(optarg, c - OPT_SEG1 + 1, segs, errbuf)) {
if (!validate_seg(optarg, opt - OPT_SEG1 + 1, segs, errbuf)) {
fprintf(stderr, "Error 166: %s\n", errbuf);
return do_exit(ZINT_ERROR_INVALID_OPTION);
}
@@ -2160,7 +2166,7 @@ int main(int argc, char **argv) {
case 'd': /* we have some data! */
if (batch_mode == 0) {
arg_opts[data_arg_num].arg = optarg;
arg_opts[data_arg_num].opt = c;
arg_opts[data_arg_num].opt = opt;
data_arg_num++;
data_cnt++;
} else {
@@ -2173,7 +2179,7 @@ int main(int argc, char **argv) {
case 'i': /* Take data from file */
if (batch_mode == 0 || input_cnt == 0) {
arg_opts[data_arg_num].arg = optarg;
arg_opts[data_arg_num].opt = c;
arg_opts[data_arg_num].opt = opt;
data_arg_num++;
input_cnt++;
} else {
@@ -2219,7 +2225,7 @@ int main(int argc, char **argv) {
break;
default: /* Shouldn't happen */
fprintf(stderr, "Error 123: ?? getopt error 0%o\n", c); /* Not reached */
fprintf(stderr, "Error 123: ?? getopt error 0%o\n", opt); /* Not reached */
return do_exit(ZINT_ERROR_ENCODING_PROBLEM);
break;
}
+67 -66
View File
@@ -1,6 +1,6 @@
/*
libzint - the open source barcode library
Copyright (C) 2020-2025 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2020-2026 Robin Stuart <rstuart114@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -1006,71 +1006,72 @@ 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, " --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 155: Structured Append index too short", 0 },
/* 36*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "1234567890,", "Error 155: Structured Append index too long", 0 },
/* 37*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,", "Error 155: Structured Append count too short", 0 },
/* 38*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,1234567890", "Error 155: Structured Append count too long", 0 },
/* 39*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,", "Error 155: Structured Append ID too short", 0 },
/* 40*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,123456789012345678901234567890123", "Error 155: Structured Append ID too long", 0 },
/* 41*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,12345678901234567890123456789012", "Error 701: Structured Append count '123456789' out of range (2 to 26)", 0 },
/* 42*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,26,12345678901234567890123456789012", "", 0 },
/* 43*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "A,26,12345678901234567890123456789012", "Error 155: Invalid Structured Append index (digits only)", 0 },
/* 44*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,A,12345678901234567890123456789012", "Error 155: Invalid Structured Append count (digits only)", 0 },
/* 45*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,1,12345678901234567890123456789012", "Error 155: Invalid Structured Append count '1', must be greater than or equal to 2", 0 },
/* 46*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "0,2,12345678901234567890123456789012", "Error 155: Structured Append index '0' out of range (1 to count '2')", 0 },
/* 47*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "3,2,12345678901234567890123456789012", "Error 155: Structured Append index '3' out of range (1 to count '2')", 0 },
/* 48*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "2,3,12345678901234567890123456789012", "", 0 },
/* 49*/ { BARCODE_PDF417, "1", -1, " --heightperrow", "", "", 0 },
/* 50*/ { -1, NULL, -1, " -v", NULL, "Zint version ", 1 },
/* 51*/ { -1, NULL, -1, " --version", NULL, "Zint version ", 1 },
/* 52*/ { -1, NULL, -1, " -h", NULL, "Encode input data in a barcode ", 1 },
/* 53*/ { -1, NULL, -1, " -e", NULL, "3: ISO/IEC 8859-1 ", 1 },
/* 54*/ { -1, NULL, -1, " -t", NULL, "1 CODE11 ", 1 },
/* 55*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "12345678", "Error 184: scalexdimdp X-dim invalid floating point: integer part must be 7 digits maximum", 0 },
/* 56*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "1234567890123", "Error 184: scalexdimdp X-dim too long", 0 },
/* 57*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "123456.12", "Error 184: scalexdimdp X-dim invalid floating point: 7 significant digits maximum", 0 },
/* 58*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", ",12.34", "Error 184: scalexdimdp X-dim too short", 0 },
/* 59*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "12.34,", "Error 184: scalexdimdp resolution too short", 0 },
/* 60*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "12mm1", "Error 184: scalexdimdp X-dim unknown units: mm1", 0 },
/* 61*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "1inc", "Error 184: scalexdimdp X-dim unknown units: inc", 0 },
/* 62*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "12.34in,123x", "Error 184: scalexdimdp resolution unknown units: x", 0 },
/* 63*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "12,123.45678", "Error 184: scalexdimdp resolution invalid floating point: 7 significant digits maximum", 0 },
/* 64*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "10.1,1000", "Warning 185: scalexdimdp X-dim '10.1' out of range (greater than 10), **IGNORED**", 0 },
/* 65*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "10,1000.1", "Warning 186: scalexdimdp resolution '1000.1' out of range (greater than 1000), **IGNORED**", 0 },
/* 1*/ { BARCODE_AZTEC, "1", -1, " --azfull", "", "", 0 },
/* 2*/ { BARCODE_CODE128, "1", -1, " --bg=", "EF9900", "", 0 },
/* 3*/ { BARCODE_CODE128, "1", -1, " -bg=", "EF9900", "", 0 },
/* 4*/ { BARCODE_CODE128, "1", -1, " --bg=", "EF9900AA", "", 0 },
/* 5*/ { BARCODE_CODE128, "1", -1, " --bg=", "GF9900", "Error 881: Malformed background RGB colour 'GF9900' (hexadecimal only)", 0 },
/* 6*/ { BARCODE_CODE128, "1", -1, " --bgcolor=", "EF9900", "", 0 },
/* 7*/ { BARCODE_CODE128, "1", -1, " --bgcolour=", "EF9900", "", 0 },
/* 8*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000", "", 0 },
/* 9*/ { BARCODE_CODE128, "1", -1, " --fg=", "00000000", "", 0 },
/* 10*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000F", "Error 880: Malformed foreground RGB colour (6 or 8 characters only)", 0 },
/* 11*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000FG", "Error 881: Malformed foreground RGB colour '000000FG' (hexadecimal only)", 0 },
/* 12*/ { BARCODE_CODE128, "1", -1, " --fg=", "0,0,0,100", "", 0 },
/* 13*/ { BARCODE_CODE128, "1", -1, " --fgcolor=", "111111", "", 0 },
/* 14*/ { BARCODE_CODE128, "1", -1, " --fgcolour=", "111111", "", 0 },
/* 15*/ { BARCODE_CODE128, "1", -1, " --compliantheight", "", "", 0 },
/* 16*/ { BARCODE_DATAMATRIX, "1", -1, " --dmiso144", "", "", 0 },
/* 17*/ { BARCODE_EANX, "123456", -1, " --guardwhitespace", "", "", 0 },
/* 18*/ { BARCODE_EANX, "123456", -1, " --embedfont", "", "", 0 },
/* 19*/ { BARCODE_CODE128, "1", -1, " --nobackground", "", "", 0 },
/* 20*/ { BARCODE_CODE128, "1", -1, " --noquietzones", "", "", 0 },
/* 21*/ { BARCODE_CODE128, "1", -1, " --notext", "", "", 0 },
/* 22*/ { BARCODE_CODE128, "1", -1, " --quietzones", "", "", 0 },
/* 23*/ { BARCODE_CODE128, "1", -1, " --reverse", "", "", 0 },
/* 24*/ { BARCODE_CODE128, "1", -1, " --werror", NULL, "", 0 },
/* 25*/ { 19, "1", -1, " --werror", NULL, "Error 207: Codabar 18 not supported", 0 },
/* 26*/ { BARCODE_GS1_128, "[01]12345678901231", -1, "", NULL, "", 0 },
/* 27*/ { BARCODE_GS1_128, "0112345678901231", -1, "", NULL, "Error 252: Data does not start with an AI", 0 },
/* 28*/ { BARCODE_GS1_128, "0112345678901231", -1, " --gs1nocheck", NULL, "Error 252: Data does not start with an AI", 0 },
/* 29*/ { BARCODE_GS1_128, "[00]376104250021234569", -1, "", NULL, "", 0 },
/* 30*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, "", NULL, "Warning 261: AI (00) position 18: Bad checksum '8', expected '9'", 0 },
/* 31*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, " --gs1nocheck", NULL, "", 0 },
/* 32*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, " --werror", NULL, "Error 261: AI (00) position 18: Bad checksum '8', expected '9'", 0 },
/* 33*/ { BARCODE_GS1_128, "[00]376104250021234569", -1, " --gs1strict", NULL, "", 0 },
/* 34*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, " --gs1strict", NULL, TEST_OTHER_OPTS_GS1STRICT_ERROR, 0 },
/* 35*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "1", "Error 155: Invalid Structured Append argument, expect \"index,count[,ID]\"", 0 },
/* 36*/ { BARCODE_AZTEC, "1", -1, " --structapp=", ",", "Error 155: Structured Append index too short", 0 },
/* 37*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "1234567890,", "Error 155: Structured Append index too long", 0 },
/* 38*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,", "Error 155: Structured Append count too short", 0 },
/* 39*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,1234567890", "Error 155: Structured Append count too long", 0 },
/* 40*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,", "Error 155: Structured Append ID too short", 0 },
/* 41*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,123456789012345678901234567890123", "Error 155: 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 155: Invalid Structured Append index (digits only)", 0 },
/* 45*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,A,12345678901234567890123456789012", "Error 155: Invalid Structured Append count (digits only)", 0 },
/* 46*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,1,12345678901234567890123456789012", "Error 155: Invalid Structured Append count '1', must be greater than or equal to 2", 0 },
/* 47*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "0,2,12345678901234567890123456789012", "Error 155: Structured Append index '0' out of range (1 to count '2')", 0 },
/* 48*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "3,2,12345678901234567890123456789012", "Error 155: 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 184: scalexdimdp X-dim invalid floating point: integer part must be 7 digits maximum", 0 },
/* 57*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "1234567890123", "Error 184: scalexdimdp X-dim too long", 0 },
/* 58*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "123456.12", "Error 184: scalexdimdp X-dim invalid floating point: 7 significant digits maximum", 0 },
/* 59*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", ",12.34", "Error 184: scalexdimdp X-dim too short", 0 },
/* 60*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "12.34,", "Error 184: scalexdimdp resolution too short", 0 },
/* 61*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "12mm1", "Error 184: scalexdimdp X-dim unknown units: mm1", 0 },
/* 62*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "1inc", "Error 184: scalexdimdp X-dim unknown units: inc", 0 },
/* 63*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "12.34in,123x", "Error 184: scalexdimdp resolution unknown units: x", 0 },
/* 64*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "12,123.45678", "Error 184: scalexdimdp resolution invalid floating point: 7 significant digits maximum", 0 },
/* 65*/ { BARCODE_EANX, "501234567890", -1, " --scalexdimdp=", "10.1,1000", "Warning 185: scalexdimdp X-dim '10.1' out of range (greater than 10), **IGNORED**", 0 },
/* 66*/ { 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;