GIT 0.99.9i aka 1.0rc2
[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;
13 unsigned int flags;
14 unsigned char sha1[20];
15 const char *type;
16 struct object_list *refs;
a3437b8c 17 void *util;
6eb8ae00
DB
18};
19
8805ccac 20extern int track_object_refs;
88355048
PB
21extern int nr_objs;
22extern struct object **objs;
6eb8ae00 23
89e4202f 24/** Internal only **/
5d6ccf5c 25struct object *lookup_object(const unsigned char *sha1);
6eb8ae00 26
89e4202f
DB
27/** Returns the object, having looked it up as being the given type. **/
28struct object *lookup_object_type(const unsigned char *sha1, const char *type);
29
5d6ccf5c 30void created_object(const unsigned char *sha1, struct object *obj);
6eb8ae00 31
e9eefa67 32/** Returns the object, having parsed it to find out what it is. **/
5d6ccf5c 33struct object *parse_object(const unsigned char *sha1);
e9eefa67 34
66e481b0
DB
35/** Returns the object, with potentially excess memory allocated. **/
36struct object *lookup_unknown_object(const unsigned char *sha1);
37
6eb8ae00
DB
38void add_ref(struct object *refer, struct object *target);
39
40void mark_reachable(struct object *obj, unsigned int mask);
41
66e481b0
DB
42struct object_list *object_list_insert(struct object *item,
43 struct object_list **list_p);
44
680bab3d
DB
45void object_list_append(struct object *item,
46 struct object_list **list_p);
47
66e481b0
DB
48unsigned object_list_length(struct object_list *list);
49
50int object_list_contains(struct object_list *list, struct object *obj);
51
6eb8ae00 52#endif /* OBJECT_H */