diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-19 13:17:13 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-19 13:17:13 +0000 |
commit | 3156c2e3bc0d513a4332c7f472fd6b9b31a5094e (patch) | |
tree | 122c5ac4494f743e2613176c9ed5d83daad1d480 /crawl-ref/source/libutil.h | |
parent | bb1a887fb819272e46b5f593d2a2debf81a802ad (diff) | |
download | crawl-ref-3156c2e3bc0d513a4332c7f472fd6b9b31a5094e.tar.gz crawl-ref-3156c2e3bc0d513a4332c7f472fd6b9b31a5094e.zip |
Handle SIGHUP. Could use improvement, but it's a start.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@673 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/libutil.h')
-rw-r--r-- | crawl-ref/source/libutil.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crawl-ref/source/libutil.h b/crawl-ref/source/libutil.h index f12618d7ca..4323b9c1c1 100644 --- a/crawl-ref/source/libutil.h +++ b/crawl-ref/source/libutil.h @@ -156,6 +156,23 @@ enum KEYS CK_CTRL_PGDN }; +// Sets a boolean to a new value in the scope of the object instance. +class unwind_bool +{ +public: + unwind_bool(bool &val_, bool newval) : val(val_), oldval(val_) + { + val = newval; + } + ~unwind_bool() + { + val = oldval; + } +private: + bool &val; + bool oldval; +}; + class cursor_control { public: |