John Zaitseff
bf76fa312c
Assume MOD_POSIX_CURRENCY_SYMBOL contains only ASCII characters
...
The GNU library now has "C.UTF-8" as a locale (which is NOT a single-byte
locale!), but we assume the currency symbol in MOD_POSIX_CURRENCY_SYMBOL
contains only ASCII characters.
2011-08-16 20:55:42 +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
1e7c6c098a
Add checks for the C.UTF-8 (C.utf8) locale for adding a currency symbol
2011-08-08 10:21:24 +10:00
John Zaitseff
9251ca0463
First pass at adding _() and N_() to allow string translation
2011-08-01 19:30:19 +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
1a44ff6513
Replace "tv.tv_sec * tv.tv_usec" with "tv.tv_sec + tv.tv_usec"
...
This allows the lower bits of seed to hopefully contain something useful
instead of just zeros!
2011-07-20 23:19:12 +10:00
John Zaitseff
6a6c31035a
Correct a subtle off-by-one error in copying in l_strfmon()
...
The bug in l_strfmon() is that bufsize is NOT the length of the string,
hence do not include the usual "+ 1" for the NUL byte. Also correct some
comparisons between signed and unsigned integers.
2011-07-20 21:47:20 +10:00
John Zaitseff
b3f1820418
Add the restrict keyword where appropriate
2011-07-20 21:18:49 +10:00
John Zaitseff
cbff5193d9
Include microseconds as well as seconds for the random number seed
2011-07-20 12:42:10 +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
8725983d94
Update header comments
2011-07-19 21:47:19 +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
ccbe7405f8
Replace "out of memory" errors with calls to err_exit_nomem()
2011-07-19 19:16:34 +10:00
John Zaitseff
200f7cdf97
Revise the scramble() and unscramble() functions
...
The scramble() and unscramble() functions now use a moving (incrementing)
key for the XOR encryption/decryption. Also include a table of XOR keys
to use at random for encryption.
Revised the scramble() and unscramble() functions to use a moving
(incrementing) key for the XOR encryption/decryption. Also generated a
table of XOR keys to use at random for encryption.
2011-07-14 12:30:23 +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
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
abd196d2c5
Add the basic I/O functions init_screen(), end_screen() and center()
2011-07-02 21:25:57 +10:00
John Zaitseff
6c90801102
Add the err_exit() and errno_exit() functions
2011-07-02 14:23:35 +10:00
John Zaitseff
ba721ced10
Be stricter about saved game numbers
2011-07-02 09:39:23 +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