Skip to content

Commit

Permalink
add zig example to readme (#312)
Browse files Browse the repository at this point in the history
* add zig example to readme

* change zig example location
  • Loading branch information
thechampagne authored Oct 9, 2023
1 parent fb8df0f commit 9784367
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,25 @@ new Zip {
}
```

#### [Zig](https://ziglang.org)

```zig
const c = @cImport({
@cInclude("zip.h");
});
pub fn main() void {
var zip = c.zip_open("/tmp/zig.zip", 6, 'w');
defer c.zip_close(zip);
_ = c.zip_entry_open(zip, "test");
defer _ = c.zip_entry_close(zip);
const content = "test content";
_ = c.zip_entry_write(zip, content, content.len);
}
```

### Check out more cool projects which use this library

* [Filament](https://github.com/google/filament): Filament is a real-time physically based rendering engine for Android, iOS, Linux, macOS, Windows, and WebGL. It is designed to be as small as possible and as efficient as possible on Android.
Expand Down

0 comments on commit 9784367

Please sign in to comment.