LZO是一个压缩库,提供快速压缩和非常快速的减压。
网址:http://www.oberhumer.com/opensource/lzo/
支持平台:Win32,Linux,DOS
标题包括:lzo / lzo.bi
标题版本:2.02
例子
#include "lzo/lzo1x.bi"
Dim inbuf As ZString Ptr = @"字符串压缩(或不,因为它很短)"
Dim inlen As Integer = Len(*inbuf) + 1
Dim complen As lzo_uint = 100
Dim compbuf As ZString Ptr = Allocate(complen)
Dim decomplen As lzo_uint = 100
Dim decompbuf As ZString Ptr = Allocate(decomplen)
Dim workmem As Any Ptr
Print "初始化LZO:";
If lzo_init() = 0 Then
Print "ok"
Else
Print "失败!"
End 1
End If
Print "压缩“" & *inbuf & "':";
workmem = Allocate(LZO1X_1_15_MEM_COMPRESS)
If lzo1x_1_15_compress(inbuf, inlen, compbuf, @complen, workmem) = 0 Then
Print "ok (" & inlen & "字节," & complen & "字节压缩)"
Else
Print "失败!"
End 1
End If
Deallocate(workmem)
Print "减压:";
workmem = Allocate(LZO1X_MEM_DECOMPRESS)
If lzo1x_decompress(compbuf, complen, decompbuf, @decomplen, NULL) = 0 Then
Print "ok: '" & *decompbuf & "' (" & complen & "字节压缩," & decomplen & "字节解压缩)"
Else
Print "失败!"
End 1
End If
Deallocate(workmem)