Skip to content

Commit

Permalink
Update README.md with an example that uses the stream API to extract …
Browse files Browse the repository at this point in the history
…an in-memory archive (#336)

* Update zip.c and zip.h with new functions for reading in-memory zip archives

* Revert "Update zip.c and zip.h with new functions for reading in-memory zip archives"

This reverts commit 3028843.

* Add extra example to extracting in-memory archives

* Format example better
  • Loading branch information
bytesiz3d committed Feb 15, 2024
1 parent 4696e96 commit 358a929
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,13 @@ int on_extract_entry(const char *filename, void *arg) {
return 0;
}

// From "foo.zip" on disk
int arg = 2;
zip_extract("foo.zip", "/tmp", on_extract_entry, &arg);

// Or from memory
arg = 2;
zip_stream_extract(zipstream, zipstreamsize, "/tmp", on_extract_entry, &arg);
```
* Extract a zip entry into memory.
Expand Down

0 comments on commit 358a929

Please sign in to comment.