🌐 AI搜索 & 代理 主页
blob: d84ac63e511c30ae4e1c8ee2b9719d67fd9424da [file] [log] [blame]
Daniel Barkalow6eb8ae02005-04-18 18:39:481#ifndef TREE_H
2#define TREE_H
3
4#include "object.h"
5
6extern const char *tree_type;
7
8struct tree {
9 struct object object;
Linus Torvalds136f2e52006-05-29 19:16:1210 void *buffer;
11 unsigned long size;
Daniel Barkalow6eb8ae02005-04-18 18:39:4812};
13
Jason McMullan5d6ccf52005-06-03 15:05:3914struct tree *lookup_tree(const unsigned char *sha1);
Daniel Barkalow6eb8ae02005-04-18 18:39:4815
Nicolas Pitrebd2c39f2005-05-06 17:48:3416int parse_tree_buffer(struct tree *item, void *buffer, unsigned long size);
17
Daniel Barkalow6eb8ae02005-04-18 18:39:4818int parse_tree(struct tree *tree);
Jeff King6e454b92013-06-05 22:37:3919void free_tree_buffer(struct tree *tree);
Daniel Barkalow6eb8ae02005-04-18 18:39:4820
Daniel Barkalow77675e22005-09-05 06:03:5121/* Parses and returns the tree in the given ent, chasing tags and commits. */
22struct tree *parse_tree_indirect(const unsigned char *sha1);
23
Linus Torvalds3c5e8462005-11-26 17:38:2024#define READ_TREE_RECURSIVE 1
René Scharfe671f0702008-07-14 19:22:1225typedef int (*read_tree_fn_t)(const unsigned char *, const char *, int, const char *, unsigned int, int, void *);
Linus Torvalds3c5e8462005-11-26 17:38:2026
Daniel Barkalow521698b2006-01-26 06:13:3627extern int read_tree_recursive(struct tree *tree,
28 const char *base, int baselen,
Nguyễn Thái Ngọc Duy18e4f402013-07-14 08:35:5229 int stage, const struct pathspec *pathspec,
René Scharfe671f0702008-07-14 19:22:1230 read_tree_fn_t fn, void *context);
Linus Torvalds3c5e8462005-11-26 17:38:2031
Nguyễn Thái Ngọc Duyf0096c02011-03-25 09:34:1932extern int read_tree(struct tree *tree, int stage, struct pathspec *pathspec);
Linus Torvalds3c5e8462005-11-26 17:38:2033
Daniel Barkalow6eb8ae02005-04-18 18:39:4834#endif /* TREE_H */