6 struct object_list *next;
12 struct object *ref[FLEX_ARRAY]; /* more */
28 unsigned type : TYPE_BITS;
29 unsigned flags : FLAG_BITS;
30 unsigned char sha1[20];
31 struct object_refs *refs;
35 extern int track_object_refs;
36 extern int obj_allocs;
37 extern struct object **objs;
38 extern const char *type_names[];
40 static inline const char *typename(unsigned int type)
42 return type_names[type > TYPE_TAG ? TYPE_BAD : type];
46 struct object *lookup_object(const unsigned char *sha1);
48 /** Returns the object, having looked it up as being the given type. **/
49 struct object *lookup_object_type(const unsigned char *sha1, const char *type);
51 void created_object(const unsigned char *sha1, struct object *obj);
53 /** Returns the object, having parsed it to find out what it is. **/
54 struct object *parse_object(const unsigned char *sha1);
56 /** Returns the object, with potentially excess memory allocated. **/
57 struct object *lookup_unknown_object(const unsigned char *sha1);
59 struct object_refs *alloc_object_refs(unsigned count);
60 void set_object_refs(struct object *obj, struct object_refs *refs);
62 void mark_reachable(struct object *obj, unsigned int mask);
64 struct object_list *object_list_insert(struct object *item,
65 struct object_list **list_p);
67 void object_list_append(struct object *item,
68 struct object_list **list_p);
70 unsigned object_list_length(struct object_list *list);
72 int object_list_contains(struct object_list *list, struct object *obj);