tree.h 650 字节
Newer Older
1 2 3 4 5 6 7
#ifndef TREE_H
#define TREE_H

#include "object.h"

extern const char *tree_type;

8 9 10 11
struct tree_entry_list {
	struct tree_entry_list *next;
	unsigned directory : 1;
	unsigned executable : 1;
12
	unsigned symlink : 1;
13
	unsigned zeropad : 1;
14
	unsigned int mode;
15 16
	char *name;
	union {
17
		struct object *any;
18 19 20
		struct tree *tree;
		struct blob *blob;
	} item;
21
	struct tree_entry_list *parent;
22 23
};

24 25
struct tree {
	struct object object;
26
	struct tree_entry_list *entries;
27 28
};

29
struct tree *lookup_tree(const unsigned char *sha1);
30

31 32
int parse_tree_buffer(struct tree *item, void *buffer, unsigned long size);

33 34 35
int parse_tree(struct tree *tree);

#endif /* TREE_H */