资源简介
bsdiff二进制比较工具
bspatch对应的补丁工具
vc6源码工程
代码片段和文件信息
/*-------------------------------------------------------------*/
/*--- Block sorting machinery ---*/
/*--- blocksort.c ---*/
/*-------------------------------------------------------------*/
/* ------------------------------------------------------------------
This file is part of bzip2/libbzip2 a program and library for
lossless block-sorting data compression.
bzip2/libbzip2 version 1.0.4 of 20 December 2006
Copyright (C) 1996-2006 Julian Seward
Please read the WARNING DISCLAIMER and PATENTS sections in the
README file.
This program is released under the terms of the license contained
in the file LICENSE.
------------------------------------------------------------------ */
#include “bzlib_private.h“
/*---------------------------------------------*/
/*--- Fallback O(N log(N)^2) sorting ---*/
/*--- algorithm for repetitive blocks ---*/
/*---------------------------------------------*/
/*---------------------------------------------*/
static
__inline__
void fallbackSimpleSort ( UInt32* fmap
UInt32* eclass
Int32 lo
Int32 hi )
{
Int32 i j tmp;
UInt32 ec_tmp;
if (lo == hi) return;
if (hi - lo > 3) {
for ( i = hi-4; i >= lo; i-- ) {
tmp = fmap[i];
ec_tmp = eclass[tmp];
for ( j = i+4; j <= hi && ec_tmp > eclass[fmap[j]]; j += 4 )
fmap[j-4] = fmap[j];
fmap[j-4] = tmp;
}
}
for ( i = hi-1; i >= lo; i-- ) {
tmp = fmap[i];
ec_tmp = eclass[tmp];
for ( j = i+1; j <= hi && ec_tmp > eclass[fmap[j]]; j++ )
fmap[j-1] = fmap[j];
fmap[j-1] = tmp;
}
}
/*---------------------------------------------*/
#define fswap(zz1 zz2) \
{ Int32 zztmp = zz1; zz1 = zz2; zz2 = zztmp; }
#define fvswap(zzp1 zzp2 zzn) \
{ \
Int32 yyp1 = (zzp1); \
Int32 yyp2 = (zzp2); \
Int32 yyn = (zzn); \
while (yyn > 0) { \
fswap(fmap[yyp1] fmap[yyp2]); \
yyp1++; yyp2++; yyn--; \
} \
}
#define fmin(ab) ((a) < (b)) ? (a) : (b)
#define fpush(lzhz) { stackLo[sp] = lz; \
stackHi[sp] = hz; \
sp++; }
#define fpop(lzhz) { sp--; \
lz = stackLo[sp]; \
hz = stackHi[sp]; }
#define FALLBACK_QSORT_SMALL_THRESH 10
#define FALLBACK_QSORT_STACK_SIZE 100
static
void fallbackQSort3 ( UInt32* fmap
UInt32* eclass
Int32 loSt
Int32 hiSt )
{
Int32 unLo unHi ltLo gtHi n m;
Int32 sp lo hi;
UInt32 med r r3;
Int32 stackLo[FALLBACK_QSORT_STACK_SIZE];
Int32 stackHi[FALLBACK_QSORT_STACK_SIZE
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1935 2007-05-21 19:49 Binary diff.txt
文件 30694 2007-01-03 04:00 blocksort.c
文件 2226 2005-08-17 00:05 bsdiff.1
文件 11988 2007-05-21 19:08 bsdiff.cpp
文件 4851 2007-05-21 19:38 bsdiff.dsp
文件 724 2004-08-29 17:51 bsdiff.dsw
文件 2038 2005-08-17 00:05 bspatch.1
文件 7439 2007-05-21 19:32 bspatch.cpp
文件 4868 2007-05-21 19:38 bspatch.dsp
文件 45934 2007-01-03 04:00 bzlib.c
文件 6245 2007-01-03 04:00 bzlib.h
文件 12835 2007-01-03 04:00 bzlib_private.h
文件 20561 2007-01-03 04:00 compress.c
文件 4818 2007-01-03 04:00 crctable.c
文件 20030 2007-01-03 04:00 decompress.c
文件 6991 2007-01-03 04:00 huffman.c
文件 6414 2004-07-11 20:10 LICENSE
文件 3860 2007-01-03 04:00 randtable.c
目录 0 2004-08-29 15:47 Release\
文件 38912 2007-05-21 19:09 Release\bsdiff.exe
文件 35328 2007-05-21 19:34 Release\bspatch.exe
- 上一篇:数字水印c++实现
- 下一篇:C和指针 第二版 答案 清晰 PDF
评论
共有 条评论