1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
Author: Chris Howie <crazycomputers@yahoo.com>
Description: Following codabar specification (Closes: #320908).
diff -Naurp barcode.orig/codabar.c barcode/codabar.c
--- barcode.orig/codabar.c 2009-07-16 21:49:31.000000000 +0000
+++ barcode/codabar.c 2009-07-16 21:55:33.000000000 +0000
@@ -29,10 +29,11 @@
/* this is ordered in decades to simplify encoding */
static char alphabet[] =
- "0123456789" "-$:/.+ABCD";
+ "0123456789" "-$:/.+ABCDTN*E";
#define CODE_A 16
#define CODE_B 17
+#define CODE_T 20
#define NARROW 12
#define WIDE 14
@@ -42,7 +43,8 @@ static char *patterns[] = {
"1111133","1111331","1113113","3311111","1131131",
"3111131","1311113","1311311","1331111","3113111",
"1113311","1133111","3111313","3131113","3131311",
-"1131313","1133131","1313113","1113133","1113331" };
+"1131313","1133131","1313113","1113133","1113331",
+"1133131","1313113","1113133","1113331"};
/*
* Check that the text can be encoded. Returns 0 or -1.
@@ -167,13 +169,13 @@ int Barcode_cbr_encode(struct Barcode_It
}
if (!startpresent) {
if (usesum) {
- /* if no start character specified, B is used as a stop char */
- checksum += CODE_B;
+ /* if no start character specified, T is used as a stop char */
+ checksum += CODE_T;
checksum = (checksum + 15) / 16 * 16 - checksum;
add_one(ptr, checksum);
ptr += strlen(ptr);
}
- add_one(ptr, CODE_B);
+ add_one(ptr, CODE_T);
}
bc->partial = partial;
bc->textinfo = textinfo;
|