-
Notifications
You must be signed in to change notification settings - Fork 8
/
structs.h
57 lines (44 loc) · 1.37 KB
/
structs.h
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
/*
* copyfs - copy on write filesystem http://n0x.org/copyfs/
* Copyright (C) 2004 Nicolas Vigier <[email protected]>
* Thomas Joubert <[email protected]>
* This program can be distributed under the terms of the GNU GPL.
* See the file COPYING.
*/
#ifndef STRUCTS_H
# define STRUCTS_H
# include <sys/types.h>
# include <sys/time.h>
# define LATEST -1
/* Data types */
typedef struct version_t version_t;
typedef struct metadata_t metadata_t;
typedef struct bucket_t bucket_t;
struct version_t
{
unsigned int v_vid; /* Version ID */
unsigned int v_svid; /* Subversion ID */
mode_t v_mode; /* File permissions */
uid_t v_uid; /* Owner */
gid_t v_gid; /* Group */
char *v_rfile; /* Real file name */
version_t *v_next; /* Next version */
};
struct metadata_t
{
char *md_vfile; /* Virtual file name */
char **md_vpath; /* Virtual path */
version_t *md_versions; /* List of versions */
int md_deleted; /* File deleted ? */
int md_dfl_vid; /* Default version */
int md_dfl_svid; /* Default subversion */
time_t md_timestamp; /* Mod. begin */
metadata_t *md_next; /* Next file in bucket */
metadata_t *md_previous; /* Previous " */
};
struct bucket_t
{
unsigned int b_count; /* Item count */
metadata_t *b_contents; /* Metadata chain */
};
#endif /* !STRUCTS_H */