資源簡介
bsdiff的發行版本,用于小容量單片機的增量升級,包含一個軟件,用于生成補丁包,和使用C寫的用于移植到單片機上解碼的代碼
代碼片段和文件信息
/*-
?*?Copyright?2020?chenkang
?*?All?rights?reserved
?*
?*?Redistribution?and?use?in?source?and?binary?forms?with?or?without
?*?modification?are?permitted?providing?that?the?following?conditions
?*?are?met:
?*?1.?Redistributions?of?source?code?must?retain?the?above?copyright
?*????notice?this?list?of?conditions?and?the?following?disclaimer.
?*?2.?Redistributions?in?binary?form?must?reproduce?the?above?copyright
?*????notice?this?list?of?conditions?and?the?following?disclaimer?in?the
?*????documentation?and/or?other?materials?provided?with?the?distribution.
?*
?*?THIS?SOFTWARE?IS?PROVIDED?BY?THE?COPYRIGHT?HOLDERS?AND?CONTRIBUTORS
?*?“AS?IS“?AND?ANY?EXPRESS?OR?IMPLIED?WARRANTIES?INCLUDING?BUT?NOT
?*?LIMITED?TO?THE?IMPLIED?WARRANTIES?OF?MERCHANTABILITY?AND?FITNESS?FOR
?*?A?PARTICULAR?PURPOSE?ARE?DISCLAIMED.?IN?NO?EVENT?SHALL?THE?COPYRIGHT
?*?OWNER?OR?CONTRIBUTORS?BE?LIABLE?FOR?ANY?DIRECT?INDIRECT?INCIDENTAL
?*?SPECIAL?EXEMPLARY?OR?CONSEQUENTIAL?DAMAGES?(INCLUDING?BUT?NOT
?*?LIMITED?TO?PROCUREMENT?OF?SUBSTITUTE?GOODS?OR?SERVICES;?LOSS?OF?USE
?*?DATA?OR?PROFITS;?OR?BUSINESS?INTERRUPTION)?HOWEVER?CAUSED?AND?ON?ANY
?*?THEORY?OF?LIABILITY?WHETHER?IN?CONTRACT?STRICT?LIABILITY?OR?TORT
?*?(INCLUDING?NEGLIGENCE?OR?OTHERWISE)?ARISING?IN?ANY?WAY?OUT?OF?THE?USE
?*?OF?THIS?SOFTWARE?EVEN?IF?ADVISED?OF?THE?POSSIBILITY?OF?SUCH?DAMAGE.
?*/
#include?
#include?“file_handler.h“
#include?
#include?
static?off_t?unzip_data_pos;
static?off_t?unzip_data_maxlen;
static?structpatch_data?handle_data;
static?Unzip_Ctrl_Data?Patch_Unzip_Ctrl_Data;
static?Patch_Status?handle_data_status;
static?int?data_counter?=?0;
int?Patchdata_handler(structpatch_data?handle_data?FILE_ID?*old_file?FILE_ID?*new_file){
????uint8_t?read_data;
????uint8_t?write_data;
????int?i;
????if(handle_data.patchctrl_data.patchdata1_len){
????????if(handle_data.patchctrl_data.patchdata1_pos?!=?old_file->offset){
????????????file_lseek(old_file?handle_data.patchctrl_data.patchdata1_pos);
????????}
????????for(i?=?0;?i?????????????if(file_read(old_file?&read_data?1)?!=?1)
????????????????return?-1;
????????????write_data?=?read_data?+?handle_data.patchdata[i];
????????????if(file_write(new_file?&write_data?1)?!=?1)
????????????????return?-1;
????????}
????}
????if(handle_data.patchctrl_data.patchdata2_len){
????????if(file_write(new_file?&(handle_data.patchdata[handle_data.patchctrl_data.patchdata1_len])??\
??????????????????????handle_data.patchctrl_data.patchdata2_len)?!=?handle_data.patchctrl_data.patchdata2_len)
????????????return?-1;
????}
????return?0;
}
void?Handle_Data_Init(off_t?data){
????unzip_data_pos?=?0;
????data_counter?=?0;
????unzip_data_maxlen?=?data;
????memset(&handle_data?0?sizeof(structpatch_data));
????memset(&Patch_Unzip_Ctrl_Data?0?sizeof(Unzip_Ctrl_Data));
????handle_data_status?=?Handle
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????160??2020-07-26?14:24??gitee_bsdiff\.git\COMMIT_EDITMSG
?????文件????????307??2020-07-24?08:59??gitee_bsdiff\.git\config
?????文件?????????73??2020-07-21?09:36??gitee_bsdiff\.git\desc
?????文件????????107??2020-07-23?21:43??gitee_bsdiff\.git\FETCH_HEAD
?????文件?????????23??2020-07-21?09:36??gitee_bsdiff\.git\HEAD
?????文件????????478??2020-07-21?09:36??gitee_bsdiff\.git\hooks\applypatch-msg.sample
?????文件????????896??2020-07-21?09:36??gitee_bsdiff\.git\hooks\commit-msg.sample
?????文件???????3327??2020-07-21?09:36??gitee_bsdiff\.git\hooks\fsmonitor-watchman.sample
?????文件????????189??2020-07-21?09:36??gitee_bsdiff\.git\hooks\post-update.sample
?????文件????????424??2020-07-21?09:36??gitee_bsdiff\.git\hooks\pre-applypatch.sample
?????文件???????1638??2020-07-21?09:36??gitee_bsdiff\.git\hooks\pre-commit.sample
?????文件????????416??2020-07-21?09:36??gitee_bsdiff\.git\hooks\pre-merge-commit.sample
?????文件???????1348??2020-07-21?09:36??gitee_bsdiff\.git\hooks\pre-push.sample
?????文件???????4898??2020-07-21?09:36??gitee_bsdiff\.git\hooks\pre-reba
?????文件????????544??2020-07-21?09:36??gitee_bsdiff\.git\hooks\pre-receive.sample
?????文件???????1492??2020-07-21?09:36??gitee_bsdiff\.git\hooks\prepare-commit-msg.sample
?????文件???????3610??2020-07-21?09:36??gitee_bsdiff\.git\hooks\update.sample
?????文件???????4924??2020-07-26?14:24??gitee_bsdiff\.git\index
?????文件????????240??2020-07-21?09:36??gitee_bsdiff\.git\info\exclude
?????文件???????2066??2020-07-26?14:24??gitee_bsdiff\.git\logs\HEAD
?????文件???????2066??2020-07-26?14:24??gitee_bsdiff\.git\logs\refs\heads\master
?????文件???????1063??2020-07-26?14:24??gitee_bsdiff\.git\logs\refs\remotes\gitee\master
?????文件??????48005??2020-07-21?09:36??gitee_bsdiff\.git\ob
?????文件??????55197??2020-07-21?09:36??gitee_bsdiff\.git\ob
?????文件??????48233??2020-07-22?21:03??gitee_bsdiff\.git\ob
?????文件??????47853??2020-07-21?12:27??gitee_bsdiff\.git\ob
?????文件????????156??2020-07-26?14:24??gitee_bsdiff\.git\ob
?????文件?????701551??2020-07-21?09:36??gitee_bsdiff\.git\ob
?????文件????????303??2020-07-21?09:36??gitee_bsdiff\.git\ob
?????文件????????187??2020-07-21?09:36??gitee_bsdiff\.git\ob
............此處省略267個文件信息
- 上一篇:聯想硬盤保護系統
- 下一篇:奶瓶1.2.1linux
評論
共有 條評論