John Zaitseff
b5b211313e
Move chstrdup() to utils.c and rename it to xchstrdup()
...
The new name is for consistency with other XXXdup() functions used in
this program.
2011-08-20 15:17:09 +10:00
John Zaitseff
7b544bbd35
Add the functions xwcrtomb() and xmbstowcs()
...
The xwcrtomb() and xmbstowcs() functions replace illegal characters with
EILSEQ_REPL ('?'). Adjust other functions, particularly mkchstr() and
friends, to suit.
2011-08-20 13:03:40 +10:00
John Zaitseff
336611559b
Add the error-checking function xwcsdup()
2011-08-20 10:40:07 +10:00
John Zaitseff
5bb48fe35f
Add wrapper functions xmalloc() and xstrdup() to do error handling
2011-08-13 08:50:34 +10:00
John Zaitseff
4b4efd7851
Replace the global variable localeconv_info with lconvinfo
...
In general, verbosity is not really to be encouraged...
2011-07-22 10:23:58 +10:00
John Zaitseff
b3f1820418
Add the restrict keyword where appropriate
2011-07-20 21:18:49 +10:00
John Zaitseff
da7477dc28
Compensate for the POSIX locale not having a currency symbol
...
The function l_strfmon() will insert MOD_POSIX_CURRENCY_SYMBOL in the
appropriate place when used with the POSIX ("C") locale.
2011-07-20 10:44:44 +10:00
John Zaitseff
c3d265a9ff
Clean up utils.c and utils.h
...
Move all function interface comments to the header file (where they
should have been in the first place), remove superfluous parentheses
where allowed by the precedence of C operators.
2011-07-19 21:38:27 +10:00
John Zaitseff
c19feab652
Clean up various comments, etc, in header files
2011-07-19 20:32:00 +10:00
John Zaitseff
ccbe7405f8
Replace "out of memory" errors with calls to err_exit_nomem()
2011-07-19 19:16:34 +10:00
John Zaitseff
16c421574f
Add the scramble() and unscramble() functions
...
These functions provide simple encryption and decryption to thwart casual
cheating!
2011-07-11 23:21:10 +10:00
John Zaitseff
dd281f795b
Add gettxline() to read a line of input from the keyboard
2011-07-11 10:31:19 +10:00
John Zaitseff
c0943b9f7d
Move (and abstract) the random number functions to utils.c
2011-07-04 17:13:29 +10:00
John Zaitseff
2a3e18460e
Rename intto_game_filename() to game_filename()
2011-07-04 10:28:50 +10:00
John Zaitseff
6c90801102
Add the err_exit() and errno_exit() functions
2011-07-02 14:23:35 +10:00
John Zaitseff
7fa5833fb6
Complete the command line argument processing routines
2011-06-30 15:25:30 +10:00
John Zaitseff
6910370557
Add various header files
...
Add the system.h header file for all system header includes, and utils.c
and utils.h for various low-level utility functions.
2011-06-15 22:34:28 +10:00