Skip to content

Commit

Permalink
added doc
Browse files Browse the repository at this point in the history
  • Loading branch information
JCash committed Nov 29, 2024
1 parent 945dc0b commit 143c4ed
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,27 @@ zip_stream_close(zip);
free(buf);
```
* Extract a partial zip entry
```c
unsigned char buf[16];
size_t bufsize = sizeof(buf);
struct zip_t *zip = zip_open("foo.zip", 0, 'r');
{
zip_entry_open(zip, "foo-1.txt");
{
size_t offset = 4;
ssize_t nread = zip_entry_noallocread_offset(zip, offset, bufsize, (void *)buf);
}
zip_entry_close(zip);
}
zip_close(zip);
free(buf);
```

* List of all zip entries

```c
Expand Down

0 comments on commit 143c4ed

Please sign in to comment.