upgrade-apply-deltafs: Drop unused legacy code
[platform/core/system/upgrade.git] / src / upgrade-apply-deltafs / engine / fota_common.h
1 /*
2  * upgrade-apply-deltafs
3  *
4  * Copyright (c) 2017 - 2022 Samsung Electronics Co., Ltd.
5  *
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
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
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.
17  */
18
19 #ifndef __FOTA_COMMON_H__
20 #define __FOTA_COMMON_H__
21
22 #include <stdio.h>
23 #include "fota_log.h"
24
25 typedef unsigned int u32;
26 #ifndef __size_t /* typedef check for x86 env: stddef.h */
27 #define __size_t
28 typedef u32 size_t;
29 #endif /* __size_t */
30
31 #define MAX_FILE_PATH           512
32
33 #define UNUSED(x) (void)(x)
34
35 #define SS_TOTA_VERSION                 "1.0.19"
36 #define BSDIFF                          "BSDIFF40"
37 #define IMGDIFF                         "IMGDIFF2"
38 #define SECTOR_SIZE                     512F
39 #define SS_KERNEL_DELTA_HEADER          128
40
41 #define SS_BACKUP_SOURCE                 "saved.file"       //How to make sure there is SPACE
42 #define SS_PATCHFILE_SOURCE              "patchfile.file"   //define in common place
43 #define SS_PATCHLIST_BKUPLOC             "patchlist.txt"
44 #define SS_NEW_COMPRESSED_FILE           "system.7z"
45
46 #define SS_PATCHLISTFORMAT              ".txt"
47 #define SS_PATCH_ATTR_FORMAT            "_attr.txt"
48 #define SS_GENERIC_FILE                 "file"
49 #define SS_GENERIC_PATCHLIST            SS_GENERIC_FILE SS_PATCHLISTFORMAT
50 #define SS_GENERIC_ATTR                         SS_GENERIC_FILE SS_PATCH_ATTR_FORMAT
51 #define SS_FSCOUNT_MAGIC_KEY            "PaTcHCoUnT:"
52 #define SS_FSCOUNT_MAGIG_KEYLEN         (11)    //length of  SS_FSCOUNT_MAGIC_KEY
53
54 #define SS_TOKEN_SPACE                  " "
55 #define SS_TOKEN_NEWLINE                "\n"
56 #define SS_TOEKN_COLON                  ":"
57 #define SS_FWSLASH                      "/"
58 #define SS_NULLENTRY                    "0"
59 #define SS_MAX_NAMELENSUPPORTED         (200)   //(Tar supports 256, But extra space is used for PartitionName, .delta, /p, so restricting filename max to 200)
60 #define SS_MAX_FILE_PATH                (512)
61 #define SS_TOKEN_MAXLINE_LEN            (1024)
62 #define SS_COMPRESSED_FILE              "system.7z"
63
64 #define SS_STRING_DIFF                  "DIFF"
65 #define SS_STRING_MOVE                  "MOVE"
66 #define SS_STRING_DEL                   "DEL"
67 #define SS_STRING_SYM                   "SYM"
68 #define SS_STRING_HARD                  "HARD"
69 #define SS_STRING_NEW                   "NEW"
70 #define SS_STRING_REG                   "REG"
71 #define SS_STRING_TPK                   "TPK"
72 #define SS_STRING_ZIP                   "ZIP"
73 #define SS_STRING_END                   "END"
74
75 #endif                          /* __FOTA_COMMON_H__ */