File: grdiff.h

package info (click to toggle)
rdiff-backup-fs 1.0.0-8
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 952 kB
  • sloc: sh: 3,800; ansic: 2,944; makefile: 23
file content (115 lines) | stat: -rw-r--r-- 2,682 bytes parent folder | download | duplicates (4)
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
105
106
107
108
109
110
111
112
113
114
115
#ifndef _SUPPORT_GRDIFF_H_
#define _SUPPORT_GRDIFF_H_

#include "gutils.h"
#include "gstats.h"
#include "gstring.h"
#include "gpath.h"
#include "gtree.h"
#include "headers.h"

/*
 * unzips all rdiff-backup mirror_metadata files in a given directory
 * 
 * @1: path to the directory with mirror_metada
 * @2: path to where unzipped files should be copied
 * 
 * returns: 0 on success, -1 otherwise
 */
int unzip_revs(char *, char *);

/*
 * counts all rdiff-backup mirror_metada files in a given directory
 * 
 * @1: path to the directory
 * 
 * returns: number of revisions on success, -1 otherwise
 */
int count_revs(char *);

/*
 * returns gmt time of revision creation
 * 
 * @1: filename of revision's mirror_metadata file
 * 
 * returns: gmt time on success, -1 otherwise
 */

time_t get_revs_date(char *);

/*
 * returns name of directory for a revision
 * 
 * @1: filename of revision's mirror_metadata file
 * 
 * returns: name of directory on success, NULL otherwise
 */
char* get_revs_dir(char *);

/*
 * read single portion of file stats from a stream
 * 
 * @1: location of stats structure, where information should be set
 * @2: file stream
 * 
 * returns: 0 on success, -1 otherwise
 */
int read_stats(struct stats *stats, FILE *file);

int get_revisions(struct file_system_info *, char *, int);

/*
 * adds given revision to target file in a given directory
 * 
 * @1: revision file name to be added
 * @2: target file name
 * @3: directory where both files are stored
 */
int add_snapshot(char *, char *, char *);

/*
 * copy given revision to target file in a given directory
 * 
 * @1: revision file name to be copied
 * @2: target file name
 * @3: directory where both files are stored
 * 
 * returns: 0 on sucess, -1 otherwise
 */
int snapshot_copy(char *, char *, char *);

/*
 * append given revision to target file in a given directory
 * 
 * @1: revision file name to be appended
 * @2: target file name
 * @3: directory where both files are stored
 * 
 * returns: 0 on sucess, -1 otherwise
 */
int snapshot_append(char *, char *, char *);

int update_tree(tree_t, stats_t *, char *);

/*
 * finds and unzips revision from the given repository
 * 
 * @1: path to the rdiff-backup repository
 * @2: path to directory where revisions should be unzipped
 * @3: pointer which will point to allocated memory with revision names
 * 
 * returns: number of revisions found on success, -1 otherwise
 */ 
int gather_revisions(struct file_system_info *, char *, char *);

/*
 * adds repository stat to a structure tree
 * 
 * @1: repository name
 * @2: tree with structure
 * 
 * returns: returns 0 on sucess, -1 otherwise
 */
int add_repo_dir(char *, tree_t);

#endif