summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/package.h
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2010-08-27 17:16:40 +0200
committerAdam Borowski <kilobyte@angband.pl>2010-09-03 16:19:28 +0200
commite90b1c98777cafe9d9d5e1a054be9659efa3b290 (patch)
tree8603391c16ba596111c1bafe8a1fbc732c8c1b8f /crawl-ref/source/package.h
parent12fba431624b9c23b5dd9625d5f6029b254d1940 (diff)
downloadcrawl-ref-e90b1c98777cafe9d9d5e1a054be9659efa3b290.tar.gz
crawl-ref-e90b1c98777cafe9d9d5e1a054be9659efa3b290.zip
Allow "aborting" a save file, to bail out safely, or prepare for discarding.
It effectively reverts to the last commit. This is the safest thing to do in an error, and if we're going to delete the save file, it doesn't matter.
Diffstat (limited to 'crawl-ref/source/package.h')
-rw-r--r--crawl-ref/source/package.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/crawl-ref/source/package.h b/crawl-ref/source/package.h
index 344a10bec8..028bc3c4d4 100644
--- a/crawl-ref/source/package.h
+++ b/crawl-ref/source/package.h
@@ -70,12 +70,14 @@ public:
void delete_chunk(const std::string name);
bool has_chunk(const std::string name);
std::vector<std::string> list_chunks();
+ void abort();
private:
bool rw;
int fd;
len_t file_len;
int n_users;
bool dirty;
+ bool aborted;
std::map<std::string, len_t> directory;
std::map<len_t, len_t> free_blocks;
std::stack<len_t> unlinked_blocks;