1#ifndef OBJECT_H
2#define OBJECT_H
3
4struct object_list {
5 struct object *item;
6 struct object_list *next;
7 const char *name;
8};
9
10struct 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
22extern int nr_objs;
23extern struct object **objs;
24
25/** Internal only **/
26struct object *lookup_object(const unsigned char *sha1);
27
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
31void created_object(const unsigned char *sha1, struct object *obj);
32
33/** Returns the object, having parsed it to find out what it is. **/
34struct object *parse_object(const unsigned char *sha1);
35
36void add_ref(struct object *refer, struct object *target);
37
38void mark_reachable(struct object *obj, unsigned int mask);
39
40#endif /* OBJECT_H */