mirror of
https://git.code.sf.net/p/zint/code
synced 2025-12-21 11:57:04 +00:00
ERROR_* renamed to ZERROR_*
Merged form master
This commit is contained in:
@@ -68,10 +68,10 @@ int postnet(struct zint_symbol *symbol, unsigned char source[], char dest[], int
|
|||||||
|
|
||||||
if(length > 38) {
|
if(length > 38) {
|
||||||
strcpy(symbol->errtxt, "Input too long");
|
strcpy(symbol->errtxt, "Input too long");
|
||||||
return ERROR_TOO_LONG;
|
return ZERROR_TOO_LONG;
|
||||||
}
|
}
|
||||||
error_number = is_sane(NEON, source, length);
|
error_number = is_sane(NEON, source, length);
|
||||||
if(error_number == ERROR_INVALID_DATA) {
|
if(error_number == ZERROR_INVALID_DATA) {
|
||||||
strcpy(symbol->errtxt, "Invalid characters in data");
|
strcpy(symbol->errtxt, "Invalid characters in data");
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
@@ -139,10 +139,10 @@ int planet(struct zint_symbol *symbol, unsigned char source[], char dest[], int
|
|||||||
|
|
||||||
if(length > 38) {
|
if(length > 38) {
|
||||||
strcpy(symbol->errtxt, "Input too long");
|
strcpy(symbol->errtxt, "Input too long");
|
||||||
return ERROR_TOO_LONG;
|
return ZERROR_TOO_LONG;
|
||||||
}
|
}
|
||||||
error_number = is_sane(NEON, source, length);
|
error_number = is_sane(NEON, source, length);
|
||||||
if(error_number == ERROR_INVALID_DATA) {
|
if(error_number == ZERROR_INVALID_DATA) {
|
||||||
strcpy(symbol->errtxt, "Invalid characters in data");
|
strcpy(symbol->errtxt, "Invalid characters in data");
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
@@ -208,10 +208,10 @@ int korea_post(struct zint_symbol *symbol, unsigned char source[], int length)
|
|||||||
error_number = 0;
|
error_number = 0;
|
||||||
if(length > 6) {
|
if(length > 6) {
|
||||||
strcpy(symbol->errtxt, "Input too long");
|
strcpy(symbol->errtxt, "Input too long");
|
||||||
return ERROR_TOO_LONG;
|
return ZERROR_TOO_LONG;
|
||||||
}
|
}
|
||||||
error_number = is_sane(NEON, source, length);
|
error_number = is_sane(NEON, source, length);
|
||||||
if(error_number == ERROR_INVALID_DATA) {
|
if(error_number == ZERROR_INVALID_DATA) {
|
||||||
strcpy(symbol->errtxt, "Invalid characters in data");
|
strcpy(symbol->errtxt, "Invalid characters in data");
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
@@ -246,7 +246,7 @@ int fim(struct zint_symbol *symbol, unsigned char source[], int length)
|
|||||||
|
|
||||||
if(length > 1) {
|
if(length > 1) {
|
||||||
strcpy(symbol->errtxt, "Input too long");
|
strcpy(symbol->errtxt, "Input too long");
|
||||||
return ERROR_TOO_LONG;
|
return ZERROR_TOO_LONG;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch((char)source[0]) {
|
switch((char)source[0]) {
|
||||||
@@ -268,7 +268,7 @@ int fim(struct zint_symbol *symbol, unsigned char source[], int length)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
strcpy(symbol->errtxt, "Invalid characters in data");
|
strcpy(symbol->errtxt, "Invalid characters in data");
|
||||||
return ERROR_INVALID_DATA;
|
return ZERROR_INVALID_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -323,11 +323,11 @@ int royal_plot(struct zint_symbol *symbol, unsigned char source[], int length)
|
|||||||
|
|
||||||
if(length > 120) {
|
if(length > 120) {
|
||||||
strcpy(symbol->errtxt, "Input too long");
|
strcpy(symbol->errtxt, "Input too long");
|
||||||
return ERROR_TOO_LONG;
|
return ZERROR_TOO_LONG;
|
||||||
}
|
}
|
||||||
to_upper(source);
|
to_upper(source);
|
||||||
error_number = is_sane(KRSET, source, length);
|
error_number = is_sane(KRSET, source, length);
|
||||||
if(error_number == ERROR_INVALID_DATA) {
|
if(error_number == ZERROR_INVALID_DATA) {
|
||||||
strcpy(symbol->errtxt, "Invalid characters in data");
|
strcpy(symbol->errtxt, "Invalid characters in data");
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
@@ -349,9 +349,9 @@ int royal_plot(struct zint_symbol *symbol, unsigned char source[], int length)
|
|||||||
writer += 2;
|
writer += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
symbol->row_height[0] = 4;
|
symbol->row_height[0] = 3;
|
||||||
symbol->row_height[1] = 2;
|
symbol->row_height[1] = 2;
|
||||||
symbol->row_height[2] = 4;
|
symbol->row_height[2] = 3;
|
||||||
symbol->rows = 3;
|
symbol->rows = 3;
|
||||||
symbol->width = writer - 1;
|
symbol->width = writer - 1;
|
||||||
|
|
||||||
@@ -363,7 +363,7 @@ int kix_code(struct zint_symbol *symbol, unsigned char source[], int length)
|
|||||||
/* Handles Dutch Post TNT KIX symbols */
|
/* Handles Dutch Post TNT KIX symbols */
|
||||||
/* The same as RM4SCC but without check digit */
|
/* The same as RM4SCC but without check digit */
|
||||||
/* Specification at http://www.tntpost.nl/zakelijk/klantenservice/downloads/kIX_code/download.aspx */
|
/* Specification at http://www.tntpost.nl/zakelijk/klantenservice/downloads/kIX_code/download.aspx */
|
||||||
char height_pattern[50], localstr[13];
|
char height_pattern[50], localstr[20];
|
||||||
unsigned int loopey;
|
unsigned int loopey;
|
||||||
int writer, i, h;
|
int writer, i, h;
|
||||||
int error_number; /* zeroes; */
|
int error_number; /* zeroes; */
|
||||||
@@ -371,13 +371,13 @@ int kix_code(struct zint_symbol *symbol, unsigned char source[], int length)
|
|||||||
|
|
||||||
error_number = 0;
|
error_number = 0;
|
||||||
|
|
||||||
if(length > 11) {
|
if(length > 18) {
|
||||||
strcpy(symbol->errtxt, "Input too long");
|
strcpy(symbol->errtxt, "Input too long");
|
||||||
return ERROR_TOO_LONG;
|
return ZERROR_TOO_LONG;
|
||||||
}
|
}
|
||||||
to_upper(source);
|
to_upper(source);
|
||||||
error_number = is_sane(KRSET, source, length);
|
error_number = is_sane(KRSET, source, length);
|
||||||
if(error_number == ERROR_INVALID_DATA) {
|
if(error_number == ZERROR_INVALID_DATA) {
|
||||||
strcpy(symbol->errtxt, "Invalid characters in data");
|
strcpy(symbol->errtxt, "Invalid characters in data");
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
@@ -389,7 +389,7 @@ int kix_code(struct zint_symbol *symbol, unsigned char source[], int length)
|
|||||||
strcpy(localstr, (char *)source);
|
strcpy(localstr, (char *)source);
|
||||||
|
|
||||||
/* Encode data */
|
/* Encode data */
|
||||||
for (i = 0; i < 11; i++) {
|
for (i = 0; i < 18; i++) {
|
||||||
lookup(KRSET, RoyalTable, localstr[i], height_pattern);
|
lookup(KRSET, RoyalTable, localstr[i], height_pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -409,9 +409,9 @@ int kix_code(struct zint_symbol *symbol, unsigned char source[], int length)
|
|||||||
writer += 2;
|
writer += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
symbol->row_height[0] = 4;
|
symbol->row_height[0] = 3;
|
||||||
symbol->row_height[1] = 2;
|
symbol->row_height[1] = 2;
|
||||||
symbol->row_height[2] = 4;
|
symbol->row_height[2] = 3;
|
||||||
symbol->rows = 3;
|
symbol->rows = 3;
|
||||||
symbol->width = writer - 1;
|
symbol->width = writer - 1;
|
||||||
|
|
||||||
@@ -430,12 +430,12 @@ int daft_code(struct zint_symbol *symbol, unsigned char source[], int length)
|
|||||||
error_number = 0;
|
error_number = 0;
|
||||||
if(length > 50) {
|
if(length > 50) {
|
||||||
strcpy(symbol->errtxt, "Input too long");
|
strcpy(symbol->errtxt, "Input too long");
|
||||||
return ERROR_TOO_LONG;
|
return ZERROR_TOO_LONG;
|
||||||
}
|
}
|
||||||
to_upper((unsigned char*)source);
|
to_upper((unsigned char*)source);
|
||||||
error_number = is_sane(DAFTSET, (unsigned char*)source, length);
|
error_number = is_sane(DAFTSET, (unsigned char*)source, length);
|
||||||
|
|
||||||
if(error_number == ERROR_INVALID_DATA) {
|
if(error_number == ZERROR_INVALID_DATA) {
|
||||||
strcpy(symbol->errtxt, "Invalid characters in data");
|
strcpy(symbol->errtxt, "Invalid characters in data");
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
@@ -463,9 +463,9 @@ int daft_code(struct zint_symbol *symbol, unsigned char source[], int length)
|
|||||||
writer += 2;
|
writer += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
symbol->row_height[0] = 4;
|
symbol->row_height[0] = 3;
|
||||||
symbol->row_height[1] = 2;
|
symbol->row_height[1] = 2;
|
||||||
symbol->row_height[2] = 4;
|
symbol->row_height[2] = 3;
|
||||||
symbol->rows = 3;
|
symbol->rows = 3;
|
||||||
symbol->width = writer - 1;
|
symbol->width = writer - 1;
|
||||||
|
|
||||||
@@ -482,10 +482,10 @@ int flattermarken(struct zint_symbol *symbol, unsigned char source[], int length
|
|||||||
|
|
||||||
if(length > 90) {
|
if(length > 90) {
|
||||||
strcpy(symbol->errtxt, "Input too long");
|
strcpy(symbol->errtxt, "Input too long");
|
||||||
return ERROR_TOO_LONG;
|
return ZERROR_TOO_LONG;
|
||||||
}
|
}
|
||||||
error_number = is_sane(NEON, source, length);
|
error_number = is_sane(NEON, source, length);
|
||||||
if(error_number == ERROR_INVALID_DATA) {
|
if(error_number == ZERROR_INVALID_DATA) {
|
||||||
strcpy(symbol->errtxt, "Invalid characters in data");
|
strcpy(symbol->errtxt, "Invalid characters in data");
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
@@ -522,7 +522,7 @@ int japan_post(struct zint_symbol *symbol, unsigned char source[], int length)
|
|||||||
to_upper((unsigned char*)local_source);
|
to_upper((unsigned char*)local_source);
|
||||||
error_number = is_sane(SHKASUTSET, (unsigned char*)local_source, length);
|
error_number = is_sane(SHKASUTSET, (unsigned char*)local_source, length);
|
||||||
|
|
||||||
if(error_number == ERROR_INVALID_DATA) {
|
if(error_number == ZERROR_INVALID_DATA) {
|
||||||
strcpy(symbol->errtxt, "Invalid characters in data");
|
strcpy(symbol->errtxt, "Invalid characters in data");
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
@@ -593,9 +593,9 @@ int japan_post(struct zint_symbol *symbol, unsigned char source[], int length)
|
|||||||
writer += 2;
|
writer += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
symbol->row_height[0] = 2;
|
symbol->row_height[0] = 3;
|
||||||
symbol->row_height[1] = 2;
|
symbol->row_height[1] = 2;
|
||||||
symbol->row_height[2] = 2;
|
symbol->row_height[2] = 3;
|
||||||
symbol->rows = 3;
|
symbol->rows = 3;
|
||||||
symbol->width = writer - 1;
|
symbol->width = writer - 1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user