tree.h 599 字节
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 13
	unsigned symlink : 1;
	unsigned int mode;
14 15 16 17 18
	char *name;
	union {
		struct tree *tree;
		struct blob *blob;
	} item;
19
	struct tree_entry_list *parent;
20 21
};

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

struct tree *lookup_tree(unsigned char *sha1);

29 30
int parse_tree_buffer(struct tree *item, void *buffer, unsigned long size);

31 32 33
int parse_tree(struct tree *tree);

#endif /* TREE_H */