summaryrefslogtreecommitdiff
path: root/src/persistence_client_library_backup_filelist.h
blob: 65a6a3ca11b443806df9849e2ea00fa50aba1887 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#ifndef PERSISTENCE_CLIENT_LIBRARY_BACKUP_FILELIST_H
#define PERSISTENCE_CLIENT_LIBRARY_BACKUP_FILELIST_H

/******************************************************************************
 * Project         Persistency
 * (c) copyright   2013
 * Company         XS Embedded GmbH
 *****************************************************************************/
/******************************************************************************
 * This Source Code Form is subject to the terms of the
 * Mozilla Public License, v. 2.0. If a  copy of the MPL was not distributed
 * with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
******************************************************************************/
 /**
 * @file           persistence_client_library_backup_filelist.h
 * @ingroup        Persistence client library
 * @author         Ingo Huerner
 * @brief          Header of the persistence client library backup file list
 * @see
 */


/**
 * @brief Read the blacklist configuration file
 *
 * @param filename the filename and path to the configuration fiel
 *
 * @return 1 success, 0 error
 */
int readBlacklistConfigFile(const char* filename);


/**
 * @brief
 *
 * @param
 *
 * @return
 */
int need_backup_key(unsigned int key);


/**
 * @brief create the file
 *
 * @param
 *
 * @return
 */
int pclCreateFile(const char* path);


/**
 * @brief create a backup of a file
 *
 * @param
 *
 * @return
 */
int pclCreateBackup(const char* srcPath, int srcfd, const char* csumPath, const char* csumBuf);


/**
 * @brief recover file form backup
 *
 * @param
 *
 * @return
 */
int pclRecoverFromBackup(int backupFd, const char* original);


/**
 * @brief calculate crc32 checksum
 *
 * @param
 *
 * @return
 */
int pclCalcCrc32Csum(int fd, char crc32sum[]);


/**
 * @brief verify file for consistency
 *
 * @param
 *
 * @return
 */
int pclVerifyConsistency(const char* origPath, const char* backupPath, const char* csumPath, int openFlags);


/**
 * @brief check if file needs to be backuped
 *
 * @param
 *
 * @return
 */
inline int pclBackupNeeded(const char* path);



#endif /* PERS_BACKUP_BLACKLIST_H */