diff options
author | Pixel <pixel@nobis-crew.org> | 2009-02-17 02:03:49 +0100 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2009-02-17 02:03:49 +0100 |
commit | 5b99194c58385215cad973281a6f162d187ab971 (patch) | |
tree | 80e38e06c9634065ce9567f3512740a009c7d86c | |
parent | d2f0b38ce91cd4210023fedbb6a809815b2f6339 (diff) |
Adding mpqlib_fs_filelist
-rw-r--r-- | mpq-fs.c | 20 | ||||
-rw-r--r-- | mpq-fs.h | 2 |
2 files changed, 22 insertions, 0 deletions
@@ -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 @@ -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 |