mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-22 03:05:11 -04:00
NULL character support
This commit is contained in:
parent
1015a11b5a
commit
d6df698918
20 changed files with 2286 additions and 1849 deletions
|
@ -82,6 +82,7 @@ void usage(void)
|
|||
" --secure=NUMBER (PDF417 and QR Code) Error correction level.\n"
|
||||
" --primary=STRING (Maxicode and Composite) Structured primary message.\n"
|
||||
" --mode=NUMBER (Maxicode and Composite) Set encoding mode.\n"
|
||||
" --null=NUMBER Character to represent NULL.\n"
|
||||
, ZINT_VERSION);
|
||||
}
|
||||
|
||||
|
@ -153,6 +154,7 @@ int main(int argc, char **argv)
|
|||
{"mode=", 1, 0, 0},
|
||||
{"primary=", 1, 0, 0},
|
||||
{"scale=", 1, 0, 0},
|
||||
{"null=", 1, 0, 0},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
c = getopt_long(argc, argv, "htb:w:d:o:i:rcmp", long_options, &option_index);
|
||||
|
@ -200,6 +202,18 @@ int main(int argc, char **argv)
|
|||
fprintf(stderr, "Border width out of range\n");
|
||||
}
|
||||
}
|
||||
if(!strcmp(long_options[option_index].name, "null=")) {
|
||||
error_number = validator(NESET, optarg);
|
||||
if(error_number == ERROR_INVALID_DATA) {
|
||||
fprintf(stderr, "Invalid NULL replacement\n");
|
||||
exit(1);
|
||||
}
|
||||
if((atoi(optarg) >= 1) && (atoi(optarg) <= 128)) {
|
||||
my_symbol->nullchar = atoi(optarg);
|
||||
} else {
|
||||
fprintf(stderr, "Invalid NULL replacement\n");
|
||||
}
|
||||
}
|
||||
if(!strcmp(long_options[option_index].name, "height=")) {
|
||||
error_number = validator(NESET, optarg);
|
||||
if(error_number == ERROR_INVALID_DATA) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue