Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / Zlib.DLL and the .gz format

Author
Message
Burning Feet Man
9
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 24th Jun 2013 23:55 Edited at: 25th Jun 2013 08:50
Hi People,

One of my recent programming adventures has taken an interesting turn with the discovery of the ZLIB.dll in all of its mystical wonders. If I could get my current DBPro project to pricess .gz archives (which I believe are compressed & decompressed via Zlib.dll), my project would explode with awesomeness.

But before I start re-inventing the wheel, has anyone got any code, plugins or general hints & tips that may assist with this task? So far, I've started investigating the zlib128-dll.zip download, which contains zlib1.dll and some manuals.

A few questions on such 3rd Party DLL's;
If my DBPro application calls functions from this DLL, then I'm assuming I'll have to ship this DLL everywhere my EXE goes. Although I believe the ZLIB.dll is free to share as such, alternatively, is it possible to host the Zlib.dll under;

C:\Program Files (x86)\The Game Creators\Dark Basic Professional Online\Compiler\plugins-user

Where it will then compile into my executable? How would I gear this second method to work?

Any help will be greatly appreciated! Oh, and yes, I have searched these forums extensively, but I only found some broken & abandoned plugins, along with general chit-chat about devs wanting to protect their IP. I also started looking at examples of zlib.dll with VB6, but thought I best ask here first before getting lost...

My main goal here is to open .gz archives, read the file within, then compress them back to .gz.

EDIT: I'm going to try following this tutorial;

http://edais.mvps.org/Tutorials/ZLib/index.html

Although I fear that I'm in over my head!

EDIT: Argh, the plot thickens! My favourite Zip program, 7Zip, allows the use & distribution of the 7z.DLL. I think I might try talking to this first via my DBPro program, as I haven't found any way to ease into ZLib.dll

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Booma
8
Years of Service
User Offline
Joined: 29th Mar 2009
Location:
Posted: 25th Jun 2013 10:20
@Burning Feet Man

look at this http://en.wikipedia.org/wiki/PhysicsFS this lib is very fast

and look here http://forum.thegamecreators.com/?m=forum_view&t=188049&b=1

Burning Feet Man
9
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 25th Jun 2013 12:46 Edited at: 26th Jun 2013 03:39
Thanks for your time on this Booma. Unfortunately, my main target resource (at this point in time) is the .gz (.Gzip) file format, which doesn't appear supported via the PhysicsFS library.

On my train ride home this evening, I tinkered with 7za.exe command lines, and they worked a treat;

To Build an archive:
+ Code Snippet

To Extract a file from an archive:
+ Code Snippet

But still, I see the above workflow as a workaround. I'd love to call a function from a DLL if possible, or even have all this stuff internal to my application, so there would be no need to call any DLL.

EDIT: This morning I've found a 7za.DLL library on SourceForge which is a tiny 200kb, and looks to have more n00b documentation than Zlib1.DLL. I will spend some time today reading more into this.

One thing I'd like to do is extract a file from a gzip archive into memory, rather than into a file on disk. After all, I'm only trying to parse the contents of gzip archives but not edit/save them.

EDIT: Fail face, I can't interface my app with the 7za.DLL. =/ Really struggling to find the right tutorials online too.

EDIT!: I think the below will help;

http://svn.ghostscript.com/ghostscript/trunk/gs/zlib/old/visual-basic.txt

And the manual;

http://www.gzip.org/zlib/manual.html

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Duffer
14
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 28th Jun 2013 17:59
Is this any use - saved this away years ago - someone created a GZIP plugin for DBPro?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...

Attachments

Login to view attachments
Burning Feet Man
9
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 29th Jun 2013 02:03
I'd already explored that at the beginning of my journey Duffer. It's a great example of why us indie developers shouldn't pursue DRM;



Although on the flipside, I understand the wanting to protect ones property and to be rewarded for such work.

But this Gzip plugin is not an option due to the purchase/beta message.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Duffer
14
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 29th Jun 2013 12:12
Ahhh - see what you mean (now I've logged in to the forums)...

hmmm - let me know if you find a solution.

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Burning Feet Man
9
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 18th Jul 2013 05:47 Edited at: 25th Jul 2013 13:34
Sad panda not to see anyone else have anything further to say on this topic.

I guess no one is reading .Gzipped files into memory with their DBPro projects?

EDIT: Found some more reading here;

http://www.winimage.com/zLibDll/index.html

I think this is a steer in the right direction... gonna try some code out.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia

Login to post a reply

Server time is: 2017-05-23 18:04:01
Your offset time is: 2017-05-23 18:04:01