1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

24 lines
830 B
C
Raw Normal View History

2021-04-04 12:17:57 +08:00
// hpatch.c
// Copyright 2021 housisong, All rights reserved
2021-04-04 15:50:40 +08:00
#include "hpatch.h"
#include "HDiffPatch/libHDiffPatch/HPatch/patch.h"
int hpatch_getInfo_by_mem(struct hpatch_singleCompressedDiffInfo* out_patinfo,
const uint8_t* pat,size_t patsize){
hpatch_TStreamInput patStream;
mem_as_hStreamInput(&patStream,pat,pat+patsize);
if (!getSingleCompressedDiffInfo(out_patinfo,&patStream,0))
return -1;//data error;
return 0; //ok
}
2021-04-04 12:17:57 +08:00
int hpatch_by_mem(const uint8_t* old,size_t oldsize, uint8_t* newBuf,size_t newsize,
2021-04-04 15:50:40 +08:00
const uint8_t* pat,size_t patsize,const struct hpatch_singleCompressedDiffInfo* patInfo){
2021-04-04 12:17:57 +08:00
//todo:
return -1;
}
int hpatch_by_file(const char* oldfile, const char* newfile, const char* patchfile){
//todo:
return -1;
}