mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
backend: non-functional code-fiddling: format codablock.c (clang-format
+ manual); add SPDX to all files; prefix include guards with Z_; move vim comment to bottom; remove some trailing spaces
This commit is contained in:
parent
ee23f92151
commit
e1522e0808
@ -32,10 +32,10 @@
|
|||||||
|
|
||||||
/* A little information about this symbology can be found at
|
/* A little information about this symbology can be found at
|
||||||
* https://barcodeguide.seagullscientific.com/Content/Symbologies/BC412.htm
|
* https://barcodeguide.seagullscientific.com/Content/Symbologies/BC412.htm
|
||||||
*
|
*
|
||||||
* Partial specification at
|
* Partial specification at
|
||||||
* https://www.wdfxw.net/doc80487518.htm
|
* https://www.wdfxw.net/doc80487518.htm
|
||||||
*
|
*
|
||||||
* Checked against the encoder at
|
* Checked against the encoder at
|
||||||
* https://www.barcodesoft.com/en/semi/semi-t1-95-bc-412-code */
|
* https://www.barcodesoft.com/en/semi/semi-t1-95-bc-412-code */
|
||||||
|
|
||||||
@ -72,26 +72,26 @@ INTERNAL int bc412(struct zint_symbol *symbol, unsigned char source[], int lengt
|
|||||||
char dest[293]; /* 2 + (36 * 8) + 3 */
|
char dest[293]; /* 2 + (36 * 8) + 3 */
|
||||||
char *d = dest;
|
char *d = dest;
|
||||||
int error_number = 0;
|
int error_number = 0;
|
||||||
|
|
||||||
if ((length < 7) || (length > 18)) {
|
if ((length < 7) || (length > 18)) {
|
||||||
strcpy(symbol->errtxt, "790: Input wrong length (should be between 7 and 18 characters)");
|
strcpy(symbol->errtxt, "790: Input wrong length (should be between 7 and 18 characters)");
|
||||||
return ZINT_ERROR_TOO_LONG;
|
return ZINT_ERROR_TOO_LONG;
|
||||||
}
|
}
|
||||||
to_upper(source, length);
|
to_upper(source, length);
|
||||||
|
|
||||||
padded_source[0] = source[0];
|
padded_source[0] = source[0];
|
||||||
padded_source[1] = '0';
|
padded_source[1] = '0';
|
||||||
|
|
||||||
for (i = 2; i <= length; i++) {
|
for (i = 2; i <= length; i++) {
|
||||||
padded_source[i] = source[i - 1];
|
padded_source[i] = source[i - 1];
|
||||||
}
|
}
|
||||||
padded_source[length + 1] = 0;
|
padded_source[length + 1] = 0;
|
||||||
|
|
||||||
if (!is_sane_lookup(BROMINE, 35, padded_source, length + 1, posns)) {
|
if (!is_sane_lookup(BROMINE, 35, padded_source, length + 1, posns)) {
|
||||||
strcpy(symbol->errtxt, "791: Invalid character in data (alphanumerics only, excluding the letter \"O\")");
|
strcpy(symbol->errtxt, "791: Invalid character in data (alphanumerics only, excluding the letter \"O\")");
|
||||||
return ZINT_ERROR_INVALID_DATA;
|
return ZINT_ERROR_INVALID_DATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i <= length; i++) {
|
for (i = 0; i <= length; i++) {
|
||||||
if (i % 2) {
|
if (i % 2) {
|
||||||
counter_even += posns[i];
|
counter_even += posns[i];
|
||||||
@ -99,38 +99,38 @@ INTERNAL int bc412(struct zint_symbol *symbol, unsigned char source[], int lengt
|
|||||||
counter_odd += posns[i];
|
counter_odd += posns[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
counter_odd %= 35;
|
counter_odd %= 35;
|
||||||
counter_even %= 35;
|
counter_even %= 35;
|
||||||
|
|
||||||
/* Check digit */
|
/* Check digit */
|
||||||
check_sum = counter_odd + (2 * counter_even);
|
check_sum = counter_odd + (2 * counter_even);
|
||||||
check_sum %= 35;
|
check_sum %= 35;
|
||||||
check_sum *= 17;
|
check_sum *= 17;
|
||||||
check_sum %= 35;
|
check_sum %= 35;
|
||||||
|
|
||||||
if (symbol->debug & ZINT_DEBUG_PRINT) {
|
if (symbol->debug & ZINT_DEBUG_PRINT) {
|
||||||
printf("BC412 check: %c\n", BROMINE[check_sum]);
|
printf("BC412 check: %c\n", BROMINE[check_sum]);
|
||||||
}
|
}
|
||||||
|
|
||||||
padded_source[1] = BROMINE[check_sum];
|
padded_source[1] = BROMINE[check_sum];
|
||||||
posns[1] = check_sum;
|
posns[1] = check_sum;
|
||||||
|
|
||||||
/* Start character */
|
/* Start character */
|
||||||
memcpy(d, "12", 2);
|
memcpy(d, "12", 2);
|
||||||
d += 2;
|
d += 2;
|
||||||
|
|
||||||
for (i = 0; i <= length; i++, d += 8) {
|
for (i = 0; i <= length; i++, d += 8) {
|
||||||
memcpy(d, BC412Table[posns[i]], 8);
|
memcpy(d, BC412Table[posns[i]], 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Stop character */
|
/* Stop character */
|
||||||
memcpy(d, "111", 3);
|
memcpy(d, "111", 3);
|
||||||
d += 3;
|
d += 3;
|
||||||
|
|
||||||
expand(symbol, dest, d - dest);
|
expand(symbol, dest, d - dest);
|
||||||
ustrcpy(symbol->text, padded_source);
|
ustrcpy(symbol->text, padded_source);
|
||||||
|
|
||||||
if (symbol->output_options & COMPLIANT_HEIGHT) {
|
if (symbol->output_options & COMPLIANT_HEIGHT) {
|
||||||
/* SEMI T1-95 Table 1 "Module" (Character) Height 2mm ± 0.025mm, using Module Spacing 0.12mm ± 0.025mm as
|
/* SEMI T1-95 Table 1 "Module" (Character) Height 2mm ± 0.025mm, using Module Spacing 0.12mm ± 0.025mm as
|
||||||
X-dimension */
|
X-dimension */
|
||||||
@ -140,7 +140,7 @@ INTERNAL int bc412(struct zint_symbol *symbol, unsigned char source[], int lengt
|
|||||||
/* Using compliant height as default as no backwards compatibility to consider */
|
/* Using compliant height as default as no backwards compatibility to consider */
|
||||||
(void) set_height(symbol, 0.0f, stripf(2.0f / 0.12f), 0.0f, 1 /*no_errtxt*/);
|
(void) set_height(symbol, 0.0f, stripf(2.0f / 0.12f), 0.0f, 1 /*no_errtxt*/);
|
||||||
}
|
}
|
||||||
|
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2020 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2020-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
@ -27,7 +27,10 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
/* vim: set ts=4 sw=4 et : */
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
|
#ifndef Z_CHANNEL_PRECALCS_H
|
||||||
|
#define Z_CHANNEL_PRECALCS_H
|
||||||
|
|
||||||
/* Channel code precalculated values to avoid excessive looping */
|
/* Channel code precalculated values to avoid excessive looping */
|
||||||
/* To generate uncomment CHANNEL_GENERATE_PRECALCS define and run "backend/tests/test_channel -f generate -g" */
|
/* To generate uncomment CHANNEL_GENERATE_PRECALCS define and run "backend/tests/test_channel -f generate -g" */
|
||||||
@ -104,3 +107,6 @@ static channel_precalc channel_precalcs8[] = {
|
|||||||
{ 7504623, { 1, 1, 3, 4, 3, 1, 1, 1, }, { 5, 2, 1, 1, 1, 1, 1, 3, }, { 8, 8, 8, 6, 3, 1, 1, }, { 8, 4, 3, 3, 3, 3, 3, }, },
|
{ 7504623, { 1, 1, 3, 4, 3, 1, 1, 1, }, { 5, 2, 1, 1, 1, 1, 1, 3, }, { 8, 8, 8, 6, 3, 1, 1, }, { 8, 4, 3, 3, 3, 3, 3, }, },
|
||||||
{ 7623744, { 3, 1, 1, 2, 2, 1, 2, 3, }, { 5, 2, 1, 1, 1, 2, 1, 2, }, { 8, 6, 6, 6, 5, 4, 4, }, { 8, 4, 3, 3, 3, 3, 2, }, },
|
{ 7623744, { 3, 1, 1, 2, 2, 1, 2, 3, }, { 5, 2, 1, 1, 1, 2, 1, 2, }, { 8, 6, 6, 6, 5, 4, 4, }, { 8, 4, 3, 3, 3, 3, 2, }, },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* vim: set ts=4 sw=4 et : */
|
||||||
|
#endif /* Z_CHANNEL_PRECALCS_H */
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,8 +1,7 @@
|
|||||||
/* code1.h - Lookup info for USS Code One */
|
/* code1.h - Lookup info for USS Code One */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2009-2021 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2009-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
@ -29,7 +28,10 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
/* vim: set ts=4 sw=4 et : */
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
|
#ifndef Z_CODE1_H
|
||||||
|
#define Z_CODE1_H
|
||||||
|
|
||||||
static const char c40_shift[] = {
|
static const char c40_shift[] = {
|
||||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
@ -59,39 +61,39 @@ static const char text_value[] = {
|
|||||||
22, 23, 24, 25, 26, 0, 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, 27, 28, 29, 30, 31
|
22, 23, 24, 25, 26, 0, 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, 27, 28, 29, 30, 31
|
||||||
};
|
};
|
||||||
|
|
||||||
static const unsigned short int c1_height[] = {
|
static const unsigned short c1_height[] = {
|
||||||
16, 22, 28, 40, 52, 70, 104, 148
|
16, 22, 28, 40, 52, 70, 104, 148
|
||||||
};
|
};
|
||||||
|
|
||||||
static const unsigned short int c1_width[] = {
|
static const unsigned short c1_width[] = {
|
||||||
18, 22, 32, 42, 54, 76, 98, 134
|
18, 22, 32, 42, 54, 76, 98, 134
|
||||||
};
|
};
|
||||||
|
|
||||||
static const unsigned short int c1_data_length[] = {
|
static const unsigned short c1_data_length[] = {
|
||||||
10, 19, 44, 91, 182, 370, 732, 1480
|
10, 19, 44, 91, 182, 370, 732, 1480
|
||||||
};
|
};
|
||||||
|
|
||||||
static const unsigned short int c1_ecc_length[] = {
|
static const unsigned short c1_ecc_length[] = {
|
||||||
10, 16, 26, 44, 70, 140, 280, 560
|
10, 16, 26, 44, 70, 140, 280, 560
|
||||||
};
|
};
|
||||||
|
|
||||||
static const unsigned short int c1_blocks[] = {
|
static const unsigned short c1_blocks[] = {
|
||||||
1, 1, 1, 1, 1, 2, 4, 8
|
1, 1, 1, 1, 1, 2, 4, 8
|
||||||
};
|
};
|
||||||
|
|
||||||
static const unsigned short int c1_data_blocks[] = {
|
static const unsigned short c1_data_blocks[] = {
|
||||||
10, 19, 44, 91, 182, 185, 183, 185
|
10, 19, 44, 91, 182, 185, 183, 185
|
||||||
};
|
};
|
||||||
|
|
||||||
static const unsigned short int c1_ecc_blocks[] = {
|
static const unsigned short c1_ecc_blocks[] = {
|
||||||
10, 16, 26, 44, 70, 70, 70, 70
|
10, 16, 26, 44, 70, 70, 70, 70
|
||||||
};
|
};
|
||||||
|
|
||||||
static const unsigned short int c1_grid_width[] = {
|
static const unsigned short c1_grid_width[] = {
|
||||||
4, 5, 7, 9, 12, 17, 22, 30
|
4, 5, 7, 9, 12, 17, 22, 30
|
||||||
};
|
};
|
||||||
|
|
||||||
static const unsigned short int c1_grid_height[] = {
|
static const unsigned short c1_grid_height[] = {
|
||||||
5, 7, 10, 15, 21, 30, 46, 68
|
5, 7, 10, 15, 21, 30, 46, 68
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -101,3 +103,6 @@ static const unsigned short int c1_grid_height[] = {
|
|||||||
#define C1_TEXT 4
|
#define C1_TEXT 4
|
||||||
#define C1_EDI 5
|
#define C1_EDI 5
|
||||||
#define C1_BYTE 6
|
#define C1_BYTE 6
|
||||||
|
|
||||||
|
/* vim: set ts=4 sw=4 et : */
|
||||||
|
#endif /* Z_CODE1_H */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2020 - 2021 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2020-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
@ -27,10 +27,10 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
/* vim: set ts=4 sw=4 et : */
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
#ifndef CODE128_H
|
#ifndef Z_CODE128_H
|
||||||
#define CODE128_H
|
#define Z_CODE128_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -63,4 +63,5 @@ INTERNAL_DATA_EXTERN const char C128Table[107][6];
|
|||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
#endif /* CODE128_H */
|
/* vim: set ts=4 sw=4 et : */
|
||||||
|
#endif /* Z_CODE128_H */
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
/* code16k.c - Handles Code 16k stacked symbology */
|
/* code16k.c - Handles Code 16k stacked symbology */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2008 - 2021 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2008-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
@ -29,16 +28,16 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
/* vim: set ts=4 sw=4 et : */
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
/* Updated to comply with BS EN 12323:2005 */
|
/* Updated to comply with BS EN 12323:2005 */
|
||||||
|
|
||||||
/* Code 16k can hold up to 77 characters or 154 numbers */
|
/* Code 16k can hold up to 77 characters or 154 numbers */
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <assert.h>
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "code128.h"
|
#include "code128.h"
|
||||||
|
#include <assert.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
/* Note using C128Table with extra entry at 106 (Triple Shift) for C16KTable */
|
/* Note using C128Table with extra entry at 106 (Triple Shift) for C16KTable */
|
||||||
|
|
||||||
@ -413,3 +412,5 @@ INTERNAL int code16k(struct zint_symbol *symbol, unsigned char source[], int len
|
|||||||
|
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* vim: set ts=4 sw=4 et : */
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
/* code49.h - Code 49 Tables */
|
/* code49.h - Code 49 Tables */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2009-2021 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2009-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
@ -29,7 +28,10 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
/* vim: set ts=4 sw=4 et : */
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
|
#ifndef Z_CODE49_H
|
||||||
|
#define Z_CODE49_H
|
||||||
|
|
||||||
/* This data set taken from ANSI/AIM-BC6-2000, 4th April 2000 */
|
/* This data set taken from ANSI/AIM-BC6-2000, 4th April 2000 */
|
||||||
|
|
||||||
@ -72,7 +74,7 @@ static const char c49_table4[8][4] = {
|
|||||||
{'O','E','O','E'}, {'E','O','O','E'}, {'O','O','O','O'}, {'E','E','E','E'}
|
{'O','E','O','E'}, {'E','O','O','E'}, {'O','O','O','O'}, {'E','E','E','E'}
|
||||||
};
|
};
|
||||||
|
|
||||||
static const unsigned short int c49_even_bitpattern[] = {
|
static const unsigned short c49_even_bitpattern[] = {
|
||||||
/* Appendix E - Code 49 Encodation Patterns (Even Symbol Character Parity) */
|
/* Appendix E - Code 49 Encodation Patterns (Even Symbol Character Parity) */
|
||||||
0xBE5C, 0xC16E, 0x86DC, 0xC126, 0x864C, 0x9EDC, 0xC726, 0x9E4C, 0xDF26, 0x82CC,
|
0xBE5C, 0xC16E, 0x86DC, 0xC126, 0x864C, 0x9EDC, 0xC726, 0x9E4C, 0xDF26, 0x82CC,
|
||||||
0x8244, 0x8ECC, 0xC322, 0x8E44, 0xBECC, 0xCF22, 0xBE44, 0xC162, 0x86C4, 0xC762,
|
0x8244, 0x8ECC, 0xC322, 0x8E44, 0xBECC, 0xCF22, 0xBE44, 0xC162, 0x86C4, 0xC762,
|
||||||
@ -317,7 +319,7 @@ static const unsigned short int c49_even_bitpattern[] = {
|
|||||||
0xCF2E
|
0xCF2E
|
||||||
};
|
};
|
||||||
|
|
||||||
static const unsigned short int c49_odd_bitpattern[] = {
|
static const unsigned short c49_odd_bitpattern[] = {
|
||||||
/* Appendix E - Code 49 Encodation Patterns (Odd Symbol Character Parity) */
|
/* Appendix E - Code 49 Encodation Patterns (Odd Symbol Character Parity) */
|
||||||
0xC940, 0xF250, 0xECA0, 0xFB28, 0xE5A0, 0xF968, 0xDB40, 0xF6D0, 0xFDB4, 0xC4A0,
|
0xC940, 0xF250, 0xECA0, 0xFB28, 0xE5A0, 0xF968, 0xDB40, 0xF6D0, 0xFDB4, 0xC4A0,
|
||||||
0xF128, 0x9940, 0xE650, 0xF994, 0xDCA0, 0xF728, 0xFDCA, 0x8B40, 0xE2D0, 0xCDA0,
|
0xF128, 0x9940, 0xE650, 0xF994, 0xDCA0, 0xF728, 0xFDCA, 0x8B40, 0xE2D0, 0xCDA0,
|
||||||
@ -561,3 +563,6 @@ static const unsigned short int c49_odd_bitpattern[] = {
|
|||||||
0x990E, 0x8B0E, 0x8906, 0xBB0E, 0xB906, 0x9B06, 0x9902, 0xA2FC, 0xD37E, 0xD13E,
|
0x990E, 0x8B0E, 0x8906, 0xBB0E, 0xB906, 0x9B06, 0x9902, 0xA2FC, 0xD37E, 0xD13E,
|
||||||
0xAEFC
|
0xAEFC
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* vim: set ts=4 sw=4 et : */
|
||||||
|
#endif /* Z_CODE49_H */
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
/* composite.c - Tables for UCC.EAN Composite Symbols */
|
/* composite.c - Tables for UCC.EAN Composite Symbols */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2008 - 2020 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2008-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
@ -29,10 +28,13 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
/* vim: set ts=4 sw=4 et : */
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
|
#ifndef Z_COMPOSITE_H
|
||||||
|
#define Z_COMPOSITE_H
|
||||||
|
|
||||||
/* CC-A component coefficients from ISO/IEC 24728:2006 Annex F */
|
/* CC-A component coefficients from ISO/IEC 24728:2006 Annex F */
|
||||||
static const unsigned short int ccaCoeffs[30] = {
|
static const unsigned short ccaCoeffs[30] = {
|
||||||
/* k = 4 */
|
/* k = 4 */
|
||||||
522, 568, 723, 809,
|
522, 568, 723, 809,
|
||||||
|
|
||||||
@ -138,3 +140,6 @@ static const UINT pwr928[69][7] = {
|
|||||||
{ 231, 54, 222, 565, 282, 130, 192, },
|
{ 231, 54, 222, 565, 282, 130, 192, },
|
||||||
{ 462, 108, 445, 202, 564, 260, 384, },
|
{ 462, 108, 445, 202, 564, 260, 384, },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* vim: set ts=4 sw=4 et : */
|
||||||
|
#endif /* Z_COMPOSITE_H */
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
/* Sed: http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/versions.asp */
|
/* Sed: http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/versions.asp */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2008 - 2021 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2008-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
@ -29,7 +28,8 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
/* vim: set ts=4 sw=4 et : */
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
#if defined (_WIN32) && (defined(_USRDLL) || defined(DLL_EXPORT) || defined(PIC))
|
#if defined (_WIN32) && (defined(_USRDLL) || defined(DLL_EXPORT) || defined(PIC))
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <shlwapi.h>
|
#include <shlwapi.h>
|
||||||
@ -40,14 +40,13 @@ extern "C"
|
|||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__declspec(dllexport) HRESULT DllGetVersion (DLLVERSIONINFO2* pdvi);
|
__declspec(dllexport) HRESULT DllGetVersion(DLLVERSIONINFO2 *pdvi);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
HRESULT DllGetVersion (DLLVERSIONINFO2* pdvi)
|
HRESULT DllGetVersion(DLLVERSIONINFO2 *pdvi) {
|
||||||
{
|
|
||||||
if (!pdvi || (sizeof(*pdvi) != pdvi->info1.cbSize))
|
if (!pdvi || (sizeof(*pdvi) != pdvi->info1.cbSize))
|
||||||
return (E_INVALIDARG);
|
return (E_INVALIDARG);
|
||||||
|
|
||||||
@ -64,4 +63,5 @@ HRESULT DllGetVersion (DLLVERSIONINFO2* pdvi)
|
|||||||
#else
|
#else
|
||||||
/* https://stackoverflow.com/a/26541331 Suppresses gcc warning ISO C forbids an empty translation unit */
|
/* https://stackoverflow.com/a/26541331 Suppresses gcc warning ISO C forbids an empty translation unit */
|
||||||
typedef int make_iso_compilers_happy;
|
typedef int make_iso_compilers_happy;
|
||||||
|
/* vim: set ts=4 sw=4 et : */
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
@ -75,11 +75,11 @@ static const char dm_text_value[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Position in option array [symbol option value - 1]
|
/* Position in option array [symbol option value - 1]
|
||||||
// The position in the option array is by increasing total data codewords with square first
|
The position in the option array is by increasing total data codewords with square first
|
||||||
// The last comment value is the total data codewords value.
|
The last comment value is the total data codewords value.
|
||||||
// The index of this array is the --vers parameter value -1 and is given as first comment value */
|
The index of this array is the --vers parameter value -1 and is given as first comment value */
|
||||||
|
|
||||||
static const unsigned short int dm_intsymbol[] = {
|
static const unsigned short dm_intsymbol[] = {
|
||||||
/* Standard DM */
|
/* Standard DM */
|
||||||
0, /* 1: 10x10 , 3*/ 1, /* 2: 12x12 , 5*/ 3, /* 3: 14x14 , 8*/ 5, /* 4: 16x16 , 12*/
|
0, /* 1: 10x10 , 3*/ 1, /* 2: 12x12 , 5*/ 3, /* 3: 14x14 , 8*/ 5, /* 4: 16x16 , 12*/
|
||||||
7, /* 5: 18x18 , 18*/ 9, /* 6: 20x20 , 22*/ 12, /* 7: 22x22 , 30*/ 15, /* 8: 24x24 , 36*/
|
7, /* 5: 18x18 , 18*/ 9, /* 6: 20x20 , 22*/ 12, /* 7: 22x22 , 30*/ 15, /* 8: 24x24 , 36*/
|
||||||
@ -122,7 +122,7 @@ static const char dm_isDMRE[] = {
|
|||||||
|
|
||||||
/* Horizontal matrix size */
|
/* Horizontal matrix size */
|
||||||
|
|
||||||
static const unsigned short int dm_matrixH[] = {
|
static const unsigned short dm_matrixH[] = {
|
||||||
/* 0*/ 10, /* 10x10 , 3*/ 12, /* 12x12 , 5 */ 8, /* 8x18 , 5*/ 14, /* 14x14 , 8*/
|
/* 0*/ 10, /* 10x10 , 3*/ 12, /* 12x12 , 5 */ 8, /* 8x18 , 5*/ 14, /* 14x14 , 8*/
|
||||||
/* 4*/ 8, /* 8x32 , 10*/ 16, /* 16x16 , 12*/ 12, /* 12x26 , 16*/ 18, /* 18x18 , 18*/
|
/* 4*/ 8, /* 8x32 , 10*/ 16, /* 16x16 , 12*/ 12, /* 12x26 , 16*/ 18, /* 18x18 , 18*/
|
||||||
/* 8*/ 8, /* 8x48 , 18*/ 20, /* 20x20 , 22*/ 12, /* 12x36 , 22*/ 8, /* 8x64 , 24*/
|
/* 8*/ 8, /* 8x48 , 18*/ 20, /* 20x20 , 22*/ 12, /* 12x36 , 22*/ 8, /* 8x64 , 24*/
|
||||||
@ -139,7 +139,7 @@ static const unsigned short int dm_matrixH[] = {
|
|||||||
|
|
||||||
/* Vertical matrix sizes */
|
/* Vertical matrix sizes */
|
||||||
|
|
||||||
static const unsigned short int dm_matrixW[] = {
|
static const unsigned short dm_matrixW[] = {
|
||||||
/* 0*/ 10, /* 10x10 */ 12, /* 12x12 */ 18, /* 8x18 */ 14, /* 14x14 */
|
/* 0*/ 10, /* 10x10 */ 12, /* 12x12 */ 18, /* 8x18 */ 14, /* 14x14 */
|
||||||
/* 4*/ 32, /* 8x32 */ 16, /* 16x16 */ 26, /* 12x26 */ 18, /* 18x18 */
|
/* 4*/ 32, /* 8x32 */ 16, /* 16x16 */ 26, /* 12x26 */ 18, /* 18x18 */
|
||||||
/* 8*/ 48, /* 8x48 */ 20, /* 20x20 */ 36, /* 12x36 */ 64, /* 8x64 */
|
/* 8*/ 48, /* 8x48 */ 20, /* 20x20 */ 36, /* 12x36 */ 64, /* 8x64 */
|
||||||
@ -157,7 +157,7 @@ static const unsigned short int dm_matrixW[] = {
|
|||||||
|
|
||||||
/* Horizontal submodule size (including subfinder) */
|
/* Horizontal submodule size (including subfinder) */
|
||||||
|
|
||||||
static const unsigned short int dm_matrixFH[] = {
|
static const unsigned short dm_matrixFH[] = {
|
||||||
/* 0*/ 10, /* 10x10 */ 12, /* 12x12 */ 8, /* 8x18 */ 14, /* 14x14 */
|
/* 0*/ 10, /* 10x10 */ 12, /* 12x12 */ 8, /* 8x18 */ 14, /* 14x14 */
|
||||||
/* 4*/ 8, /* 8x32 */ 16, /* 16x16 */ 12, /* 12x26 */ 18, /* 18x18 */
|
/* 4*/ 8, /* 8x32 */ 16, /* 16x16 */ 12, /* 12x26 */ 18, /* 18x18 */
|
||||||
/* 8*/ 8, /* 8x48 */ 20, /* 20x20 */ 12, /* 12x36 */ 8, /* 8x64 */
|
/* 8*/ 8, /* 8x48 */ 20, /* 20x20 */ 12, /* 12x36 */ 8, /* 8x64 */
|
||||||
@ -174,7 +174,7 @@ static const unsigned short int dm_matrixFH[] = {
|
|||||||
|
|
||||||
/* Vertical submodule size (including subfinder) */
|
/* Vertical submodule size (including subfinder) */
|
||||||
|
|
||||||
static const unsigned short int dm_matrixFW[] = {
|
static const unsigned short dm_matrixFW[] = {
|
||||||
/* 0*/ 10, /* 10x10 */ 12, /* 12x12 */ 18, /* 8x18 */ 14, /* 14x14 */
|
/* 0*/ 10, /* 10x10 */ 12, /* 12x12 */ 18, /* 8x18 */ 14, /* 14x14 */
|
||||||
/* 4*/ 16, /* 8x32 */ 16, /* 16x16 */ 26, /* 12x26 */ 18, /* 18x18 */
|
/* 4*/ 16, /* 8x32 */ 16, /* 16x16 */ 26, /* 12x26 */ 18, /* 18x18 */
|
||||||
/* 8*/ 24, /* 8x48 */ 20, /* 20x20 */ 18, /* 12x36 */ 16, /* 8x64 */
|
/* 8*/ 24, /* 8x48 */ 20, /* 20x20 */ 18, /* 12x36 */ 16, /* 8x64 */
|
||||||
@ -191,7 +191,7 @@ static const unsigned short int dm_matrixFW[] = {
|
|||||||
|
|
||||||
/* Total Data Codewords */
|
/* Total Data Codewords */
|
||||||
|
|
||||||
static const unsigned short int dm_matrixbytes[] = {
|
static const unsigned short dm_matrixbytes[] = {
|
||||||
/* 0*/ 3, /* 10x10 */ 5, /* 12x12 */ 5, /* 8x18 */ 8, /* 14x14 */
|
/* 0*/ 3, /* 10x10 */ 5, /* 12x12 */ 5, /* 8x18 */ 8, /* 14x14 */
|
||||||
/* 4*/ 10, /* 8x32 */ 12, /* 16x16 */ 16, /* 12x26 */ 18, /* 18x18 */
|
/* 4*/ 10, /* 8x32 */ 12, /* 16x16 */ 16, /* 12x26 */ 18, /* 18x18 */
|
||||||
/* 8*/ 18, /* 8x48 */ 22, /* 20x20 */ 22, /* 12x36 */ 24, /* 8x64 */
|
/* 8*/ 18, /* 8x48 */ 22, /* 20x20 */ 22, /* 12x36 */ 24, /* 8x64 */
|
||||||
@ -208,7 +208,7 @@ static const unsigned short int dm_matrixbytes[] = {
|
|||||||
|
|
||||||
/* Data Codewords per RS-Block */
|
/* Data Codewords per RS-Block */
|
||||||
|
|
||||||
static const unsigned short int dm_matrixdatablock[] = {
|
static const unsigned short dm_matrixdatablock[] = {
|
||||||
/* 0*/ 3, /* 10x10 */ 5, /* 12x12 */ 5, /* 8x18 */ 8, /* 14x14 */
|
/* 0*/ 3, /* 10x10 */ 5, /* 12x12 */ 5, /* 8x18 */ 8, /* 14x14 */
|
||||||
/* 4*/ 10, /* 8x32 */ 12, /* 16x16 */ 16, /* 12x26 */ 18, /* 18x18 */
|
/* 4*/ 10, /* 8x32 */ 12, /* 16x16 */ 16, /* 12x26 */ 18, /* 18x18 */
|
||||||
/* 8*/ 18, /* 8x48 */ 22, /* 20x20 */ 22, /* 12x36 */ 24, /* 8x64 */
|
/* 8*/ 18, /* 8x48 */ 22, /* 20x20 */ 22, /* 12x36 */ 24, /* 8x64 */
|
||||||
@ -225,7 +225,7 @@ static const unsigned short int dm_matrixdatablock[] = {
|
|||||||
|
|
||||||
/* ECC Codewords per RS-Block */
|
/* ECC Codewords per RS-Block */
|
||||||
|
|
||||||
static const unsigned short int dm_matrixrsblock[] = {
|
static const unsigned short dm_matrixrsblock[] = {
|
||||||
/* 0*/ 5, /* 10x10 */ 7, /* 12x12 */ 7, /* 8x18 */ 10, /* 14x14 */
|
/* 0*/ 5, /* 10x10 */ 7, /* 12x12 */ 7, /* 8x18 */ 10, /* 14x14 */
|
||||||
/* 4*/ 11, /* 8x32 */ 12, /* 16x16 */ 14, /* 12x26 */ 14, /* 18x18 */
|
/* 4*/ 11, /* 8x32 */ 12, /* 16x16 */ 14, /* 12x26 */ 14, /* 18x18 */
|
||||||
/* 8*/ 15, /* 8x48 */ 18, /* 20x20 */ 18, /* 12x36 */ 18, /* 8x64 */
|
/* 8*/ 15, /* 8x48 */ 18, /* 20x20 */ 18, /* 12x36 */ 18, /* 8x64 */
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
/* dmatrix_trace.h - Trace routines for DM_COMPRESSION algorithm */
|
/* dmatrix_trace.h - Trace routines for DM_COMPRESSION algorithm */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2021 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2021-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
@ -29,7 +28,7 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
/* vim: set ts=4 sw=4 et : */
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
#ifndef Z_DMATRIX_TRACE_H
|
#ifndef Z_DMATRIX_TRACE_H
|
||||||
#define Z_DMATRIX_TRACE_H
|
#define Z_DMATRIX_TRACE_H
|
||||||
@ -151,4 +150,5 @@ static void DM_TRACE_NotAddEdge(const unsigned char *source, const int length, s
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif /* DM_TRACE */
|
#endif /* DM_TRACE */
|
||||||
|
/* vim: set ts=4 sw=4 et : */
|
||||||
#endif /* Z_DMATRIX_TRACE_H */
|
#endif /* Z_DMATRIX_TRACE_H */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* eci.c - Extended Channel Interpretations to Unicode tables
|
/* eci.c - Extended Channel Interpretations to Unicode tables */
|
||||||
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2009-2022 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2009-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
|
|
||||||
@ -28,6 +28,7 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
#ifndef Z_ECI_H
|
#ifndef Z_ECI_H
|
||||||
#define Z_ECI_H
|
#define Z_ECI_H
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
#ifndef Z_GENERAL_FIELD_H
|
#ifndef Z_GENERAL_FIELD_H
|
||||||
#define Z_GENERAL_FIELD_H
|
#define Z_GENERAL_FIELD_H
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
/* gs1.h - Verifies GS1 data */
|
/* gs1.h - Verifies GS1 data */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2009-2022 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2009-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
@ -29,6 +28,8 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
#ifndef Z_GS1_H
|
#ifndef Z_GS1_H
|
||||||
#define Z_GS1_H
|
#define Z_GS1_H
|
||||||
|
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
/* imail.c - Handles Intelligent Mail (aka OneCode) for USPS */
|
/* imail.c - Handles Intelligent Mail (aka OneCode) for USPS */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2008 - 2021 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2008-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
@ -29,14 +28,14 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
/* vim: set ts=4 sw=4 et : */
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
/* The function "USPS_MSB_Math_CRC11GenerateFrameCheckSequence"
|
/* The function "USPS_MSB_Math_CRC11GenerateFrameCheckSequence"
|
||||||
is Copyright (C) 2006 United States Postal Service */
|
is Copyright (C) 2006 United States Postal Service */
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "large.h"
|
#include "large.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#define SODIUM_MNS_F (IS_NUM_F | IS_MNS_F) /* SODIUM "0123456789-" */
|
#define SODIUM_MNS_F (IS_NUM_F | IS_MNS_F) /* SODIUM "0123456789-" */
|
||||||
|
|
||||||
@ -187,7 +186,7 @@ static const unsigned short AppxD_II[78] = {
|
|||||||
0x0801, 0x1002, 0x1001, 0x0802, 0x0404, 0x0208, 0x0110, 0x00A0
|
0x0801, 0x1002, 0x1001, 0x0802, 0x0404, 0x0208, 0x0110, 0x00A0
|
||||||
};
|
};
|
||||||
|
|
||||||
static const unsigned short int AppxD_IV[130] = {
|
static const unsigned short AppxD_IV[130] = {
|
||||||
/* Appendix D Table IV - Bar-to-Character Mapping (reverse lookup) */
|
/* Appendix D Table IV - Bar-to-Character Mapping (reverse lookup) */
|
||||||
67, 6, 78, 16, 86, 95, 34, 40, 45, 113, 117, 121, 62, 87, 18, 104, 41, 76, 57, 119, 115, 72, 97,
|
67, 6, 78, 16, 86, 95, 34, 40, 45, 113, 117, 121, 62, 87, 18, 104, 41, 76, 57, 119, 115, 72, 97,
|
||||||
2, 127, 26, 105, 35, 122, 52, 114, 7, 24, 82, 68, 63, 94, 44, 77, 112, 70, 100, 39, 30, 107,
|
2, 127, 26, 105, 35, 122, 52, 114, 7, 24, 82, 68, 63, 94, 44, 77, 112, 70, 100, 39, 30, 107,
|
||||||
@ -255,7 +254,7 @@ INTERNAL int usps_imail(struct zint_symbol *symbol, unsigned char source[], int
|
|||||||
unsigned short usps_crc;
|
unsigned short usps_crc;
|
||||||
unsigned int codeword[10];
|
unsigned int codeword[10];
|
||||||
unsigned short characters[10];
|
unsigned short characters[10];
|
||||||
short int bar_map[130];
|
short bar_map[130];
|
||||||
int zip_len, len;
|
int zip_len, len;
|
||||||
|
|
||||||
if (length > 32) {
|
if (length > 32) {
|
||||||
@ -453,3 +452,5 @@ INTERNAL int usps_imail(struct zint_symbol *symbol, unsigned char source[], int
|
|||||||
symbol->width = read - 1;
|
symbol->width = read - 1;
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* vim: set ts=4 sw=4 et : */
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2021 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2021-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
@ -30,9 +30,10 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
#ifndef ISO3166_H
|
#ifndef Z_ISO3166_H
|
||||||
#define ISO3166_H
|
#define Z_ISO3166_H
|
||||||
|
|
||||||
/* Whether ISO 3166-1 numeric */
|
/* Whether ISO 3166-1 numeric */
|
||||||
static int iso3166_numeric(int cc) {
|
static int iso3166_numeric(int cc) {
|
||||||
@ -85,4 +86,4 @@ static int iso3166_alpha2(const char *cc) {
|
|||||||
return codes[cc_int >> 3] & (1 << (cc_int & 0x7)) ? 1 : 0;
|
return codes[cc_int >> 3] & (1 << (cc_int & 0x7)) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* ISO3166_H */
|
#endif /* Z_ISO3166_H */
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
/* maxicode.h - Handles Maxicode */
|
/* maxicode.h - Handles Maxicode */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2008-2017 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2008-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
@ -29,41 +28,45 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
static const unsigned short int MaxiGrid[] = {
|
#ifndef Z_MAXICODE_H
|
||||||
|
#define Z_MAXICODE_H
|
||||||
|
|
||||||
|
static const unsigned short MaxiGrid[] = {
|
||||||
/* ISO/IEC 16023 Figure 5 - MaxiCode Module Sequence */ /* 30 x 33 data grid */
|
/* ISO/IEC 16023 Figure 5 - MaxiCode Module Sequence */ /* 30 x 33 data grid */
|
||||||
122, 121, 128, 127, 134, 133, 140, 139, 146, 145, 152, 151, 158, 157, 164, 163, 170, 169, 176, 175, 182, 181, 188, 187, 194, 193, 200, 199, 0, 0,
|
122, 121, 128, 127, 134, 133, 140, 139, 146, 145, 152, 151, 158, 157, 164, 163, 170, 169, 176, 175, 182, 181, 188, 187, 194, 193, 200, 199, 0, 0,
|
||||||
124, 123, 130, 129, 136, 135, 142, 141, 148, 147, 154, 153, 160, 159, 166, 165, 172, 171, 178, 177, 184, 183, 190, 189, 196, 195, 202, 201, 817, 0,
|
124, 123, 130, 129, 136, 135, 142, 141, 148, 147, 154, 153, 160, 159, 166, 165, 172, 171, 178, 177, 184, 183, 190, 189, 196, 195, 202, 201, 817, 0,
|
||||||
126, 125, 132, 131, 138, 137, 144, 143, 150, 149, 156, 155, 162, 161, 168, 167, 174, 173, 180, 179, 186, 185, 192, 191, 198, 197, 204, 203, 819, 818,
|
126, 125, 132, 131, 138, 137, 144, 143, 150, 149, 156, 155, 162, 161, 168, 167, 174, 173, 180, 179, 186, 185, 192, 191, 198, 197, 204, 203, 819, 818,
|
||||||
284, 283, 278, 277, 272, 271, 266, 265, 260, 259, 254, 253, 248, 247, 242, 241, 236, 235, 230, 229, 224, 223, 218, 217, 212, 211, 206, 205, 820, 0,
|
284, 283, 278, 277, 272, 271, 266, 265, 260, 259, 254, 253, 248, 247, 242, 241, 236, 235, 230, 229, 224, 223, 218, 217, 212, 211, 206, 205, 820, 0,
|
||||||
286, 285, 280, 279, 274, 273, 268, 267, 262, 261, 256, 255, 250, 249, 244, 243, 238, 237, 232, 231, 226, 225, 220, 219, 214, 213, 208, 207, 822, 821,
|
286, 285, 280, 279, 274, 273, 268, 267, 262, 261, 256, 255, 250, 249, 244, 243, 238, 237, 232, 231, 226, 225, 220, 219, 214, 213, 208, 207, 822, 821,
|
||||||
288, 287, 282, 281, 276, 275, 270, 269, 264, 263, 258, 257, 252, 251, 246, 245, 240, 239, 234, 233, 228, 227, 222, 221, 216, 215, 210, 209, 823, 0,
|
288, 287, 282, 281, 276, 275, 270, 269, 264, 263, 258, 257, 252, 251, 246, 245, 240, 239, 234, 233, 228, 227, 222, 221, 216, 215, 210, 209, 823, 0,
|
||||||
290, 289, 296, 295, 302, 301, 308, 307, 314, 313, 320, 319, 326, 325, 332, 331, 338, 337, 344, 343, 350, 349, 356, 355, 362, 361, 368, 367, 825, 824,
|
290, 289, 296, 295, 302, 301, 308, 307, 314, 313, 320, 319, 326, 325, 332, 331, 338, 337, 344, 343, 350, 349, 356, 355, 362, 361, 368, 367, 825, 824,
|
||||||
292, 291, 298, 297, 304, 303, 310, 309, 316, 315, 322, 321, 328, 327, 334, 333, 340, 339, 346, 345, 352, 351, 358, 357, 364, 363, 370, 369, 826, 0,
|
292, 291, 298, 297, 304, 303, 310, 309, 316, 315, 322, 321, 328, 327, 334, 333, 340, 339, 346, 345, 352, 351, 358, 357, 364, 363, 370, 369, 826, 0,
|
||||||
294, 293, 300, 299, 306, 305, 312, 311, 318, 317, 324, 323, 330, 329, 336, 335, 342, 341, 348, 347, 354, 353, 360, 359, 366, 365, 372, 371, 828, 827,
|
294, 293, 300, 299, 306, 305, 312, 311, 318, 317, 324, 323, 330, 329, 336, 335, 342, 341, 348, 347, 354, 353, 360, 359, 366, 365, 372, 371, 828, 827,
|
||||||
410, 409, 404, 403, 398, 397, 392, 391, 80, 79, 0, 0, 14, 13, 38, 37, 3, 0, 45, 44, 110, 109, 386, 385, 380, 379, 374, 373, 829, 0,
|
410, 409, 404, 403, 398, 397, 392, 391, 80, 79, 0, 0, 14, 13, 38, 37, 3, 0, 45, 44, 110, 109, 386, 385, 380, 379, 374, 373, 829, 0,
|
||||||
412, 411, 406, 405, 400, 399, 394, 393, 82, 81, 41, 0, 16, 15, 40, 39, 4, 0, 0, 46, 112, 111, 388, 387, 382, 381, 376, 375, 831, 830,
|
412, 411, 406, 405, 400, 399, 394, 393, 82, 81, 41, 0, 16, 15, 40, 39, 4, 0, 0, 46, 112, 111, 388, 387, 382, 381, 376, 375, 831, 830,
|
||||||
414, 413, 408, 407, 402, 401, 396, 395, 84, 83, 42, 0, 0, 0, 0, 0, 6, 5, 48, 47, 114, 113, 390, 389, 384, 383, 378, 377, 832, 0,
|
414, 413, 408, 407, 402, 401, 396, 395, 84, 83, 42, 0, 0, 0, 0, 0, 6, 5, 48, 47, 114, 113, 390, 389, 384, 383, 378, 377, 832, 0,
|
||||||
416, 415, 422, 421, 428, 427, 104, 103, 56, 55, 17, 0, 0, 0, 0, 0, 0, 0, 21, 20, 86, 85, 434, 433, 440, 439, 446, 445, 834, 833,
|
416, 415, 422, 421, 428, 427, 104, 103, 56, 55, 17, 0, 0, 0, 0, 0, 0, 0, 21, 20, 86, 85, 434, 433, 440, 439, 446, 445, 834, 833,
|
||||||
418, 417, 424, 423, 430, 429, 106, 105, 58, 57, 0, 0, 0, 0, 0, 0, 0, 0, 23, 22, 88, 87, 436, 435, 442, 441, 448, 447, 835, 0,
|
418, 417, 424, 423, 430, 429, 106, 105, 58, 57, 0, 0, 0, 0, 0, 0, 0, 0, 23, 22, 88, 87, 436, 435, 442, 441, 448, 447, 835, 0,
|
||||||
420, 419, 426, 425, 432, 431, 108, 107, 60, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 90, 89, 438, 437, 444, 443, 450, 449, 837, 836,
|
420, 419, 426, 425, 432, 431, 108, 107, 60, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 90, 89, 438, 437, 444, 443, 450, 449, 837, 836,
|
||||||
482, 481, 476, 475, 470, 469, 49, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 54, 53, 464, 463, 458, 457, 452, 451, 838, 0,
|
482, 481, 476, 475, 470, 469, 49, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 54, 53, 464, 463, 458, 457, 452, 451, 838, 0,
|
||||||
484, 483, 478, 477, 472, 471, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 466, 465, 460, 459, 454, 453, 840, 839,
|
484, 483, 478, 477, 472, 471, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 466, 465, 460, 459, 454, 453, 840, 839,
|
||||||
486, 485, 480, 479, 474, 473, 52, 51, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 43, 468, 467, 462, 461, 456, 455, 841, 0,
|
486, 485, 480, 479, 474, 473, 52, 51, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 43, 468, 467, 462, 461, 456, 455, 841, 0,
|
||||||
488, 487, 494, 493, 500, 499, 98, 97, 62, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 92, 91, 506, 505, 512, 511, 518, 517, 843, 842,
|
488, 487, 494, 493, 500, 499, 98, 97, 62, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 92, 91, 506, 505, 512, 511, 518, 517, 843, 842,
|
||||||
490, 489, 496, 495, 502, 501, 100, 99, 64, 63, 0, 0, 0, 0, 0, 0, 0, 0, 29, 28, 94, 93, 508, 507, 514, 513, 520, 519, 844, 0,
|
490, 489, 496, 495, 502, 501, 100, 99, 64, 63, 0, 0, 0, 0, 0, 0, 0, 0, 29, 28, 94, 93, 508, 507, 514, 513, 520, 519, 844, 0,
|
||||||
492, 491, 498, 497, 504, 503, 102, 101, 66, 65, 18, 0, 0, 0, 0, 0, 0, 0, 19, 30, 96, 95, 510, 509, 516, 515, 522, 521, 846, 845,
|
492, 491, 498, 497, 504, 503, 102, 101, 66, 65, 18, 0, 0, 0, 0, 0, 0, 0, 19, 30, 96, 95, 510, 509, 516, 515, 522, 521, 846, 845,
|
||||||
560, 559, 554, 553, 548, 547, 542, 541, 74, 73, 33, 0, 0, 0, 0, 0, 0, 11, 68, 67, 116, 115, 536, 535, 530, 529, 524, 523, 847, 0,
|
560, 559, 554, 553, 548, 547, 542, 541, 74, 73, 33, 0, 0, 0, 0, 0, 0, 11, 68, 67, 116, 115, 536, 535, 530, 529, 524, 523, 847, 0,
|
||||||
562, 561, 556, 555, 550, 549, 544, 543, 76, 75, 0, 0, 8, 7, 36, 35, 12, 0, 70, 69, 118, 117, 538, 537, 532, 531, 526, 525, 849, 848,
|
562, 561, 556, 555, 550, 549, 544, 543, 76, 75, 0, 0, 8, 7, 36, 35, 12, 0, 70, 69, 118, 117, 538, 537, 532, 531, 526, 525, 849, 848,
|
||||||
564, 563, 558, 557, 552, 551, 546, 545, 78, 77, 0, 34, 10, 9, 26, 25, 0, 0, 72, 71, 120, 119, 540, 539, 534, 533, 528, 527, 850, 0,
|
564, 563, 558, 557, 552, 551, 546, 545, 78, 77, 0, 34, 10, 9, 26, 25, 0, 0, 72, 71, 120, 119, 540, 539, 534, 533, 528, 527, 850, 0,
|
||||||
566, 565, 572, 571, 578, 577, 584, 583, 590, 589, 596, 595, 602, 601, 608, 607, 614, 613, 620, 619, 626, 625, 632, 631, 638, 637, 644, 643, 852, 851,
|
566, 565, 572, 571, 578, 577, 584, 583, 590, 589, 596, 595, 602, 601, 608, 607, 614, 613, 620, 619, 626, 625, 632, 631, 638, 637, 644, 643, 852, 851,
|
||||||
568, 567, 574, 573, 580, 579, 586, 585, 592, 591, 598, 597, 604, 603, 610, 609, 616, 615, 622, 621, 628, 627, 634, 633, 640, 639, 646, 645, 853, 0,
|
568, 567, 574, 573, 580, 579, 586, 585, 592, 591, 598, 597, 604, 603, 610, 609, 616, 615, 622, 621, 628, 627, 634, 633, 640, 639, 646, 645, 853, 0,
|
||||||
570, 569, 576, 575, 582, 581, 588, 587, 594, 593, 600, 599, 606, 605, 612, 611, 618, 617, 624, 623, 630, 629, 636, 635, 642, 641, 648, 647, 855, 854,
|
570, 569, 576, 575, 582, 581, 588, 587, 594, 593, 600, 599, 606, 605, 612, 611, 618, 617, 624, 623, 630, 629, 636, 635, 642, 641, 648, 647, 855, 854,
|
||||||
728, 727, 722, 721, 716, 715, 710, 709, 704, 703, 698, 697, 692, 691, 686, 685, 680, 679, 674, 673, 668, 667, 662, 661, 656, 655, 650, 649, 856, 0,
|
728, 727, 722, 721, 716, 715, 710, 709, 704, 703, 698, 697, 692, 691, 686, 685, 680, 679, 674, 673, 668, 667, 662, 661, 656, 655, 650, 649, 856, 0,
|
||||||
730, 729, 724, 723, 718, 717, 712, 711, 706, 705, 700, 699, 694, 693, 688, 687, 682, 681, 676, 675, 670, 669, 664, 663, 658, 657, 652, 651, 858, 857,
|
730, 729, 724, 723, 718, 717, 712, 711, 706, 705, 700, 699, 694, 693, 688, 687, 682, 681, 676, 675, 670, 669, 664, 663, 658, 657, 652, 651, 858, 857,
|
||||||
732, 731, 726, 725, 720, 719, 714, 713, 708, 707, 702, 701, 696, 695, 690, 689, 684, 683, 678, 677, 672, 671, 666, 665, 660, 659, 654, 653, 859, 0,
|
732, 731, 726, 725, 720, 719, 714, 713, 708, 707, 702, 701, 696, 695, 690, 689, 684, 683, 678, 677, 672, 671, 666, 665, 660, 659, 654, 653, 859, 0,
|
||||||
734, 733, 740, 739, 746, 745, 752, 751, 758, 757, 764, 763, 770, 769, 776, 775, 782, 781, 788, 787, 794, 793, 800, 799, 806, 805, 812, 811, 861, 860,
|
734, 733, 740, 739, 746, 745, 752, 751, 758, 757, 764, 763, 770, 769, 776, 775, 782, 781, 788, 787, 794, 793, 800, 799, 806, 805, 812, 811, 861, 860,
|
||||||
736, 735, 742, 741, 748, 747, 754, 753, 760, 759, 766, 765, 772, 771, 778, 777, 784, 783, 790, 789, 796, 795, 802, 801, 808, 807, 814, 813, 862, 0,
|
736, 735, 742, 741, 748, 747, 754, 753, 760, 759, 766, 765, 772, 771, 778, 777, 784, 783, 790, 789, 796, 795, 802, 801, 808, 807, 814, 813, 862, 0,
|
||||||
738, 737, 744, 743, 750, 749, 756, 755, 762, 761, 768, 767, 774, 773, 780, 779, 786, 785, 792, 791, 798, 797, 804, 803, 810, 809, 816, 815, 864, 863
|
738, 737, 744, 743, 750, 749, 756, 755, 762, 761, 768, 767, 774, 773, 780, 779, 786, 785, 792, 791, 798, 797, 804, 803, 810, 809, 816, 815, 864, 863
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -102,3 +105,5 @@ static const char maxiSymbolChar[256] = {
|
|||||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 32, 33, 34, 35, 36
|
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 32, 33, 34, 35, 36
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* vim: set ts=4 sw=4 et : */
|
||||||
|
#endif /* Z_MAXICODE_H */
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
/* medical.c - Handles 1 track and 2 track pharmacode and Codabar */
|
/* medical.c - Handles 1 track and 2 track pharmacode and Codabar */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2008-2022 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2008-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
@ -29,9 +28,10 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
INTERNAL int code39(struct zint_symbol *symbol, unsigned char source[], int length);
|
INTERNAL int code39(struct zint_symbol *symbol, unsigned char source[], int length);
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/* output.h - Common routines for raster/vector
|
/* output.h - Common routines for raster/vector */
|
||||||
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2020 - 2021 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2020-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
@ -28,7 +28,7 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
/* vim: set ts=4 sw=4 et : */
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
#ifndef Z_OUTPUT_H
|
#ifndef Z_OUTPUT_H
|
||||||
#define Z_OUTPUT_H
|
#define Z_OUTPUT_H
|
||||||
@ -52,4 +52,5 @@ INTERNAL void out_upcean_split_text(int upceanflag, unsigned char text[],
|
|||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
/* vim: set ts=4 sw=4 et : */
|
||||||
#endif /* Z_OUTPUT_H */
|
#endif /* Z_OUTPUT_H */
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
/* pdf417.h - PDF417 tables and coefficients declarations */
|
/* pdf417.h - PDF417 tables and coefficients declarations */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2008-2022 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2008-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
@ -30,6 +29,7 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
/* See "pdf417_tabs.h" for table definitions */
|
/* See "pdf417_tabs.h" for table definitions */
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
/* pdf417_tabs.h - PDF417 tables and coefficients */
|
/* pdf417_tabs.h - PDF417 tables and coefficients */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2008-2022 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2008-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
@ -30,6 +29,7 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
/* this file contains the character table, the pre-calculated coefficients and the
|
/* this file contains the character table, the pre-calculated coefficients and the
|
||||||
codeword patterns taken from lines 416 to 454 of pdf417.frm */
|
codeword patterns taken from lines 416 to 454 of pdf417.frm */
|
||||||
|
@ -145,7 +145,7 @@ static int postnet_enc(struct zint_symbol *symbol, const unsigned char source[],
|
|||||||
strcpy(symbol->errtxt, "480: Input too long (38 character maximum)");
|
strcpy(symbol->errtxt, "480: Input too long (38 character maximum)");
|
||||||
return ZINT_ERROR_TOO_LONG;
|
return ZINT_ERROR_TOO_LONG;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (symbol->symbology == BARCODE_CEPNET) {
|
if (symbol->symbology == BARCODE_CEPNET) {
|
||||||
if (length != 8) {
|
if (length != 8) {
|
||||||
strcpy(symbol->errtxt, "780: Input is wrong length (should be 8 digits)");
|
strcpy(symbol->errtxt, "780: Input is wrong length (should be 8 digits)");
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
This is a simple Reed-Solomon encoder
|
This is a simple Reed-Solomon encoder
|
||||||
(C) Cliff Hones 2004
|
(C) Cliff Hones 2004
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
libzint - the open source barcode library
|
||||||
|
Copyright (C) 2009-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
@ -29,7 +32,7 @@
|
|||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
/* vim: set ts=4 sw=4 et : */
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
#ifndef Z_REEDSOL_H
|
#ifndef Z_REEDSOL_H
|
||||||
#define Z_REEDSOL_H
|
#define Z_REEDSOL_H
|
||||||
@ -72,4 +75,5 @@ INTERNAL void rs_uint_free(rs_uint_t *rs_uint);
|
|||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
/* vim: set ts=4 sw=4 et : */
|
||||||
#endif /* Z_REEDSOL_H */
|
#endif /* Z_REEDSOL_H */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/* reedsol_logs.h - Log and antilog tables for Reed-Solomon
|
/* reedsol_logs.h - Log and antilog tables for Reed-Solomon */
|
||||||
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2020 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2020-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
@ -28,10 +28,10 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
/* vim: set ts=4 sw=4 et : */
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
#ifndef REEDSOL_LOGS_H
|
#ifndef Z_REEDSOL_LOGS_H
|
||||||
#define REEDSOL_LOGS_H
|
#define Z_REEDSOL_LOGS_H
|
||||||
|
|
||||||
/* Static log/antilog tables for prime polys of up to degree 8 (> 8 too large so generated at runtime instead).
|
/* Static log/antilog tables for prime polys of up to degree 8 (> 8 too large so generated at runtime instead).
|
||||||
* Antilog tables doubled to avoid mod. */
|
* Antilog tables doubled to avoid mod. */
|
||||||
@ -261,4 +261,5 @@ static const unsigned char alog_0x163[510] = {
|
|||||||
0x4C, 0x98, 0x53, 0xA6, 0x2F, 0x5E, 0xBC, 0x1B, 0x36, 0x6C, 0xD8, 0xD3, 0xC5, 0xE9, 0xB1,
|
0x4C, 0x98, 0x53, 0xA6, 0x2F, 0x5E, 0xBC, 0x1B, 0x36, 0x6C, 0xD8, 0xD3, 0xC5, 0xE9, 0xB1,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* REEDSOL_LOGS_H */
|
/* vim: set ts=4 sw=4 et : */
|
||||||
|
#endif /* Z_REEDSOL_LOGS_H */
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
/* rss.h - Data tables for Reduced Space Symbology */
|
/* rss.h - Data tables for Reduced Space Symbology */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2007 - 2020 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2007-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
@ -29,10 +28,13 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
/* vim: set ts=4 sw=4 et : */
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
|
#ifndef Z_RSS_H
|
||||||
|
#define Z_RSS_H
|
||||||
|
|
||||||
/* RSS-14 Tables */
|
/* RSS-14 Tables */
|
||||||
static const unsigned short int g_sum_table[9] = {
|
static const unsigned short g_sum_table[9] = {
|
||||||
0, 161, 961, 2015, 2715, 0, 336, 1036, 1516
|
0, 161, 961, 2015, 2715, 0, 336, 1036, 1516
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -77,7 +79,7 @@ static const char checksum_weight[32] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* RSS Limited Tables */
|
/* RSS Limited Tables */
|
||||||
static const unsigned short int t_even_ltd[7] = {
|
static const unsigned short t_even_ltd[7] = {
|
||||||
28, 728, 6454, 203, 2408, 1, 16632
|
28, 728, 6454, 203, 2408, 1, 16632
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -196,11 +198,11 @@ static const char finder_pattern_ltd[1246] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* RSS Expanded Tables */
|
/* RSS Expanded Tables */
|
||||||
static const unsigned short int g_sum_exp[5] = {
|
static const unsigned short g_sum_exp[5] = {
|
||||||
0, 348, 1388, 2948, 3988
|
0, 348, 1388, 2948, 3988
|
||||||
};
|
};
|
||||||
|
|
||||||
static const unsigned short int t_even_exp[5] = {
|
static const unsigned short t_even_exp[5] = {
|
||||||
4, 20, 52, 104, 204
|
4, 20, 52, 104, 204
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -220,7 +222,7 @@ static const char widest_even_exp[5] = {
|
|||||||
2, 4, 5, 6, 8
|
2, 4, 5, 6, 8
|
||||||
};
|
};
|
||||||
|
|
||||||
static const unsigned short int checksum_weight_exp[184] = {
|
static const unsigned short checksum_weight_exp[184] = {
|
||||||
/* Table 14 */
|
/* Table 14 */
|
||||||
1, 3, 9, 27, 81, 32, 96, 77,
|
1, 3, 9, 27, 81, 32, 96, 77,
|
||||||
20, 60, 180, 118, 143, 7, 21, 63,
|
20, 60, 180, 118, 143, 7, 21, 63,
|
||||||
@ -290,3 +292,5 @@ static const char weight_rows[210] = {
|
|||||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 13, 14, 11, 12, 17, 18, 15, 16, 21, 22, 19, 20
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 13, 14, 11, 12, 17, 18, 15, 16, 21, 22, 19, 20
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* vim: set ts=4 sw=4 et : */
|
||||||
|
#endif /* Z_RSS_H */
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
/* telepen.c - Handles Telepen and Telepen numeric */
|
/* telepen.c - Handles Telepen and Telepen numeric */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2008-2021 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2008-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
@ -29,15 +28,15 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
/* vim: set ts=4 sw=4 et : */
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
/* Telepen Barcode Symbology information and History (BSiH)
|
/* Telepen Barcode Symbology information and History (BSiH)
|
||||||
https://telepen.co.uk/wp-content/uploads/2018/10/Barcode-Symbology-information-and-History.pdf */
|
https://telepen.co.uk/wp-content/uploads/2018/10/Barcode-Symbology-information-and-History.pdf */
|
||||||
|
|
||||||
#define SODIUM_X_F (IS_NUM_F | IS_UX__F | IS_LX__F) /* SODIUM "0123456789Xx" */
|
#define SODIUM_X_F (IS_NUM_F | IS_UX__F | IS_LX__F) /* SODIUM "0123456789Xx" */
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
static const char TeleTable[128][16] = {
|
static const char TeleTable[128][16] = {
|
||||||
{ "31313131" }, { "1131313111" }, { "33313111" }, { "1111313131" },
|
{ "31313131" }, { "1131313111" }, { "33313111" }, { "1111313131" },
|
||||||
@ -74,6 +73,7 @@ static const char TeleTable[128][16] = {
|
|||||||
{ "31111111111111" }, { "111311111113" }, { "131111111113" },
|
{ "31111111111111" }, { "111311111113" }, { "131111111113" },
|
||||||
{'1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1'},
|
{'1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1'},
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Generated by "backend/tests/test_telepen -f generate_lens -g" */
|
/* Generated by "backend/tests/test_telepen -f generate_lens -g" */
|
||||||
static const char TeleLens[128] = {
|
static const char TeleLens[128] = {
|
||||||
8, 10, 8, 10, 10, 8, 8, 12, 8, 10, 8, 10, 10, 10, 10, 12,
|
8, 10, 8, 10, 10, 8, 8, 12, 8, 10, 8, 10, 10, 10, 10, 12,
|
||||||
@ -224,3 +224,5 @@ INTERNAL int telepen_num(struct zint_symbol *symbol, unsigned char source[], int
|
|||||||
ustrcpy(symbol->text, temp);
|
ustrcpy(symbol->text, temp);
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* vim: set ts=4 sw=4 et : */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/* tif_lzw.h - LZW compression for TIFF
|
/* tif_lzw.h - LZW compression for TIFF */
|
||||||
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2021 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2021-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
@ -28,10 +28,10 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
/* vim: set ts=4 sw=4 et : */
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
#ifndef TIF_LZW_H
|
#ifndef Z_TIF_LZW_H
|
||||||
#define TIF_LZW_H
|
#define Z_TIF_LZW_H
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Adapted from TIFF Library 4.2.0 libtiff/tif_lzw.c */
|
* Adapted from TIFF Library 4.2.0 libtiff/tif_lzw.c */
|
||||||
@ -370,4 +370,5 @@ static void tif_lzw_init(tif_lzw_state *sp) {
|
|||||||
sp->enc_hashtab = NULL;
|
sp->enc_hashtab = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TIF_LZW_H */
|
/* vim: set ts=4 sw=4 et : */
|
||||||
|
#endif /* Z_TIF_LZW_H */
|
||||||
|
@ -2,13 +2,14 @@
|
|||||||
/* Generate ISO 3166 include "backend/iso3166.h" for "backend/gs1.c" */
|
/* Generate ISO 3166 include "backend/iso3166.h" for "backend/gs1.c" */
|
||||||
/*
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2021 <rstuart114@gmail.com>
|
Copyright (C) 2021-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
*/
|
*/
|
||||||
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
/* To create "backend/iso3166.h" (from project directory):
|
/* To create "backend/iso3166.h" (from project directory):
|
||||||
*
|
*
|
||||||
* php backend/tools/gen_iso3166_h.php > backend/iso3166.h
|
* php backend/tools/gen_iso3166_h.php > backend/iso3166.h
|
||||||
*/
|
*/
|
||||||
/* vim: set ts=4 sw=4 et : */
|
|
||||||
|
|
||||||
$basename = basename(__FILE__);
|
$basename = basename(__FILE__);
|
||||||
$dirname = dirname(__FILE__);
|
$dirname = dirname(__FILE__);
|
||||||
@ -122,7 +123,7 @@ if ($print_copyright) {
|
|||||||
print <<<'EOD'
|
print <<<'EOD'
|
||||||
/*
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2021 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2021-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
@ -149,6 +150,7 @@ print <<<'EOD'
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
|
|
||||||
EOD;
|
EOD;
|
||||||
@ -156,8 +158,8 @@ EOD;
|
|||||||
|
|
||||||
if ($print_h_guard) {
|
if ($print_h_guard) {
|
||||||
print <<<'EOD'
|
print <<<'EOD'
|
||||||
#ifndef ISO3166_H
|
#ifndef Z_ISO3166_H
|
||||||
#define ISO3166_H
|
#define Z_ISO3166_H
|
||||||
|
|
||||||
EOD;
|
EOD;
|
||||||
}
|
}
|
||||||
@ -219,7 +221,9 @@ EOD;
|
|||||||
if ($print_h_guard) {
|
if ($print_h_guard) {
|
||||||
print <<<'EOD'
|
print <<<'EOD'
|
||||||
|
|
||||||
#endif /* ISO3166_H */
|
#endif /* Z_ISO3166_H */
|
||||||
|
|
||||||
EOD;
|
EOD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* vim: set ts=4 sw=4 et : */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/* zintconfig.h - the configured options and settings for libzint
|
/* zintconfig.h - the configured options and settings for libzint */
|
||||||
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2021 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2021-2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
@ -28,7 +28,7 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
/* vim: set ts=4 sw=4 et : */
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
#ifndef ZINTCONFIG_H
|
#ifndef ZINTCONFIG_H
|
||||||
#define ZINTCONFIG_H
|
#define ZINTCONFIG_H
|
||||||
@ -38,4 +38,5 @@
|
|||||||
#define ZINT_VERSION_RELEASE 1
|
#define ZINT_VERSION_RELEASE 1
|
||||||
#define ZINT_VERSION_BUILD 9
|
#define ZINT_VERSION_BUILD 9
|
||||||
|
|
||||||
|
/* vim: set ts=4 sw=4 et : */
|
||||||
#endif /* ZINTCONFIG_H */
|
#endif /* ZINTCONFIG_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user