This repository has been archived by the owner on Nov 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathfstree.h
45 lines (38 loc) · 1.38 KB
/
fstree.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
#ifndef FSTREE_H_
#define FSTREE_H_
#define FUSE_USE_VERSION 26
#define _XOPEN_SOURCE 500
#define PHOENIXFS_MAGIC 0x2888
#include "common.h"
#include "btree.h"
#include "crc32.h"
#include "sha1.h"
#include "persist.h"
#include "pack.h"
#include <sys/stat.h>
struct env_t {
char fsback[PATH_MAX];
char mountpoint[PATH_MAX];
};
int parse_pathspec(char *xpath, const char *path);
int build_xpath(char *xpath, const char *path, int rev);
char *split_basename(const char *path, char *dirname);
void fill_stat(struct stat *st, struct file_record *fr);
struct node *get_fsroot(void);
struct dir_record *find_dr(const char *path);
struct vfile_record *find_vfr(const char *path);
struct file_record *find_fr(const char *path, int rev);
struct dir_record *make_dr(const char *path);
struct vfile_record *make_vfr(const char *name);
struct file_record *make_fr(const char *path, const char *follow);
void insert_dr(struct dir_record *dr);
void insert_vfr(struct dir_record *dr, struct vfile_record *vfr);
void insert_fr(struct vfile_record *vfr, struct file_record *fr);
struct node *remove_entry(struct node *root, uint16_t key);
void fstree_insert_update_file(const char *path, const char *follow);
void fstree_remove_file(const char *path);
void fstree_dump_tree(FILE *outfile);
void fstree_load_tree(FILE *infile);
void print_fstree(void);
#define ROOTENV ((struct env_t *) fuse_get_context()->private_data)
#endif