Posted: Wed May 24, 2006 1:45 pm
Thank you, ts-soft
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
ImportC "brieflz.lib"
_blz_workmem_size.l(InputSize.l) As "_blz_workmem_size"
_blz_max_packed_size.l(InputSize.l) As "_blz_max_packed_size"
_blz_pack.l(*Source, *Destination, length.l, *WorkMem) As "_blz_pack"
_blz_crc32.l(*Source, length.l, InitialCrc32.l) As "_blz_crc32"
_blz_depack.l(*Source, *Destination, DepackedSize.l) As "_blz_depack"
EndImport
;
ProcedureDLL BriefLZ_WorkMemSize(InputSize.l) ; Computes the required size of the WorkMem buffer used by BriefLZ_Pack() for compressing InputSize bytes of data.
ProcedureReturn _blz_workmem_size(InputSize.l)
EndProcedure
;
ProcedureDLL BriefLZ_MaxPackedSize(InputSize.l) ; Computes the maximum possible compressed size possible when compressing InputSize bytes of incompressible data.
ProcedureReturn _blz_max_packed_size(InputSize)
EndProcedure
;
ProcedureDLL BriefLZ_Pack(*Source, *Destination, length.l, *WorkMem) ; Compresses Length bytes of data from *Source into *Destination, using *WorkMem buffer for temporary storage.
ProcedureReturn _blz_pack(*Source, *Destination, length, *WorkMem)
EndProcedure
;
ProcedureDLL BriefLZ_Depack(*Source, *Destination, DepackedSize.l) ; Decompresses the compressed data from *Source into *Destination.
ProcedureReturn _blz_depack(*Source, *Destination, DepackedSize)
EndProcedure
;
ProcedureDLL BriefLZ_Crc32(*Source, length.l, InitialCrc32.l) ; Computes the CRC32 value of Length bytes of data from *Source.
ProcedureReturn _blz_crc32(*Source, length, InitialCrc32)
EndProcedure
Code: Select all
;
; BriefLZ test file 1
;
TestString.s = "ThisIsATestThisIsATestThisIsATestThisIsATestThisIsATestThisIsATestThisIsATestThisIsATest"
TestString = TestString + TestString + TestString + TestString + TestString + TestString + TestString
;
Length.l = Len(TestString)
MaxPackedSize.l = BriefLZ_MaxPackedSize(Length)
WorkMemSize.l = BriefLZ_WorkMemSize(Length)
*WorkMem = AllocateMemory(WorkMemSize)
*Destination = AllocateMemory(MaxPackedSize)
;
*Source = AllocateMemory(Length)
CopyMemory(@TestString, *Source, Length)
Debug BriefLZ_Crc32(*Source, Length, 0)
;
Debug BriefLZ_Pack(*Source, *Destination, Length, *WorkMem)
;
TestString2.s = Space(Length)
;
Debug BriefLZ_Depack(*Destination, *Source, Length);
CopyMemory(*Source, @TestString2, Length)
Debug TestString2
;
If TestString = TestString2
Debug "Success"
Else
Debug "Failed"
EndIf
I'll look if I can reproduce this tomorrow or such with a small code.---------------------------
TailBite Error
---------------------------
FAsm: Shared\CheckMeshCol.asm
flat assembler version 1.58
C:\Programme\PureBASIC4\TailBite\TBTemp\Functions\Shared\CheckMeshCol.asm [287]:
FDIV qword [D6]
error: undefined symbol.
Die Pipe wurde beendet.
---------------------------
OK
---------------------------
Thanks, i'm waiting for thisEl_Choni wrote:Sorry, I'm delaying the update because I'm adding default parameters support, which takes more time. Can't upload it now because the source is messed up because of that. I'll upload it as soon as it works again
I assume the 'old way' will not work anymore,El_Choni wrote:Sorry, I'm delaying the update because I'm adding default parameters support, which takes more time. Can't upload it now because the source is messed up because of that. I'll upload it as soon as it works again
Code: Select all
Procedure MyProcedure(Param1)
Procedure MyProcedure2(Param1, Param2)
Procedure MyProcedure3(Param1, Param2, Param3)
Code: Select all
Procedure MyProcedure(Param1, Param2 = 0, Param3 = 0)
I hope it won't work anymore, as it makes no senses with the new syntaxgnozal wrote:I assume the 'old way' will not work anymore
Ok. Thanks.El_Choni wrote:gnozal: that's it.