mirror of
https://git.code.sf.net/p/zint/code
synced 2025-06-03 00:19:51 -04:00
CODEONE/ULTRA overrun fixes; TELEPEN fixes; CODEONE/LOGMARS/VIN/CODABAR options; GUI updates; tests
This commit is contained in:
parent
8131471573
commit
6242e02638
80 changed files with 6393 additions and 2179 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
/*
|
||||
libzint - the open source barcode library
|
||||
Copyright (C) 2008-2017 Robin Stuart <rstuart114@gmail.com>
|
||||
Copyright (C) 2008 - 2020 Robin Stuart <rstuart114@gmail.com>
|
||||
Including bug fixes by Bryan Hatton
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
@ -32,15 +32,13 @@
|
|||
*/
|
||||
/* vim: set ts=4 sw=4 et : */
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifdef _MSC_VER
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include "common.h"
|
||||
|
||||
#define DAFTSET "DAFT"
|
||||
#define DAFTSET "DAFT"
|
||||
#define KRSET "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
#define KASUTSET "1234567890-abcdefgh"
|
||||
#define CHKASUTSET "0123456789-abcdefgh"
|
||||
|
@ -87,11 +85,9 @@ static const char *JapanTable[19] = {
|
|||
|
||||
/* Handles the PostNet system used for Zip codes in the US */
|
||||
static int postnet(struct zint_symbol *symbol, unsigned char source[], char dest[], int length) {
|
||||
unsigned int i, sum, check_digit;
|
||||
int i, sum, check_digit;
|
||||
int error_number;
|
||||
|
||||
error_number = 0;
|
||||
|
||||
if (length != 5 && length != 9 && length != 11) {
|
||||
strcpy(symbol->errtxt, "480: Input wrong length");
|
||||
return ZINT_ERROR_TOO_LONG;
|
||||
|
@ -127,8 +123,6 @@ INTERNAL int post_plot(struct zint_symbol *symbol, unsigned char source[], int l
|
|||
int writer;
|
||||
int error_number;
|
||||
|
||||
error_number = 0;
|
||||
|
||||
error_number = postnet(symbol, source, height_pattern, length);
|
||||
if (error_number != 0) {
|
||||
return error_number;
|
||||
|
@ -153,11 +147,9 @@ INTERNAL int post_plot(struct zint_symbol *symbol, unsigned char source[], int l
|
|||
|
||||
/* Handles the PLANET system used for item tracking in the US */
|
||||
static int planet(struct zint_symbol *symbol, unsigned char source[], char dest[], int length) {
|
||||
unsigned int i, sum, check_digit;
|
||||
int i, sum, check_digit;
|
||||
int error_number;
|
||||
|
||||
error_number = 0;
|
||||
|
||||
if (length != 11 && length != 13) {
|
||||
strcpy(symbol->errtxt, "482: Input wrong length");
|
||||
return ZINT_ERROR_TOO_LONG;
|
||||
|
@ -193,8 +185,6 @@ INTERNAL int planet_plot(struct zint_symbol *symbol, unsigned char source[], int
|
|||
int writer;
|
||||
int error_number;
|
||||
|
||||
error_number = 0;
|
||||
|
||||
error_number = planet(symbol, source, height_pattern, length);
|
||||
if (error_number != 0) {
|
||||
return error_number;
|
||||
|
@ -221,7 +211,6 @@ INTERNAL int korea_post(struct zint_symbol *symbol, unsigned char source[], int
|
|||
int total, loop, check, zeroes, error_number;
|
||||
char localstr[8], dest[80];
|
||||
|
||||
error_number = 0;
|
||||
if (length > 6) {
|
||||
strcpy(symbol->errtxt, "484: Input too long");
|
||||
return ZINT_ERROR_TOO_LONG;
|
||||
|
@ -259,7 +248,6 @@ INTERNAL int korea_post(struct zint_symbol *symbol, unsigned char source[], int
|
|||
glyphs from http://en.wikipedia.org/wiki/Facing_Identification_Mark */
|
||||
INTERNAL int fim(struct zint_symbol *symbol, unsigned char source[], int length) {
|
||||
|
||||
|
||||
char dest[16] = {0};
|
||||
|
||||
if (length > 1) {
|
||||
|
@ -296,7 +284,7 @@ INTERNAL int fim(struct zint_symbol *symbol, unsigned char source[], int length)
|
|||
|
||||
/* Handles the 4 State barcodes used in the UK by Royal Mail */
|
||||
static char rm4scc(char source[], unsigned char dest[], int length) {
|
||||
unsigned int i;
|
||||
int i;
|
||||
int top, bottom, row, column, check_digit;
|
||||
char values[3], set_copy[] = KRSET;
|
||||
|
||||
|
@ -334,13 +322,11 @@ static char rm4scc(char source[], unsigned char dest[], int length) {
|
|||
/* Puts RM4SCC into the data matrix */
|
||||
INTERNAL int royal_plot(struct zint_symbol *symbol, unsigned char source[], int length) {
|
||||
char height_pattern[210];
|
||||
unsigned int loopey, h;
|
||||
int loopey, h;
|
||||
int writer;
|
||||
int error_number;
|
||||
strcpy(height_pattern, "");
|
||||
|
||||
error_number = 0;
|
||||
|
||||
if (length > 50) {
|
||||
strcpy(symbol->errtxt, "488: Input too long");
|
||||
return ZINT_ERROR_TOO_LONG;
|
||||
|
@ -380,13 +366,11 @@ INTERNAL int royal_plot(struct zint_symbol *symbol, unsigned char source[], int
|
|||
Specification at http://www.tntpost.nl/zakelijk/klantenservice/downloads/kIX_code/download.aspx */
|
||||
INTERNAL int kix_code(struct zint_symbol *symbol, unsigned char source[], int length) {
|
||||
char height_pattern[75], localstr[20];
|
||||
unsigned int loopey;
|
||||
int loopey;
|
||||
int writer, i, h;
|
||||
int error_number; /* zeroes; */
|
||||
int error_number;
|
||||
strcpy(height_pattern, "");
|
||||
|
||||
error_number = 0;
|
||||
|
||||
if (length > 18) {
|
||||
strcpy(symbol->errtxt, "490: Input too long");
|
||||
return ZINT_ERROR_TOO_LONG;
|
||||
|
@ -434,7 +418,6 @@ INTERNAL int daft_code(struct zint_symbol *symbol, unsigned char source[], int l
|
|||
int writer, i, error_number;
|
||||
strcpy(height_pattern, "");
|
||||
|
||||
error_number = 0;
|
||||
if (length > 50) {
|
||||
strcpy(symbol->errtxt, "492: Input too long");
|
||||
return ZINT_ERROR_TOO_LONG;
|
||||
|
@ -489,8 +472,6 @@ INTERNAL int flattermarken(struct zint_symbol *symbol, unsigned char source[], i
|
|||
int loop, error_number;
|
||||
char dest[512]; /* 90 * 4 + 1 ~ */
|
||||
|
||||
error_number = 0;
|
||||
|
||||
if (length > 90) {
|
||||
strcpy(symbol->errtxt, "494: Input too long");
|
||||
return ZINT_ERROR_TOO_LONG;
|
||||
|
@ -528,7 +509,6 @@ INTERNAL int japan_post(struct zint_symbol *symbol, unsigned char source[], int
|
|||
return ZINT_ERROR_TOO_LONG;
|
||||
}
|
||||
|
||||
inter_posn = 0;
|
||||
error_number = 0;
|
||||
|
||||
strcpy(local_source, (char*) source);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue