Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pascal example #318

Merged
merged 1 commit into from
Oct 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,39 @@ void main()
}
```

#### [Pascal](https://en.wikipedia.org/wiki/Pascal_(programming_language))
> Third party binding: [thechampagne/zip-pascal](https://github.com/thechampagne/zip-pascal)

```pas
program main;

{$linklib c}
{$linklib zip}

uses ctypes;

function zip_open(zipname:Pchar; level:longint; mode:char):pointer;cdecl;external;
procedure zip_close(zip:pointer);cdecl;external;
function zip_entry_open(zip:pointer; entryname:Pchar):longint;cdecl;external;
function zip_entry_close(zip:pointer):longint;cdecl;external;
function zip_entry_write(zip:pointer; buf:pointer; bufsize:csize_t):longint;cdecl;external;

const
content: Pchar = 'test content';
var
zip : pointer;

begin
zip := zip_open('/tmp/pascal.zip', 6, 'w');

zip_entry_open(zip, 'test');

zip_entry_write(zip, content, strlen(content));
zip_entry_close(zip);
zip_close(zip);
end.
```

### 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
Loading