Converted zint_symbol structure usage to a more compressed format

This commit is contained in:
hooper114
2009-05-31 20:33:54 +00:00
parent 90d301a6dc
commit cb0e4e27e8
29 changed files with 447 additions and 341 deletions

View File

@ -62,14 +62,14 @@ int telepen(struct zint_symbol *symbol, unsigned char source[])
count = 0;
if(ustrlen(source) > 30) {
strcpy(symbol->errtxt, "Input too long [321]");
strcpy(symbol->errtxt, "Input too long");
return ERROR_TOO_LONG;
}
for(i = 0; i < ustrlen(source); i++) {
if(source[i] > 127) {
/* Cannot encode extended ASCII */
strcpy(symbol->errtxt, "Invalid characters in input data [322]");
strcpy(symbol->errtxt, "Invalid characters in input data");
return ERROR_INVALID_DATA;
}
}
@ -115,13 +115,13 @@ int telepen_num(struct zint_symbol *symbol, unsigned char source[])
count = 0;
if(input_length > 60) {
strcpy(symbol->errtxt, "Input too long [871]");
strcpy(symbol->errtxt, "Input too long");
return ERROR_TOO_LONG;
}
to_upper(local_source);
error_number = is_sane(NASET, local_source);
if(error_number == ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "Invalid characters in data [872]");
strcpy(symbol->errtxt, "Invalid characters in data");
return error_number;
}
@ -146,7 +146,7 @@ int telepen_num(struct zint_symbol *symbol, unsigned char source[])
for (i=0; i < input_length; i+=2)
{
if(local_source[i] == 'X') {
strcpy(symbol->errtxt, "Invalid position of X in Telepen data [873]");
strcpy(symbol->errtxt, "Invalid position of X in Telepen data");
return ERROR_INVALID_DATA;
}