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
|
#ifndef _SUPPORT_GSTATS_H_
#define _SUPPORT_GSTATS_H_
#include "../headers.h"
/*
* basic structure holding description of one file stored in the rdiff-backup
* archive;
*
* @path: full path of the file in the created filesystem;
* @internal: full path of the file in the rdiff-backup repository; keep in
* mind, that this field may point at a part
* of path field to keep memory usage lower; free memory accordingly
* @name: name of the file, that will be displayed in the filesystem; keep in
* mind, that this field may point at a part
* of path field to keep memory usage lower; free memory accordingly;
* @rev: number of revision but in backward order, so revision 0 is written as
* rev_count - 1
*/
struct stats {
char *path;
char *internal;
char *name;
char *link;
int type;
unsigned long long size;
nlink_t nlink;
time_t ctime;
time_t atime;
unsigned int rev;
};
typedef struct stats stats_t;
#define set_directory_stats(stats){ \
(stats)->nlink = 1; \
(stats)->type = S_IFDIR; \
(stats)->rev = -1; \
(stats)->internal = NULL; \
(stats)->ctime = time(0); \
(stats)->atime = time(0); \
(stats)->size = DIR_SIZE; \
}
void copy_stats(stats_t *source, stats_t **dest);
#endif
|