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:
gitlost 2022-09-13 21:16:31 +01:00
parent ee23f92151
commit e1522e0808
29 changed files with 500 additions and 510 deletions

View File

@ -1,6 +1,6 @@
/*
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
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
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 */
/* 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, }, },
{ 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

View File

@ -1,8 +1,7 @@
/* code1.h - Lookup info for USS Code One */
/*
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
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
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[] = {
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
};
static const unsigned short int c1_height[] = {
static const unsigned short c1_height[] = {
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
};
static const unsigned short int c1_data_length[] = {
static const unsigned short c1_data_length[] = {
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
};
static const unsigned short int c1_blocks[] = {
static const unsigned short c1_blocks[] = {
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
};
static const unsigned short int c1_ecc_blocks[] = {
static const unsigned short c1_ecc_blocks[] = {
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
};
static const unsigned short int c1_grid_height[] = {
static const unsigned short c1_grid_height[] = {
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_EDI 5
#define C1_BYTE 6
/* vim: set ts=4 sw=4 et : */
#endif /* Z_CODE1_H */

View File

@ -1,6 +1,6 @@
/*
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
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
SUCH DAMAGE.
*/
/* vim: set ts=4 sw=4 et : */
/* SPDX-License-Identifier: BSD-3-Clause */
#ifndef CODE128_H
#define CODE128_H
#ifndef Z_CODE128_H
#define Z_CODE128_H
#ifdef __cplusplus
extern "C" {
@ -63,4 +63,5 @@ INTERNAL_DATA_EXTERN const char C128Table[107][6];
}
#endif /* __cplusplus */
#endif /* CODE128_H */
/* vim: set ts=4 sw=4 et : */
#endif /* Z_CODE128_H */

View File

@ -1,8 +1,7 @@
/* code16k.c - Handles Code 16k stacked symbology */
/*
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
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
SUCH DAMAGE.
*/
/* vim: set ts=4 sw=4 et : */
/* SPDX-License-Identifier: BSD-3-Clause */
/* Updated to comply with BS EN 12323:2005 */
/* Code 16k can hold up to 77 characters or 154 numbers */
#include <stdio.h>
#include <assert.h>
#include "common.h"
#include "code128.h"
#include <assert.h>
#include <stdio.h>
/* 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;
}
/* vim: set ts=4 sw=4 et : */

View File

@ -1,8 +1,7 @@
/* code49.h - Code 49 Tables */
/*
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
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
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 */
@ -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'}
};
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) */
0xBE5C, 0xC16E, 0x86DC, 0xC126, 0x864C, 0x9EDC, 0xC726, 0x9E4C, 0xDF26, 0x82CC,
0x8244, 0x8ECC, 0xC322, 0x8E44, 0xBECC, 0xCF22, 0xBE44, 0xC162, 0x86C4, 0xC762,
@ -317,7 +319,7 @@ static const unsigned short int c49_even_bitpattern[] = {
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) */
0xC940, 0xF250, 0xECA0, 0xFB28, 0xE5A0, 0xF968, 0xDB40, 0xF6D0, 0xFDB4, 0xC4A0,
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,
0xAEFC
};
/* vim: set ts=4 sw=4 et : */
#endif /* Z_CODE49_H */

View File

