6 struct object_list
*next
;
13 struct object
*ref
[FLEX_ARRAY
]; /* more */
29 unsigned type
: TYPE_BITS
;
30 unsigned flags
: FLAG_BITS
;
31 unsigned char sha1
[20];
34 extern int track_object_refs
;
35 extern int obj_allocs
;
36 extern struct object
**objs
;
37 extern const char *type_names
[];
39 static inline const char *typename(unsigned int type
)
41 return type_names
[type
> TYPE_TAG
? TYPE_BAD
: type
];
44 extern struct object_refs
*lookup_object_refs(struct object
*);
47 struct object
*lookup_object(const unsigned char *sha1
);
49 /** Returns the object, having looked it up as being the given type. **/
50 struct object
*lookup_object_type(const unsigned char *sha1
, const char *type
);
52 void created_object(const unsigned char *sha1
, struct object
*obj
);
54 /** Returns the object, having parsed it to find out what it is. **/
55 struct object
*parse_object(const unsigned char *sha1
);
57 /** Returns the object, with potentially excess memory allocated. **/
58 struct object
*lookup_unknown_object(const unsigned char *sha1
);
60 struct object_refs
*alloc_object_refs(unsigned count
);
61 void set_object_refs(struct object
*obj
, struct object_refs
*refs
);
63 void mark_reachable(struct object
*obj
, unsigned int mask
);
65 struct object_list
*object_list_insert(struct object
*item
,
66 struct object_list
**list_p
);
68 void object_list_append(struct object
*item
,
69 struct object_list
**list_p
);
71 unsigned object_list_length(struct object_list
*list
);
73 int object_list_contains(struct object_list
*list
, struct object
*obj
);