summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2009-02-17 02:03:49 +0100
committerPixel <pixel@nobis-crew.org>2009-02-17 02:03:49 +0100
commit5b99194c58385215cad973281a6f162d187ab971 (patch)
tree80e38e06c9634065ce9567f3512740a009c7d86c
parentd2f0b38ce91cd4210023fedbb6a809815b2f6339 (diff)
Adding mpqlib_fs_filelist
-rw-r--r--mpq-fs.c20
-rw-r--r--mpq-fs.h2
2 files changed, 22 insertions, 0 deletions
diff --git a/mpq-fs.c b/mpq-fs.c
index f797e74..68da3b8 100644
--- a/mpq-fs.c
+++ b/mpq-fs.c
@@ -128,6 +128,26 @@ struct mpq_file_t * mpqlib_fs_open(const char * _fname) {
return NULL;
}
+int mpqlib_fs_filelist(char * buffer) {
+ int r_size = 0, l;
+ char * p = buffer;
+
+ if (!hash_table)
+ return 0;
+
+ if (hfirst(hash_table)) do {
+ l = strlen(hkey(hash_table));
+ r_size += l + 1;
+ if (p) {
+ strcpy(p, hkey(hash_table));
+ p += l;
+ *(p++) = '\n';
+ }
+ } while (hnext(hash_table));
+
+ return r_size;
+}
+
#define FALSE 0
#define TRUE !FALSE
diff --git a/mpq-fs.h b/mpq-fs.h
index 69e70f3..6ad9483 100644
--- a/mpq-fs.h
+++ b/mpq-fs.h
@@ -13,6 +13,8 @@ void mpqlib_fs_attach_listfile(struct mpq_archive_t *, const char *);
struct mpq_file_t * mpqlib_fs_open(const char *);
+int mpqlib_fs_filelist(char * buffer);
+
void mpqlib_fs_shutdown();
#ifdef __cplusplus