Firstly, Ncurses addchstr() and family do not work, it seems, with
multibyte strings, so use addch() instead. Secondly, PRINTABLE_MAP_VAL
returns a wchar_t wide character, not a byte-sized char.
Wide-char character constants is not strictly needed for most (all?)
modern C compilers, as ASCII maps to wchar_t directly (as long as
__STDC_ISO_10646__ is defined). However, it doesn't hurt to be pedantic!
Convert all input routines, and most internal strings, to use
wide-character functions. All extended characters are supported,
including those having column widths of zero (eg, combining characters),
one (eg, normal Western characters) and two (eg, many East Asian
characters). This was quite a major undertaking!
Rename prepstr, vprepstr, chbufdup, center, center2, center3 and attrpr
to mkchstr, vmkchstr, chstrdup, old_center, old_center2, old_center3 and
old_attrpr respectively.
Rework the signal handler to be somewhat more unsafe, but conceptually
cleaner, in operation. It now ends the use of Curses, then reraises the
signal. Remove almost all references to abort_game.
Add a signal handler for SIGINT and SIGTERM, as well as sprinklings of
checks to abort_game. Although Ncurses DOES define handlers for SIGINT
and SIGTERM, they do not always seem to work correctly under many
operating systems.
This function, trade_shares(), is the last function needed for Star
Traders: the game is now complete.
The current line count is 6667 lines of C code (src/*.[ch]), as compared
with 1657 lines in the CP/M-80 version, 1674 lines in CP/M-86, 4266 lines
in DOS (2225 in the main program) and 4580 lines in Windows 16-bit.