From 8bf4d5906a9e9bef6d7506e8f1ce3a284b8594e7 Mon Sep 17 00:00:00 2001 From: Harald Oehlmann Date: Tue, 18 Aug 2015 14:06:06 +0200 Subject: [PATCH] Implemented DM ECC200 Macro 05/06 encodation --- backend/dmatrix.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/backend/dmatrix.c b/backend/dmatrix.c index f4c88dae..c62faefe 100755 --- a/backend/dmatrix.c +++ b/backend/dmatrix.c @@ -414,6 +414,32 @@ int dm200encode(struct zint_symbol *symbol, unsigned char source[], unsigned cha if(debug) printf("RP "); } } + + /* Check for Macro05/Macro06 */ + /* "[)>[RS]05[GS]...[RS][EOT]" -> CW 236 */ + /* "[)>[RS]06[GS]...[RS][EOT]" -> CW 237 */ + if (tp == 0 && sp == 0 && inputlen >= 9 + && source[0] == '[' && source[1] == ')' && source[2] == '>' + && source[3] == '\x1e' && source[4] == '0' + && (source[5] == '5' || source[5] == '6') + && source[6] == '\x1d' + && source[inputlen-2] == '\x1e' && source[inputlen-1] == '\x04' ) + { + /* Output macro Codeword */ + if (source[5] == '5') { + target[tp] = 236; + if(debug) printf("Macro05 "); + } else { + target[tp] = 237; + if(debug) printf("Macro06 "); + } + tp++; + concat(binary, " "); + /* Remove macro characters from input string */ + sp = 7; + inputlen -= 2; + } + while (sp < inputlen) {