@ -1,8 +1,7 @@
/* composite.c - Tables for UCC.EAN Composite Symbols */
/*
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
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
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 */
static const unsigned short int ccaCoeffs[30] = {
static const unsigned short ccaCoeffs[30] = {
/* k = 4 */
522, 568, 723, 809,
@ -138,3 +140,6 @@ static const UINT pwr928[69][7] = {
{ 231, 54, 222, 565, 282, 130, 192, },
{ 462, 108, 445, 202, 564, 260, 384, },
};
/* vim: set ts=4 sw=4 et : */
#endif /* Z_COMPOSITE_H */

View File

@ -1,8 +1,7 @@
/* Sed: http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/versions.asp */
/*
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
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
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))
#include <windows.h>
#include <shlwapi.h>
@ -40,14 +40,13 @@ extern "C"
{
#endif
__declspec(dllexport) HRESULT DllGetVersion (DLLVERSIONINFO2* pdvi);
__declspec(dllexport) HRESULT DllGetVersion(DLLVERSIONINFO2 *pdvi);
#ifdef __cplusplus
}
#endif
HRESULT DllGetVersion (DLLVERSIONINFO2* pdvi)
{
HRESULT DllGetVersion(DLLVERSIONINFO2 *pdvi) {
if (!pdvi || (sizeof(*pdvi) != pdvi->info1.cbSize))
return (E_INVALIDARG);
@ -64,4 +63,5 @@ HRESULT DllGetVersion (DLLVERSIONINFO2* pdvi)
#else
/* https://stackoverflow.com/a/26541331 Suppresses gcc warning ISO C forbids an empty translation unit */
typedef int make_iso_compilers_happy;
/* vim: set ts=4 sw=4 et : */
#endif /* _WIN32 */

View File

@ -75,11 +75,11 @@ static const char dm_text_value[] = {
};
/* Position in option array [symbol option value - 1]
// 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 index of this array is the --vers parameter value -1 and is given as first comment value */
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 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 */
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*/
@ -122,7 +122,7 @@ static const char dm_isDMRE[] = {
/* 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*/
/* 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*/
@ -139,7 +139,7 @@ static const unsigned short int dm_matrixH[] = {
/* 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 */
/* 4*/ 32, /* 8x32 */ 16, /* 16x16 */ 26, /* 12x26 */ 18, /* 18x18 */
/* 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) */
static const unsigned short int dm_matrixFH[] = {
static const unsigned short dm_matrixFH[] = {
/* 0*/ 10, /* 10x10 */ 12, /* 12x12 */ 8, /* 8x18 */ 14, /* 14x14 */
/* 4*/ 8, /* 8x32 */ 16, /* 16x16 */ 12, /* 12x26 */ 18, /* 18x18 */
/* 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) */
static const unsigned short int dm_matrixFW[] = {
static const unsigned short dm_matrixFW[] = {
/* 0*/ 10, /* 10x10 */ 12, /* 12x12 */ 18, /* 8x18 */ 14, /* 14x14 */
/* 4*/ 16, /* 8x32 */ 16, /* 16x16 */ 26, /* 12x26 */ 18, /* 18x18 */
/* 8*/ 24, /* 8x48 */ 20, /* 20x20 */ 18, /* 12x36 */ 16, /* 8x64 */
@ -191,7 +191,7 @@ static const unsigned short int dm_matrixFW[] = {
/* 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 */
/* 4*/ 10, /* 8x32 */ 12, /* 16x16 */ 16, /* 12x26 */ 18, /* 18x18 */
/* 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 */
static const unsigned short int dm_matrixdatablock[] = {
static const unsigned short dm_matrixdatablock[] = {
/* 0*/ 3, /* 10x10 */ 5, /* 12x12 */ 5, /* 8x18 */ 8, /* 14x14 */
/* 4*/ 10, /* 8x32 */ 12, /* 16x16 */ 16, /* 12x26 */ 18, /* 18x18 */
/* 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 */
static const unsigned short int dm_matrixrsblock[] = {
static const unsigned short dm_matrixrsblock[] = {
/* 0*/ 5, /* 10x10 */ 7, /* 12x12 */ 7, /* 8x18 */ 10, /* 14x14 */
/* 4*/ 11, /* 8x32 */ 12, /* 16x16 */ 14, /* 12x26 */ 14, /* 18x18 */
/* 8*/ 15, /* 8x48 */ 18, /* 20x20 */ 18, /* 12x36 */ 18, /* 8x64 */

View File

@ -1,8 +1,7 @@
/* dmatrix_trace.h - Trace routines for DM_COMPRESSION algorithm */
/*
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
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
SUCH DAMAGE.
*/
/* vim: set ts=4 sw=4 et : */
/* SPDX-License-Identifier: BSD-3-Clause */
#ifndef 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 */
/* vim: set ts=4 sw=4 et : */
#endif /* Z_DMATRIX_TRACE_H */

View File

@ -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
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
SUCH DAMAGE.
*/
/* SPDX-License-Identifier: BSD-3-Clause */
#ifndef Z_ECI_H
#define Z_ECI_H

View File

@ -27,6 +27,7 @@
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
*/
/* SPDX-License-Identifier: BSD-3-Clause */
#ifndef Z_GENERAL_FIELD_H
#define Z_GENERAL_FIELD_H

View File

@ -1,5 +1,4 @@
/* gs1.h - Verifies GS1 data */
/*
libzint - the open source barcode library
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
SUCH DAMAGE.
*/
/* SPDX-License-Identifier: BSD-3-Clause */
#ifndef Z_GS1_H
#define Z_GS1_H

View File

@ -1,8 +1,7 @@
/* imail.c - Handles Intelligent Mail (aka OneCode) for USPS */
/*
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
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
SUCH DAMAGE.
*/
/* vim: set ts=4 sw=4 et : */
/* SPDX-License-Identifier: BSD-3-Clause */
/* The function "USPS_MSB_Math_CRC11GenerateFrameCheckSequence"
is Copyright (C) 2006 United States Postal Service */
#include <stdio.h>
#include "common.h"
#include "large.h"
#include <stdio.h>
#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
};
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) */
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,
@ -255,7 +254,7 @@ INTERNAL int usps_imail(struct zint_symbol *symbol, unsigned char source[], int
unsigned short usps_crc;
unsigned int codeword[10];
unsigned short characters[10];
short int bar_map[130];
short bar_map[130];
int zip_len, len;
if (length > 32) {
@ -453,3 +452,5 @@ INTERNAL int usps_imail(struct zint_symbol *symbol, unsigned char source[], int
symbol->width = read - 1;
return error_number;
}
/* vim: set ts=4 sw=4 et : */

View File

@ -3,7 +3,7 @@
*/
/*
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
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
SUCH DAMAGE.
*/
/* SPDX-License-Identifier: BSD-3-Clause */
#ifndef ISO3166_H
#define ISO3166_H
#ifndef Z_ISO3166_H
#define Z_ISO3166_H
/* Whether ISO 3166-1 numeric */
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;
}
#endif /* ISO3166_H */
#endif /* Z_ISO3166_H */

View File

@ -1,8 +1,7 @@
/* maxicode.h - Handles Maxicode */
/*
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
modification, are permitted provided that the following conditions
@ -29,8 +28,12 @@
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
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 */
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,
@ -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
};
/* vim: set ts=4 sw=4 et : */
#endif /* Z_MAXICODE_H */

View File

@ -1,5 +1,4 @@
/* medical.c - Handles 1 track and 2 track pharmacode and Codabar */
/*
libzint - the open source barcode library
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
SUCH DAMAGE.
*/
/* SPDX-License-Identifier: BSD-3-Clause */
#include <stdio.h>
#include "common.h"
#include <stdio.h>
INTERNAL int code39(struct zint_symbol *symbol, unsigned char source[], int length);

View File

@ -1,7 +1,7 @@
/* output.h - Common routines for raster/vector
/* output.h - Common routines for raster/vector */
/*
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
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
SUCH DAMAGE.
*/
/* vim: set ts=4 sw=4 et : */
/* SPDX-License-Identifier: BSD-3-Clause */
#ifndef Z_OUTPUT_H
#define Z_OUTPUT_H
@ -52,4 +52,5 @@ INTERNAL void out_upcean_split_text(int upceanflag, unsigned char text[],
}
#endif /* __cplusplus */
/* vim: set ts=4 sw=4 et : */
#endif /* Z_OUTPUT_H */

View File

@ -1,5 +1,4 @@
/* pdf417.h - PDF417 tables and coefficients declarations */
/*
libzint - the open source barcode library
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
SUCH DAMAGE.
*/
/* SPDX-License-Identifier: BSD-3-Clause */
/* See "pdf417_tabs.h" for table definitions */

View File

@ -1,5 +1,4 @@
/* pdf417_tabs.h - PDF417 tables and coefficients */
/*
libzint - the open source barcode library
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
SUCH DAMAGE.
*/
/* SPDX-License-Identifier: BSD-3-Clause */
/* this file contains the character table, the pre-calculated coefficients and the
codeword patterns taken from lines 416 to 454 of pdf417.frm */

View File

@ -1,7 +1,10 @@
/*
This is a simple Reed-Solomon encoder
(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
modification, are permitted provided that the following conditions
@ -29,7 +32,7 @@
SUCH DAMAGE.
*/
/* vim: set ts=4 sw=4 et : */
/* SPDX-License-Identifier: BSD-3-Clause */
#ifndef Z_REEDSOL_H
#define Z_REEDSOL_H
@ -72,4 +75,5 @@ INTERNAL void rs_uint_free(rs_uint_t *rs_uint);
}
#endif /* __cplusplus */
/* vim: set ts=4 sw=4 et : */
#endif /* Z_REEDSOL_H */

View File

@ -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
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
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
SUCH DAMAGE.
*/
/* vim: set ts=4 sw=4 et : */
/* SPDX-License-Identifier: BSD-3-Clause */
#ifndef REEDSOL_LOGS_H
#define REEDSOL_LOGS_H
#ifndef Z_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).
* 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,
};
#endif /* REEDSOL_LOGS_H */
/* vim: set ts=4 sw=4 et : */
#endif /* Z_REEDSOL_LOGS_H */

View File

@ -1,8 +1,7 @@
/* rss.h - Data tables for Reduced Space Symbology */
/*
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
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
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 */
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
};
@ -77,7 +79,7 @@ static const char checksum_weight[32] = {
};
/* 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
};
@ -196,11 +198,11 @@ static const char finder_pattern_ltd[1246] = {
};
/* 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
};
static const unsigned short int t_even_exp[5] = {
static const unsigned short t_even_exp[5] = {
4, 20, 52, 104, 204
};
@ -220,7 +222,7 @@ static const char widest_even_exp[5] = {
2, 4, 5, 6, 8
};
static const unsigned short int checksum_weight_exp[184] = {
static const unsigned short checksum_weight_exp[184] = {
/* Table 14 */
1, 3, 9, 27, 81, 32, 96, 77,
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
};
/* vim: set ts=4 sw=4 et : */
#endif /* Z_RSS_H */

View File

@ -1,8 +1,7 @@
/* telepen.c - Handles Telepen and Telepen numeric */
/*
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
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
SUCH DAMAGE.
*/
/* vim: set ts=4 sw=4 et : */
/* SPDX-License-Identifier: BSD-3-Clause */
/* Telepen Barcode Symbology information and History (BSiH)
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" */
#include <stdio.h>
#include "common.h"
#include <stdio.h>
static const char TeleTable[128][16] = {
{ "31313131" }, { "1131313111" }, { "33313111" }, { "1111313131" },
@ -74,6 +73,7 @@ static const char TeleTable[128][16] = {
{ "31111111111111" }, { "111311111113" }, { "131111111113" },
{'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" */
static const char TeleLens[128] = {
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);
return error_number;
}
/* vim: set ts=4 sw=4 et : */

View File

@ -1,7 +1,7 @@
/* tif_lzw.h - LZW compression for TIFF
/* tif_lzw.h - LZW compression for TIFF */
/*
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
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
SUCH DAMAGE.
*/
/* vim: set ts=4 sw=4 et : */
/* SPDX-License-Identifier: BSD-3-Clause */
#ifndef TIF_LZW_H
#define TIF_LZW_H
#ifndef Z_TIF_LZW_H
#define Z_TIF_LZW_H
/*
* 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;
}
#endif /* TIF_LZW_H */
/* vim: set ts=4 sw=4 et : */
#endif /* Z_TIF_LZW_H */

View File

@ -2,13 +2,14 @@
/* Generate ISO 3166 include "backend/iso3166.h" for "backend/gs1.c" */
/*
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):
*
* php backend/tools/gen_iso3166_h.php > backend/iso3166.h
*/
/* vim: set ts=4 sw=4 et : */
$basename = basename(__FILE__);
$dirname = dirname(__FILE__);
@ -122,7 +123,7 @@ if ($print_copyright) {
print <<<'EOD'
/*
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
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
SUCH DAMAGE.
*/
/* SPDX-License-Identifier: BSD-3-Clause */
EOD;
@ -156,8 +158,8 @@ EOD;
if ($print_h_guard) {
print <<<'EOD'
#ifndef ISO3166_H
#define ISO3166_H
#ifndef Z_ISO3166_H
#define Z_ISO3166_H
EOD;
}
@ -219,7 +221,9 @@ EOD;
if ($print_h_guard) {
print <<<'EOD'
#endif /* ISO3166_H */
#endif /* Z_ISO3166_H */
EOD;
}
/* vim: set ts=4 sw=4 et : */

View File

@ -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
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
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
SUCH DAMAGE.
*/
/* vim: set ts=4 sw=4 et : */
/* SPDX-License-Identifier: BSD-3-Clause */
#ifndef ZINTCONFIG_H
#define ZINTCONFIG_H
@ -38,4 +38,5 @@
#define ZINT_VERSION_RELEASE 1
#define ZINT_VERSION_BUILD 9
/* vim: set ts=4 sw=4 et : */
#endif /* ZINTCONFIG_H */