Ooh. Make git-rev-list --object associate a name with objects.
[git/git.git] / object.h
CommitLineData
6eb8ae00
DB
1#ifndef OBJECT_H
2#define OBJECT_H
3
4struct object_list {
5 struct object *item;
6 struct object_list *next;
9ce43d1c 7 const char *name;
6eb8ae00
DB
8};
9
10struct object {
11 unsigned parsed : 1;
12 unsigned used : 1;
d1af002d 13 unsigned delta : 1;
6eb8ae00
DB
14 unsigned int flags;
15 unsigned char sha1[20];
16 const char *type;
17 struct object_list *refs;
d1af002d 18 struct object_list *attached_deltas;
a3437b8c 19 void *util;
6eb8ae00
DB
20};
21
88355048
PB
22extern int nr_objs;
23extern struct object **objs;
6eb8ae00 24
89e4202f 25/** Internal only **/
5d6ccf5c 26struct object *lookup_object(const unsigned char *sha1);
6eb8ae00 27
89e4202f
DB
28/** Returns the object, having looked it up as being the given type. **/
29struct object *lookup_object_type(const unsigned char *sha1, const char *type);
30
5d6ccf5c 31void created_object(const unsigned char *sha1, struct object *obj);
6eb8ae00 32
e9eefa67 33/** Returns the object, having parsed it to find out what it is. **/
5d6ccf5c 34struct object *parse_object(const unsigned char *sha1);
e9eefa67 35
6eb8ae00
DB
36void add_ref(struct object *refer, struct object *target);
37
38void mark_reachable(struct object *obj, unsigned int mask);
39
40#endif /* OBJECT_H */