aboutsummaryrefslogtreecommitdiff
path: root/samegame.c
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2023-03-22 16:06:18 +0000
committerBen Harris <bjh21@bjh21.me.uk>2023-03-22 16:06:18 +0000
commit09c15f206edac18bd2158c189c821b9ba85d3939 (patch)
treeb0b5e84d9e416f425bb8f665710f836509c0a5c0 /samegame.c
parentadf2a098298f1aa73aca2c816174d5e63ff45a32 (diff)
downloadpuzzles-09c15f206edac18bd2158c189c821b9ba85d3939.zip
puzzles-09c15f206edac18bd2158c189c821b9ba85d3939.tar.gz
puzzles-09c15f206edac18bd2158c189c821b9ba85d3939.tar.bz2
puzzles-09c15f206edac18bd2158c189c821b9ba85d3939.tar.xz
New shared function, getenv_bool()
This provides a standard way to get a boolean from an environment variable. It treats the variable as true iff its value begins with 'y' or 'Y', like most of the current implementations. The function takes a default value which it returns if the environment variable is undefined. This replaces the various ad-hoc tests of environment variable scattered around and mostly doesn't change their behaviour. The exceptions are TOWERS_2D in Towers and DEBUG_PUZZLES in the Windows front end. Both of those were treated as true if they were defined at all, but now follow the same rules as other boolean environment variables.
Diffstat (limited to 'samegame.c')
0 files changed, 0 insertions, 0 deletions