mirror of
https://github.com/git/git.git
synced 2024-11-16 14:04:52 +01:00
a59b276e18
This allows you to add an arbitrary "decoration" of your choice to any object. It's a space- and time-efficient way to add information to arbitrary objects, especially if most objects probably do not have the decoration. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
18 lines
382 B
C
18 lines
382 B
C
#ifndef DECORATE_H
|
|
#define DECORATE_H
|
|
|
|
struct object_decoration {
|
|
struct object *base;
|
|
void *decoration;
|
|
};
|
|
|
|
struct decoration {
|
|
const char *name;
|
|
unsigned int size, nr;
|
|
struct object_decoration *hash;
|
|
};
|
|
|
|
extern void *add_decoration(struct decoration *n, struct object *obj, void *decoration);
|
|
extern void *lookup_decoration(struct decoration *n, struct object *obj);
|
|
|
|
#endif
|