=> 8ab9feebb2a08ba6eed516494431b0df451cfeed
[1mdiff --git a/include/the_Foundation/archive.h b/include/the_Foundation/archive.h[m [1mindex 782d232..68de5bd 100644[m [1m--- a/include/the_Foundation/archive.h[m [1m+++ b/include/the_Foundation/archive.h[m [36m@@ -41,7 +41,7 @@[m [mstruct Impl_ArchiveEntry {[m size_t archPos;[m size_t archSize;[m int compression;[m [31m- iBlock * data;[m [32m+[m[32m iBlock * data; /* NULL until uncompressed with `data_Archive()` */[m };[m [m iDeclareClass(Archive)[m [36m@@ -54,11 +54,11 @@[m [mvoid close_Archive (iArchive *);[m iBool isOpen_Archive (const iArchive *);[m size_t numEntries_Archive (const iArchive *);[m [m [31m-const iArchiveEntry * at_Archive (const iArchive *, size_t index);[m [31m-const iArchiveEntry * atPath_Archive (const iArchive *, const iString *path);[m [32m+[m[32mconst iArchiveEntry * entry_Archive (const iArchive *, const iString *path);[m [32m+[m[32mconst iArchiveEntry * entryAt_Archive (const iArchive *, size_t index);[m [m [31m-const iBlock * data_Archive (const iArchive *, size_t index);[m [31m-const iBlock * dataPath_Archive (const iArchive *, const iString *path);[m [32m+[m[32mconst iBlock * data_Archive (const iArchive *, const iString *path);[m [32m+[m[32mconst iBlock * dataAt_Archive (const iArchive *, size_t index);[m [m /** @name Iterators */[m ///@{[m [1mdiff --git a/src/archive.c b/src/archive.c[m [1mindex 608e53d..4880e44 100644[m [1m--- a/src/archive.c[m [1m+++ b/src/archive.c[m [36m@@ -220,6 +220,7 @@[m [mvoid init_ArchiveEntry(iArchiveEntry *d) {[m }[m [m void deinit_ArchiveEntry(iArchiveEntry *d) {[m [32m+[m[32m delete_Block(d->data);[m deinit_String(&d->path);[m }[m [m [36m@@ -417,26 +418,26 @@[m [msize_t numEntries_Archive(const iArchive *d) {[m return size_SortedArray(d->entries);[m }[m [m [31m-const iArchiveEntry *at_Archive(const iArchive *d, size_t index) {[m [32m+[m[32mconst iArchiveEntry *entryAt_Archive(const iArchive *d, size_t index) {[m if (index >= size_SortedArray(d->entries)) {[m return NULL;[m }[m return constAt_SortedArray(d->entries, index);[m }[m [m [31m-const iArchiveEntry *atPath_Archive(const iArchive *d, const iString *path) {[m [31m- return at_Archive(d, findPath_Archive_(d, path));[m [32m+[m[32mconst iArchiveEntry *entry_Archive(const iArchive *d, const iString *path) {[m [32m+[m[32m return entryAt_Archive(d, findPath_Archive_(d, path));[m }[m [m [31m-const iBlock *data_Archive(const iArchive *d, size_t index) {[m [32m+[m[32mconst iBlock *dataAt_Archive(const iArchive *d, size_t index) {[m if (index >= size_SortedArray(d->entries)) {[m return NULL;[m }[m return loadEntry_Archive_(d, index)->data;[m }[m [m [31m-const iBlock *dataPath_Archive(const iArchive *d, const iString *path) {[m [31m- return data_Archive(d, findPath_Archive_(d, path));[m [32m+[m[32mconst iBlock *data_Archive(const iArchive *d, const iString *path) {[m [32m+[m[32m return dataAt_Archive(d, findPath_Archive_(d, path));[m }[m [m /*----------------------------------------------------------------------------------------------*/[m [36m@@ -445,7 +446,7 @@[m [mvoid init_ArchiveConstIterator(iArchiveConstIterator *d, const iArchive *archive[m if (archive) {[m d->archive = archive;[m d->index = 0;[m [31m- d->value = at_Archive(archive, 0);[m [32m+[m[32m d->value = entryAt_Archive(archive, 0);[m }[m else {[m iZap(*d);[m [36m@@ -454,7 +455,7 @@[m [mvoid init_ArchiveConstIterator(iArchiveConstIterator *d, const iArchive *archive[m [m void next_ArchiveConstIterator(iArchiveConstIterator *d) {[m if (d->archive && d->value) {[m [31m- d->value = at_Archive(d->archive, ++d->index);[m [32m+[m[32m d->value = entryAt_Archive(d->archive, ++d->index);[m }[m }[m [m [1mdiff --git a/tests/t_archive.c b/tests/t_archive.c[m [1mindex ebf3091..1e2fc30 100644[m [1m--- a/tests/t_archive.c[m [1m+++ b/tests/t_archive.c[m [36m@@ -18,7 +18,7 @@[m [mint main(int argc, char **argv) {[m if (arg) {[m const iString *entryPath = value_CommandLineArg(arg, 0);[m printf("decompressing: %s\n", cstr_String(entryPath));[m [31m- const iBlock *data = dataPath_Archive(arch, entryPath);[m [32m+[m[32m const iBlock *data = data_Archive(arch, entryPath);[m printf("got %zu bytes\n", size_Block(data));[m fwrite(constData_Block(data), size_Block(data), 1, stderr);[m continue;[m
text/gemini; charset=utf-8
This content has been proxied by September (ba2dc).