minizip lib

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
jamba
Enthusiast
Enthusiast
Posts: 144
Joined: Fri Jan 15, 2010 2:03 pm
Location: Triad, NC
Contact:

Re: minizip lib

Post by jamba »

this is great! thanks ts-soft.

A couple of questions...
what language is your minizip.lib written in? C?
Also, in the event you no longer support this would you release the source to the lib?
-Jon

Fedora user
But I work with Win7
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: minizip lib

Post by ts-soft »

The source for the static lib is here available.
The PureBasic Source to use this static lib is in the downloadpackage.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
jamba
Enthusiast
Enthusiast
Posts: 144
Joined: Fri Jan 15, 2010 2:03 pm
Location: Triad, NC
Contact:

Re: minizip lib

Post by jamba »

ts-soft wrote:The source for the static lib is here available.
The PureBasic Source to use this static lib is in the downloadpackage.
you are the man, thanks!
-Jon

Fedora user
But I work with Win7
shire
User
User
Posts: 46
Joined: Mon Jul 25, 2011 5:24 am

Re: minizip lib

Post by shire »

Hello,

Is there a library for linux which is something like this?

Thanks.
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

Re: minizip lib

Post by jassing »

I have come back to a project to make changes, it was originally done in an earlier version of PB - using the latest, I get:

POLINK: error: Unresolved external symbol 'SYS_AllocateString'.
POLINK: error: Unresolved external symbol 'PB_CallFunctionFast2'.
POLINK: fatal error: 2 unresolved external(s).

any ideas? or is the lib not compatible with 4.61?
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: minizip lib

Post by ts-soft »

Use the includefile, the userlib is not up to date!
Or use tailbite to create a userlib.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

Re: minizip lib

Post by jassing »

ts-soft wrote:Use the includefile, the userlib is not up to date!
Or use tailbite to create a userlib.

Thanks! That did it.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: minizip lib

Post by ts-soft »

Update

Bugfix-Release:
fixed division by zero error
fixed nullbyte files not extracted
fixed examples static lib not found
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Re: minizip lib

Post by ricardo »

I tried this to add a folder

Code: Select all

IncludePath "..\"
XIncludeFile "minizip_include.pbi"

Define.s zip
zip = "H:\ABC\test.zip"

Define ff = ZIP_FileCreate(zip.s)
If ff
  ZIP_DirAdd(ff,"H:\ABC\ABC\",#Z_DEFAULT_COMPRESSION,0)
  ZIP_FileClose(ff)
EndIf

But i get "division by zero forbidden".

Any advice?
ARGENTINA WORLD CHAMPION
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: minizip lib

Post by ts-soft »

You are using the latest version as include?
The debugger doesn't show the line with division by zero?
The dir for packing is empty?

Okay, i have added blind some sanitycheck, please download the latest version.

Greetings - Thomas
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Michael Vogel
Addict
Addict
Posts: 2797
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: minizip lib

Post by Michael Vogel »

Since purebasic has "lost" some important zip functionality (e.g. adding a file to a packed file), I searched for an alternative - and minizip looks really good (thank you, Thomas).

I would recommend to update the pbi file to be usable for the latest versions of Purebasic, I changed the three CRC32Fingerprint() and CRC32FileFingerprint() calls and added the following lines to the code...

Code: Select all

	:
	CompilerIf #PB_Compiler_Version<540

		Macro Fingerprint(source,size,dummy)
			CRC32Fingerprint(source,size)
		EndMacro
		Macro FileFingerprint(file,dummy)
			CRC32FileFingerprint(file)
		EndMacro

	CompilerElse
		UseCRC32Fingerprint()

	CompilerEndIf

	:

	result= ... #Z_DEFLATED,Compression,0,15,8,0,ZIP_Password,FileFingerprint(Filename,#PB_Cipher_CRC32))
	result= ... #Z_DEFLATED,Compression,0,15,8,0,ZIP_Password,FileFingerprint(ZIP_FileList(),#PB_Cipher_CRC32))
	result= ... #Z_DEFLATED,Compression,0,15,8,0,ZIP_Password,Fingerprint(*source,sourceLen,#PB_Cipher_CRC32))

	:

Post Reply