Example #1
0
func NewLibrary() (*Library, error) {
	l := C.create_C7ZipLibrary()
	if getBool(C.c7zLib_Initialize(l)) == false {
		err := getError(C.c7zLib_GetLastError(l))
		C.free_C7ZipLibrary(l)
		return nil, err
	}
	lib := &Library{l}
	return lib, nil
}
Example #2
0
func (lib *Library) Close() {
	if lib.l == nil {
		return
	}

	if getBool(C.c7zLib_IsInitialized(lib.l)) {
		C.c7zLib_Deinitialize(lib.l)
	}
	C.free_C7ZipLibrary(lib.l)
	lib.l = nil
}