Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.
/ c-go-zip Public archive

Go wrapper for zip package which you can link in C.

Notifications You must be signed in to change notification settings

kuba--/c-go-zip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

c-go-zip

Go wrapper for zip package which you can link in C.

Build Go wrapper

# go build will create zip.a and zip.h files.
$ go build -buildmode c-archive -o zip.a

Link in C

#include "zip.h"

// usage: ./a.out my.zip file1 file2 file3 ...
int main(int argc, char *argv[]) {
    GoSlice files = { &argv[2], argc - 2, argc };
    
    // ziping...
    Zip(argv[1], files);
    
    // unzipping...
    Unzip(argv[1]);
    return 0;
}
# Compile & Link with zip.a
$ gcc zip.c zip.a -Wl,-no_pie
# Usage
$ ./a.out my.zip file1 file2 file3

About

Go wrapper for zip package which you can link in C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages