eci.c: replace libiconv-adapted code with own implementations so

as to fully comply with BSD license (for why Library GPL 2+ not
  compatible see https://opensource.stackexchange.com/a/6701),
  ~3% slower (maybe), +~6K extra in data
  (gb18030.c, gb2313.c & sjis.c removed, mapping .TXT files moved
  to backend/tools/data & extra ones added, 2 new PHP generators)
GUI: CODE39/EXCODE39: show/hide HIBC check digit option in addition
  to enable/disable (less confusing)
CLI: batch: pedantic check for EOF using intChar in newline fgetc()
  loop
test_args.c: don't use WIFEXITED(), WEXITSTATUS() on Windows
manual: lessen some copy/paste verbiage by referring back, other
  small tweaks/typos
This commit is contained in:
gitlost 2022-06-02 20:32:25 +01:00
parent d9f2e85246
commit ab3cf4f395
69 changed files with 61287 additions and 11905 deletions

View file

@ -2,38 +2,41 @@
/* Generate lookup table from unicode.org mapping file (SHIFTJIS.TXT by default). */
/*
libzint - the open source barcode library
Copyright (C) 2019-2021 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2019-2022 Robin Stuart <rstuart114@gmail.com>
*/
/* To create backend/tests/test_sjis_tab.h (from backend/tests/build directory):
/* To create backend/tests/test_sjis_tab.h (from the project root directory):
*
* php ../tools/gen_test_tab.php
* php backend/tests/tools/gen_test_tab.php
*
* To create backend/tests/test_gb2312_tab.h;
*
* php ../tools/gen_test_tab.php -f GB2312.TXT -s gb2312_tab
* php backend/tests/tools/gen_test_tab.php -f GB2312.TXT -s gb2312_tab
*
* To create backend/tests/test_gbk.h;
*
* php backend/tests/tools/gen_test_tab.php -f CP936.TXT -s gbk_tab
*
* To create backend/tests/test_gb18030_tab.h (note that backend/tests/tools/data/GB18030.TXT
* will have to be downloaded first from https://haible.de/bruno/charsets/conversion-tables/GB18030.html
* using the version libiconv-1.11/GB18030.TXT):
* using the version jdk-1.4.2/GB18030.TXT):
*
* php ../tools/gen_test_tab.php -f GB18030.TXT -s gb18030_tab
* php backend/tests/tools/gen_test_tab.php -f GB18030.TXT -s gb18030_tab
*
* To create backend/tests/test_big5_tab.h;
*
* php ../tools/gen_test_tab.php -f BIG5.TXT -s big5_tab
* php backend/tests/tools/gen_test_tab.php -f BIG5.TXT -s big5_tab
*
* To create backend/tests/test_ksx1001_tab.h;
*
* php ../tools/gen_test_tab.php -f KSX1001.TXT -s ksx1001_tab
* php backend/tests/tools/gen_test_tab.php -f KSX1001.TXT -s ksx1001_tab
*
*/
/* vim: set ts=4 sw=4 et : */
$basename = basename(__FILE__);
$dirname = dirname(__FILE__);
$opts = getopt('d:f:o:s:');
$data_dirname = isset($opts['d']) ? $opts['d'] : ($dirname . '/data'); // Where to load file from.
$data_dirname = isset($opts['d']) ? $opts['d'] : ($dirname . '/../../tools/data'); // Where to load file from.
$file_name = isset($opts['f']) ? $opts['f'] : 'SHIFTJIS.TXT'; // Name of file.
$out_dirname = isset($opts['o']) ? $opts['o'] : ($dirname . '/..'); // Where to put output.
$suffix_name = isset($opts['s']) ? $opts['s'] : 'sjis_tab'; // Suffix of table and output file.
@ -93,3 +96,5 @@ foreach ($sort as $ind => $unicode) {
$out[] = '};';
file_put_contents($out_dirname . '/test_' . $suffix_name . '.h', implode("\n", $out) . "\n");
/* vim: set ts=4 sw=4 et : */