Removed compiler warnings
[profile/ivi/persistence-client-library.git] / src / persistence_client_library_backup_filelist.h
1 #ifndef PERSISTENCE_CLIENT_LIBRARY_BACKUP_FILELIST_H
2 #define PERSISTENCE_CLIENT_LIBRARY_BACKUP_FILELIST_H
3
4 /******************************************************************************
5  * Project         Persistency
6  * (c) copyright   2013
7  * Company         XS Embedded GmbH
8  *****************************************************************************/
9 /******************************************************************************
10  * This Source Code Form is subject to the terms of the
11  * Mozilla Public License, v. 2.0. If a  copy of the MPL was not distributed
12  * with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
13 ******************************************************************************/
14  /**
15  * @file           persistence_client_library_backup_filelist.h
16  * @ingroup        Persistence client library
17  * @author         Ingo Huerner
18  * @brief          Header of the persistence client library backup file list
19  * @see
20  */
21
22
23 #include "../include_protected/persistence_client_library_rc_table.h"
24
25 /**
26  * @brief Read the blacklist configuration file
27  *
28  * @param filename the filename and path to the configuration fiel
29  *
30  * @return 1 success, 0 error
31  */
32 int readBlacklistConfigFile(const char* filename);
33
34
35 /**
36  * @brief
37  *
38  * @param
39  *
40  * @return
41  */
42 int need_backup_key(unsigned int key);
43
44
45 /**
46  * @brief create the file
47  *
48  * @param
49  *
50  * @return
51  */
52 int pclCreateFile(const char* path);
53
54
55 /**
56  * @brief create a backup of a file
57  *
58  * @param
59  *
60  * @return
61  */
62 int pclCreateBackup(const char* srcPath, int srcfd, const char* csumPath, const char* csumBuf);
63
64
65 /**
66  * @brief recover file form backup
67  *
68  * @param
69  *
70  * @return
71  */
72 int pclRecoverFromBackup(int backupFd, const char* original);
73
74
75 /**
76  * @brief calculate crc32 checksum
77  *
78  * @param
79  *
80  * @return
81  */
82 int pclCalcCrc32Csum(int fd, char crc32sum[]);
83
84
85 /**
86  * @brief verify file for consistency
87  *
88  * @param
89  *
90  * @return
91  */
92 int pclVerifyConsistency(const char* origPath, const char* backupPath, const char* csumPath, int openFlags);
93
94
95 /**
96  * @brief check if file needs to be backuped
97  *
98  * @param
99  *
100  * @return
101  */
102 inline int pclBackupNeeded(const char* path);
103
104
105 /**
106  * @brief translate persistence permission into POSIX file open permissions
107  *
108  * @param
109  *
110  * @return
111  */
112 int pclGetPosixPermission(PersistencePermission_e permission);
113
114
115
116 /**
117  * @brief create the file and the given path
118  *
119  * @param
120  *
121  * @return
122  */
123 int pclCreateFileAndPath(const char* path);
124
125
126
127 #endif /* PERS_BACKUP_BLACKLIST_H */