4 * Copyright (c) 2017 - 2022 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the License);
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
22 #include "fota_common.h"
24 #define DISPLAYRESOLUTION_SIZE 50
37 enum DEL_TYPE { DELETES = 1, DIFFS, MOVES, DELETE_END, NEWFILES, SYMDIFFS, SYMNEWFILES, HARDDIFFS, HARDNEWFILES, DEL_TYPE_MAX };
38 struct fs_params { // Use Macros
39 char file_old_path[512];
40 char file_new_path[512];
46 int type; //0 is for diff and 1 is for verbatim
47 struct fs_params *nextnode;
49 typedef struct fs_params fs_params;
56 fs_params *sym_difref;
57 fs_params *sym_newref;
58 fs_params *hard_difref;
59 fs_params *hard_newref;
62 typedef struct fs_list fs_list;
64 int SS_AppendNode(const char *ubDeltaPath, fs_params ** headparam, fs_params ** tailparam, const char *old_path,
65 const char *new_path, const char *patchname, const char *sha1src, const char *sha1trg, int type,
66 char *patchpath_name);
67 long SS_GetUPIVersion(unsigned char *ver_str);
68 extern int SS_FSUpdatemain(ua_dataSS_t * ua_dataSS);
69 extern int SS_FSVerifyPartition(ua_dataSS_t * ua_dataSS);
72 extern void *SS_Malloc(unsigned int size);
73 extern int tar_get_item_size_from_struct(tar_Data_t **, const char *, int *, int *);
74 extern void SS_Free(void *pMemBlock);
75 extern int tar_get_item_size(char *tar, char *item);
76 extern int tar_get_cfg_data(char *tar, char *item, char *buf, int buflen);
77 extern tar_Data_t *tar_build_cfg_table(char *tar);
78 extern int tar_open(char *tar);
79 extern int fast_tar_extract_file(char *tar, char *item, char *pathname, int size, int offset);
80 extern int tar_close();
81 extern int SS_UpdateDeltaFS(const char *source_filename, const char *target_filename,
82 const char *source_sha1_str, const char *target_sha1_str, int patch_data_size, char *delta_folder);
83 extern int tar_extract_file(char *tar, char *item, char *pathname);
84 extern int _7zdecompress(char *path);
85 extern void tar_free_cfg_table(tar_Data_t ** delta_tar);
86 extern long SS_GetFileType(char *pLinkName, enumFileType * fileType);
88 extern int SS_Get_last_update_status(int* last_update_status, int* del_type, char *status_path);
89 extern void SS_Set_last_update_status(int last_update_status, int del_type, char *status_path);