summaryrefslogtreecommitdiff
path: root/mpq-fs.c
diff options
context:
space:
mode:
authorpixel <pixel>2008-05-18 01:28:19 +0000
committerpixel <pixel>2008-05-18 01:28:19 +0000
commit1947b4aedbae747533a03c11cf6f426bcbb42280 (patch)
tree4dd423d16dbf9aace7bf6da5d42d181af8c4670a /mpq-fs.c
parentb71ca0bfa90ec152387a995b6a55cb686aa4c882 (diff)
Adding a way to shutdown the mpqlib_fs
Diffstat (limited to 'mpq-fs.c')
-rw-r--r--mpq-fs.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/mpq-fs.c b/mpq-fs.c
index 84e48a0..811de8d 100644
--- a/mpq-fs.c
+++ b/mpq-fs.c
@@ -127,3 +127,17 @@ struct mpq_file_t * mpqlib_fs_open(const char * _fname) {
return NULL;
}
+
+#define FALSE 0
+#define TRUE !FALSE
+
+void mpqlib_shutdown() {
+ if (!hash_table)
+ return;
+ if (hfirst(hash_table)) do {
+ free(hkey(hash_table));
+ } while (hnext(hash_table));
+
+ hdestroy(hash_table);
+ hash_table = 0;
+}