composite: fix buffer overflow for large linear, small composite (500 -> 1000)

composite: clear errtxt when bumping from CC-A -> CC-B -> CC-C
composite: CC-C adjustment 53 -> 52 (same as BWIPP) with proper explanation
composite: remove unneeded > 11805 length check
CODEONE: remove unneeded extended ASCII check in C40 count
GS1_128/CODE16K: remove unneeded initial GS1 mode '[' check
PDF417: remove unneeded second option_2 > 30 check
Document some "Not reached" lines (code coverage)
Update bwipp_dump.ps
GUI: window/tab height +5 so 2 full lines for composite edit box (Ubuntu)
manual: dash -> hyphen, PDF417 "check digit" -> "error correction", DMRE ref
tests: further test cases for CODEONE/CODE16K/common/composite/DATAMATRIX/
DOTCODE/gs1/MAXICODE/PDF417/postal/QRCODE
This commit is contained in:
gitlost 2021-08-05 16:34:45 +01:00
parent f0bfb8d920
commit b015e38da0
28 changed files with 3610 additions and 2019 deletions

View file

@ -45,7 +45,8 @@ static void test_large(int index, int debug) {
/* 1*/ { 200, '0', 2941, ZINT_ERROR_INVALID_OPTION },
/* 2*/ { 200, '9', 200, 0 }, // Changes a number of mask scores re pre-Rev. 4 version, but best score still the same (7)
/* 3*/ { 201, '0', 2940, ZINT_ERROR_INVALID_OPTION },
/* 4*/ { 30, '\001', 71, 0 }, // Codeword length 72, ECC length 39, for ND + 1 == 112
/* 4*/ { 201, '0', 2974, ZINT_ERROR_INVALID_OPTION }, // Height > 200 also
/* 5*/ { 30, '\001', 71, 0 }, // Codeword length 72, ECC length 39, for ND + 1 == 112
};
int data_size = ARRAY_SIZE(data);
int i, length, ret;
@ -81,6 +82,7 @@ static void test_options(int index, int debug) {
int input_mode;
int output_options;
int option_2;
int option_3;
char *data;
int ret;
@ -89,16 +91,17 @@ static void test_options(int index, int debug) {
};
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
struct item data[] = {
/* 0*/ { -1, -1, -1, "1", 0, 9, 14 },
/* 1*/ { -1, -1, -1, "1234567890", 0, 12, 19 },
/* 2*/ { -1, -1, 19, "1234567890", 0, 12, 19 },
/* 3*/ { -1, -1, 12, "1234567890", 0, 19, 12 },
/* 4*/ { -1, -1, 5, "1234567890", 0, 44, 5 },
/* 5*/ { -1, -1, 4, "1234567890", ZINT_ERROR_INVALID_OPTION, -1, -1 }, // Cols < 5
/* 6*/ { -1, -1, 200, "1234567890", ZINT_ERROR_INVALID_OPTION, -1, -1 }, // Not enough data - height 3 too small
/* 7*/ { -1, -1, 200, "1234567890123456789012345678901234567890", 0, 5, 200 }, // Cols 200 max
/* 8*/ { -1, -1, 200, "12345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, 7, 200 },
/* 9*/ { -1, -1, 201, "12345678901234567890123456789012345678901234567890123456789012345678901234567890", ZINT_ERROR_INVALID_OPTION, -1, -1 },
/* 0*/ { -1, -1, -1, -1, "1", 0, 9, 14 },
/* 1*/ { -1, -1, -1, -1, "1234567890", 0, 12, 19 },
/* 2*/ { -1, -1, 19, -1, "1234567890", 0, 12, 19 },
/* 3*/ { -1, -1, 12, -1, "1234567890", 0, 19, 12 },
/* 4*/ { -1, -1, 5, -1, "1234567890", 0, 44, 5 },
/* 5*/ { -1, -1, 4, -1, "1234567890", ZINT_ERROR_INVALID_OPTION, -1, -1 }, // Cols < 5
/* 6*/ { -1, -1, 200, -1, "1234567890", ZINT_ERROR_INVALID_OPTION, -1, -1 }, // Not enough data - height 3 too small
/* 7*/ { -1, -1, 200, -1, "1234567890123456789012345678901234567890", 0, 5, 200 }, // Cols 200 max
/* 8*/ { -1, -1, 200, -1, "12345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, 7, 200 },
/* 9*/ { -1, -1, 201, -1, "12345678901234567890123456789012345678901234567890123456789012345678901234567890", ZINT_ERROR_INVALID_OPTION, -1, -1 },
/* 10*/ { -1, -1, -1, 10 << 8, "1", 0, 9, 14 }, // Mask > 8 + 1 ignored
};
int data_size = ARRAY_SIZE(data);
int i, length, ret;
@ -113,7 +116,7 @@ static void test_options(int index, int debug) {
symbol = ZBarcode_Create();
assert_nonnull(symbol, "Symbol not created\n");
length = testUtilSetSymbol(symbol, BARCODE_DOTCODE, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, data[i].output_options, data[i].data, -1, debug);
length = testUtilSetSymbol(symbol, BARCODE_DOTCODE, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, data[i].option_3, data[i].output_options, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
@ -148,36 +151,37 @@ static void test_input(int index, int generate, int debug) {
/* 4*/ { UNICODE_MODE, 899, "A", -1, 0, "6C 28 07 44 66 21", "" },
/* 5*/ { UNICODE_MODE, 12769, "A", -1, 0, "6C 28 70 49 66 21", "" },
/* 6*/ { UNICODE_MODE, 811799, "A", -1, 0, "6C 67 40 50 66 21", "" },
/* 7*/ { UNICODE_MODE, -1, "\000", 1, 0, "65 40", "LatchA (0x65) NUL" },
/* 8*/ { UNICODE_MODE, -1, "\010", -1, 0, "65 48", "LatchA (0x65) BS" },
/* 9*/ { UNICODE_MODE, -1, "\011", -1, 0, "65 49", "Lead special; LatchA (0x65) HT" },
/* 10*/ { UNICODE_MODE, -1, "\034", -1, 0, "65 5C", "Lead special; LatchA (0x65) FS" },
/* 11*/ { UNICODE_MODE, -1, "\035", -1, 0, "65 5D", "Lead special; LatchA (0x65) GS" },
/* 12*/ { UNICODE_MODE, -1, "\036", -1, 0, "65 5E", "Lead special; LatchA (0x65) RS" },
/* 13*/ { UNICODE_MODE, -1, "\037", -1, 0, "65 5F", "LatchA (0x65) US" },
/* 14*/ { UNICODE_MODE, -1, "\177", -1, 0, "66 5F", "ShiftB (0x66) DEL" },
/* 15*/ { UNICODE_MODE, -1, "[)>\03605\035A\036\004", -1, 0, "6A 61 21", "[)>RS 05 GS A RS EOT; LatchB (0x6A) Macro97 (0x61) A" },
/* 16*/ { UNICODE_MODE, -1, "[)>\03606\035\011\034\035\036\036\004", -1, 0, "6A 62 61 62 63 64", "[)>RS 06 GS HT FS GS RS RS EOT; LatchB (0x6A) Macro98 (0x62) HT FS GS RS" },
/* 17*/ { UNICODE_MODE, -1, "[)>\03612\03512345\036\004", -1, 0, "6A 63 11 67 17 2D", "[)>RS 12 GS A RS EOT; LatchB (0x6A) Macro99 (0x63) 1 2xShiftC (0x67) 23 45" },
/* 18*/ { UNICODE_MODE, -1, "[)>\03601Blah\004", -1, 0, "6A 64 10 11 22 4C 41 48", "[)>RS 01 Blah EOT; LatchB (0x6A) Macro100 (0x64) 0 1 B l a h" },
/* 19*/ { UNICODE_MODE, -1, "[)>\03605\035A\004", -1, 0, "6A 64 10 15 63 21", "[)>RS 05 GS A EOT; LatchB (0x6A) Macro100 (0x64) 0 5 HT A" },
/* 20*/ { UNICODE_MODE, -1, "[)>\03606A\004", -1, 0, "6A 64 10 16 21", "[)>RS 06 A EOT; LatchB (0x6A) Macro100 (0x64) 0 6 A" },
/* 21*/ { UNICODE_MODE, -1, "[)>\036991\036\004", -1, 0, "6A 64 19 19 11 64", "[)>RS 99 1 RS EOT; LatchB (0x6A) Macro100 (0x64) 9 9 1 RS" },
/* 22*/ { UNICODE_MODE, -1, "1712345610", -1, 0, "6B 64 0C 22 38", "FNC1 (0x6B) 17..10 12 34 56" },
/* 23*/ { GS1_MODE, -1, "[17]123456[10]123", -1, ZINT_WARN_NONCOMPLIANT, "64 0C 22 38 0C 66 13", "17..10 12 34 56 12 ShiftB (0x66) 3" },
/* 24*/ { GS1_MODE, -1, "[90]ABC[90]abc[90]123", -1, 0, "5A 6A 21 22 23 6B 19 10 41 42 43 6B 19 67 01 17", "90 LatchB (0x6A) A B C FNC1 (0x6B) 9 0 a b c FNC1 (0x6B) 9 2xShitfC (0x67) 01 23" },
/* 25*/ { GS1_MODE | GS1PARENS_MODE, -1, "(90)ABC(90)abc(90)123", -1, 0, "5A 6A 21 22 23 6B 19 10 41 42 43 6B 19 67 01 17", "90 LatchB (0x6A) A B C FNC1 (0x6B) 9 0 a b c FNC1 (0x6B) 9 2xShitfC (0x67) 01 23" },
/* 26*/ { UNICODE_MODE, -1, "99aA[{00\000", 9, 0, "6B 63 6A 41 21 3B 5B 10 10 65 40", "FNC1 (0x6B) 99 LatchB (0x6A) a A [ { 0 0 ShiftA (0x65) NUL" },
/* 27*/ { UNICODE_MODE, -1, "\015\012", -1, 0, "66 60", "ShiftB (0x66) CR/LF" },
/* 28*/ { UNICODE_MODE, -1, "A\015\012", -1, 0, "67 21 60", "2xShiftB (0x67) A CR/LF" },
/* 29*/ { UNICODE_MODE, -1, "\015\015\012", -1, 0, "65 4D 4D 4A", "LatchA (0x65) CR CR LF" },
/* 30*/ { UNICODE_MODE, -1, "ABCDE12345678", -1, 0, "6A 21 22 23 24 25 69 0C 22 38 4E", "LatchB (0x6A) A B C D 4xShiftC 12 34 56 78" },
/* 31*/ { UNICODE_MODE, -1, "\000ABCD1234567890", 15, 0, "65 40 21 22 23 24 6A 0C 22 38 4E 5A", "LatchA (0x65) NULL A B C D LatchC (0x6A) 12 34 56 78 90" },
/* 32*/ { DATA_MODE, -1, "\141\142\143\144\145\200\201\202\203\204\377", -1, 0, "6A 41 42 43 44 45 70 31 5A 35 21 5A 5F 02 31", "LatchB (0x6A) a b c d e BinaryLatch (0x70) 0x80 0x81 0x82 0x83 0x84 0xFF" },
/* 33*/ { DATA_MODE, -1, "\200\061\062\240\063\064\201\202\065\066", -1, 0, "6E 40 0C 6F 00 22 70 03 10 42 6E 15 16", "UpperShiftA (0x6E) NUL 12 UpperShiftB (0x6F) SP 34 BinaryLatch (0x70) 0x81 0x82 TermB (0x6E) 5 6" },
/* 34*/ { DATA_MODE, -1, "\200\201\202\203\061\062\063\064", -1, 0, "70 13 56 0A 59 2C 67 0C 22", "BinaryLatch (0x70) 0x80 0x81 0x82 0x83 Intr2xShiftC (0x67) 12 3" },
/* 35*/ { DATA_MODE, -1, "\001\200\201\202\203\204\200\201\202\203\204", -1, 0, "65 41 70 31 5A 35 21 5A 5F 31 5A 35 21 5A 5F", "LatchA (0x65) SOH BinaryLatch (0x70) 0x80 0x81 0x82 0x83 0x80 0x81 0x82 0x83" },
/* 36*/ { UNICODE_MODE, -1, "\001abc\011\015\012\036", -1, 0, "65 41 65 41 42 43 61 60 64", "LatchA (0x65) SOH 6xShiftB (0x65) a b c HT CR/LF RS" },
/* 7*/ { UNICODE_MODE, 811800, "A", -1, ZINT_ERROR_INVALID_OPTION, "", "" },
/* 8*/ { UNICODE_MODE, -1, "\000", 1, 0, "65 40", "LatchA (0x65) NUL" },
/* 9*/ { UNICODE_MODE, -1, "\010", -1, 0, "65 48", "LatchA (0x65) BS" },
/* 10*/ { UNICODE_MODE, -1, "\011", -1, 0, "65 49", "Lead special; LatchA (0x65) HT" },
/* 11*/ { UNICODE_MODE, -1, "\034", -1, 0, "65 5C", "Lead special; LatchA (0x65) FS" },
/* 12*/ { UNICODE_MODE, -1, "\035", -1, 0, "65 5D", "Lead special; LatchA (0x65) GS" },
/* 13*/ { UNICODE_MODE, -1, "\036", -1, 0, "65 5E", "Lead special; LatchA (0x65) RS" },
/* 14*/ { UNICODE_MODE, -1, "\037", -1, 0, "65 5F", "LatchA (0x65) US" },
/* 15*/ { UNICODE_MODE, -1, "\177", -1, 0, "66 5F", "ShiftB (0x66) DEL" },
/* 16*/ { UNICODE_MODE, -1, "[)>\03605\035A\036\004", -1, 0, "6A 61 21", "[)>RS 05 GS A RS EOT; LatchB (0x6A) Macro97 (0x61) A" },
/* 17*/ { UNICODE_MODE, -1, "[)>\03606\035\011\034\035\036\036\004", -1, 0, "6A 62 61 62 63 64", "[)>RS 06 GS HT FS GS RS RS EOT; LatchB (0x6A) Macro98 (0x62) HT FS GS RS" },
/* 18*/ { UNICODE_MODE, -1, "[)>\03612\03512345\036\004", -1, 0, "6A 63 11 67 17 2D", "[)>RS 12 GS A RS EOT; LatchB (0x6A) Macro99 (0x63) 1 2xShiftC (0x67) 23 45" },
/* 19*/ { UNICODE_MODE, -1, "[)>\03601Blah\004", -1, 0, "6A 64 10 11 22 4C 41 48", "[)>RS 01 Blah EOT; LatchB (0x6A) Macro100 (0x64) 0 1 B l a h" },
/* 20*/ { UNICODE_MODE, -1, "[)>\03605\035A\004", -1, 0, "6A 64 10 15 63 21", "[)>RS 05 GS A EOT; LatchB (0x6A) Macro100 (0x64) 0 5 HT A" },
/* 21*/ { UNICODE_MODE, -1, "[)>\03606A\004", -1, 0, "6A 64 10 16 21", "[)>RS 06 A EOT; LatchB (0x6A) Macro100 (0x64) 0 6 A" },
/* 22*/ { UNICODE_MODE, -1, "[)>\036991\036\004", -1, 0, "6A 64 19 19 11 64", "[)>RS 99 1 RS EOT; LatchB (0x6A) Macro100 (0x64) 9 9 1 RS" },
/* 23*/ { UNICODE_MODE, -1, "1712345610", -1, 0, "6B 64 0C 22 38", "FNC1 (0x6B) 17..10 12 34 56" },
/* 24*/ { GS1_MODE, -1, "[17]123456[10]123", -1, ZINT_WARN_NONCOMPLIANT, "64 0C 22 38 0C 66 13", "17..10 12 34 56 12 ShiftB (0x66) 3" },
/* 25*/ { GS1_MODE, -1, "[90]ABC[90]abc[90]123", -1, 0, "5A 6A 21 22 23 6B 19 10 41 42 43 6B 19 67 01 17", "90 LatchB (0x6A) A B C FNC1 (0x6B) 9 0 a b c FNC1 (0x6B) 9 2xShitfC (0x67) 01 23" },
/* 26*/ { GS1_MODE | GS1PARENS_MODE, -1, "(90)ABC(90)abc(90)123", -1, 0, "5A 6A 21 22 23 6B 19 10 41 42 43 6B 19 67 01 17", "90 LatchB (0x6A) A B C FNC1 (0x6B) 9 0 a b c FNC1 (0x6B) 9 2xShitfC (0x67) 01 23" },
/* 27*/ { UNICODE_MODE, -1, "99aA[{00\000", 9, 0, "6B 63 6A 41 21 3B 5B 10 10 65 40", "FNC1 (0x6B) 99 LatchB (0x6A) a A [ { 0 0 ShiftA (0x65) NUL" },
/* 28*/ { UNICODE_MODE, -1, "\015\012", -1, 0, "66 60", "ShiftB (0x66) CR/LF" },
/* 29*/ { UNICODE_MODE, -1, "A\015\012", -1, 0, "67 21 60", "2xShiftB (0x67) A CR/LF" },
/* 30*/ { UNICODE_MODE, -1, "\015\015\012", -1, 0, "65 4D 4D 4A", "LatchA (0x65) CR CR LF" },
/* 31*/ { UNICODE_MODE, -1, "ABCDE12345678", -1, 0, "6A 21 22 23 24 25 69 0C 22 38 4E", "LatchB (0x6A) A B C D 4xShiftC 12 34 56 78" },
/* 32*/ { UNICODE_MODE, -1, "\000ABCD1234567890", 15, 0, "65 40 21 22 23 24 6A 0C 22 38 4E 5A", "LatchA (0x65) NULL A B C D LatchC (0x6A) 12 34 56 78 90" },
/* 33*/ { DATA_MODE, -1, "\141\142\143\144\145\200\201\202\203\204\377", -1, 0, "6A 41 42 43 44 45 70 31 5A 35 21 5A 5F 02 31", "LatchB (0x6A) a b c d e BinaryLatch (0x70) 0x80 0x81 0x82 0x83 0x84 0xFF" },
/* 34*/ { DATA_MODE, -1, "\200\061\062\240\063\064\201\202\065\066", -1, 0, "6E 40 0C 6F 00 22 70 03 10 42 6E 15 16", "UpperShiftA (0x6E) NUL 12 UpperShiftB (0x6F) SP 34 BinaryLatch (0x70) 0x81 0x82 TermB (0x6E) 5 6" },
/* 35*/ { DATA_MODE, -1, "\200\201\202\203\061\062\063\064", -1, 0, "70 13 56 0A 59 2C 67 0C 22", "BinaryLatch (0x70) 0x80 0x81 0x82 0x83 Intr2xShiftC (0x67) 12 3" },
/* 36*/ { DATA_MODE, -1, "\001\200\201\202\203\204\200\201\202\203\204", -1, 0, "65 41 70 31 5A 35 21 5A 5F 31 5A 35 21 5A 5F", "LatchA (0x65) SOH BinaryLatch (0x70) 0x80 0x81 0x82 0x83 0x80 0x81 0x82 0x83" },
/* 37*/ { UNICODE_MODE, -1, "\001abc\011\015\012\036", -1, 0, "65 41 65 41 42 43 61 60 64", "LatchA (0x65) SOH 6xShiftB (0x65) a b c HT CR/LF RS" },
};
int data_size = ARRAY_SIZE(data);
int i, length, ret;
@ -728,6 +732,178 @@ static void test_encode(int index, int generate, int debug) {
"00010001010001010000000101000100010001010000010000010100010100000100010101010001000101000000010100010001010100010000010100000101000100010100000101010000000101000001010100010100010001000101000001010001"
"10100010001010101000000010001000001010001010001000001010100010000000101010001010000010101010000000101000100010100010100000100010100010001010100000001010101000001010000000001000101000101010000010101010"
},
/* 34*/ { UNICODE_MODE, 19, -1, "4", -1, 0, 6, 19, 1, "Mask 1 selected",
"1010100000101000101"
"0100000000010001010"
"0010101010000000000"
"0000010100000100000"
"1000100010001010001"
"0001010101010101010"
},
/* 35*/ { UNICODE_MODE, 19, 3 << 8, "4", -1, 0, 6, 19, 0, "Mask 2 specified, unlit right edge mask; BWIPP automatically primes mask",
"1010101010000000100"
"0000000101000100010"
"1010100000001010100"
"0000010101010000000"
"1000001010100010100"
"0101000100010001010"
},
/* 36*/ { UNICODE_MODE, 19, 7 << 8, "4", -1, 0, 6, 19, 1, "Mask 2' specified",
"1010101010000000101"
"0000000101000100010"
"1010100000001010100"
"0000010101010000000"
"1000001010100010101"
"0101000100010001010"
},
/* 37*/ { GS1_MODE, -1, -1, "[10]12[20]12", -1, 0, 12, 17, 1, "Code Set C with FNC1",
"10100000001000001"
"00010100010101010"
"10001000100000001"
"01010100000101000"
"10000010000010001"
"01010001010100010"
"00001010100000001"
"00000101010001010"
"10101000001010001"
"01010101000101010"
"10000010100000101"
"01000100010101010"
},
/* 38*/ { UNICODE_MODE, -1, -1, "1234\011\034\035\036", -1, 0, 14, 21, 1, "Code Set B HT FS GS RS",
"100010001000001010101"
"010001000001000001000"
"100010100010101010001"
"010100000000010100010"
"101000100010001000000"
"010000010000000001000"
"100000101010100000000"
"000101010101010000000"
"001000001010101010101"
"000000000100010001010"
"101010000000000000101"
"000101010101000101010"
"001010101000101010001"
"010101010001000101000"
},
/* 39*/ { UNICODE_MODE, 17, -1, "abcd\015\012", -1, 0, 14, 17, 1, "Code Set B CRLF",
"00001000001000101"
"01000101010001000"
"10100000100010101"
"01000001010000010"
"00100010101000101"
"01010000010101000"
"10101010000010001"
"01000001000100010"
"00001010101010101"
"00000100010100010"
"00101010000000000"
"00010100010000000"
"10100000001010000"
"01010001000101000"
},
/* 40*/ { DATA_MODE, -1, -1, "\101\102\103\104\105\106\107\200\101\102\240\101", -1, 0, 18, 27, 1, "Code Set B Upper Shift A Upper Shift B",
"101010100000101000101000001"
"010100010101000100010101000"
"000010001010100000101010101"
"010100010100000001010101000"
"001010000010001010101000101"
"000001000001010101000000010"
"101000101010100000001000001"
"000101000001010101010100010"
"001010101000101010100010101"
"000101010001000100010001010"
"000000001000100000000000001"
"010000000000010100000100010"
"101010101010101010101010101"
"000101010001000100010101010"
"100000000000100000000010101"
"000000010100010000000100010"
"100010101000000010001000001"
"010001000100000101000001010"
},
/* 41*/ { UNICODE_MODE, -1, -1, "ABCDEF\001G1234H", -1, 0, 16, 25, 1, "Code Set A 4x Shift C",
"0010101010100000100000101"
"0000000100010101000001000"
"1000100000101000100000101"
"0101000001010100000101010"
"0000000000101010001010000"
"0100000000010101010100000"
"0010101010000000101010101"
"0100010101000000010100000"
"1010001000100010001000101"
"0101010001010000000001010"
"0000001010100010001010101"
"0001000000000001010001000"
"0010100000101010100000000"
"0101010100000100010100010"
"1010101010001000101000000"
"0000010100010101000101010"
},
/* 42*/ { UNICODE_MODE, -1, -1, "ABCDEF\001ab\011\034\035\036\001A", -1, 0, 19, 28, 1, "Code Set A 6x Shift B HT FS GS RS",
"1000001010100010101010101010"
"0101000000010100010101010001"
"0010001010100000101000001010"
"0001000101000001010001010000"
"1000001010100000101010001000"
"0100010101010001000000010001"
"0000001010100010100010000010"
"0000010100000001010100010101"
"0000001010001010101000001010"
"0100010101010101000001010000"
"0010000000101000101000000010"
"0101000101000101000101000001"
"1000100000001010101000001000"
"0101000001010000010001010100"
"1010000000100010001010100010"
"0101010100000001000100010001"
"1010000010100000100000101000"
"0001010000010100000100010101"
"1010100010000000101010101010"
},
/* 43*/ { UNICODE_MODE, -1, -1, "ABCDEF\001abcdefgA", -1, 0, 19, 28, 1, "Code Set A Latch B",
"1010001010100010101010101010"
"0100010101010000000100010001"
"1010000010100000100010101000"
"0001010001000001010100000001"
"0010001010100000000010101010"
"0101000000010100010101000001"
"0000101010100000001000001010"
"0000010101010000000100010101"
"0000101010100000101000001010"
"0001010100010001010000000101"
"1010000010100010100000001010"
"0101000101000000010001010001"
"1000100000001010101000001000"
"0101000001010000010100010001"
"1010000000100010001010100010"
"0101010100000001000100010001"
"1010000010100000100000101000"
"0001010000010100000100010101"
"1010100010000000101010101010"
},
/* 44*/ { DATA_MODE, -1, -1, "\200\200\200\200\061\062\063\064\065\066\067\070\071\060\061\062\063\064\065\066\200", -1, 0, 20, 29, 1, "Binary Latch C",
"10101010000010100010101010001"
"01010001000101010001000000010"
"00001010101000101010001000001"
"00010100000001000101010100000"
"00100000101000100000000000101"
"00000001010101010100000101000"
"10101000001010000010101000100"
"01010100010000000101000000010"
"10101000101000001010100010100"
"00010101000101010001000101010"
"10000010101000100010101010001"
"01000001010100000001010001010"
"00001010101010101000000010001"
"00010100000000010000010101010"
"00101000100010001000101000001"
"00000100000101010101000000000"
"10000000000000001000000010101"
"01010001010001010000010101000"
"10000010100010000010001000101"
"01000100000100010001010101010"
},
};
int data_size = ARRAY_SIZE(data);
int i, length, ret;