1 #ifndef PERSISTENCE_CLIENT_LIBRARY_BACKUP_FILELIST_H
2 #define PERSISTENCE_CLIENT_LIBRARY_BACKUP_FILELIST_H
4 /******************************************************************************
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 ******************************************************************************/
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
23 #include "../include_protected/persistence_client_library_rc_table.h"
26 * @brief Read the blacklist configuration file
28 * @param filename the filename and path to the configuration fiel
30 * @return 1 success, 0 error
32 int readBlacklistConfigFile(const char* filename);
42 int need_backup_key(unsigned int key);
46 * @brief create the file
52 int pclCreateFile(const char* path);
56 * @brief create a backup of a file
62 int pclCreateBackup(const char* srcPath, int srcfd, const char* csumPath, const char* csumBuf);
66 * @brief recover file form backup
72 int pclRecoverFromBackup(int backupFd, const char* original);
76 * @brief calculate crc32 checksum
82 int pclCalcCrc32Csum(int fd, char crc32sum[]);
86 * @brief verify file for consistency
92 int pclVerifyConsistency(const char* origPath, const char* backupPath, const char* csumPath, int openFlags);
96 * @brief check if file needs to be backuped
102 inline int pclBackupNeeded(const char* path);
106 * @brief translate persistence permission into POSIX file open permissions
112 int pclGetPosixPermission(PersistencePermission_e permission);
117 * @brief create the file and the given path
123 int pclCreateFileAndPath(const char* path);
127 #endif /* PERS_BACKUP_BLACKLIST_H */