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