mirror of
https://github.com/git/git
synced 2024-08-27 11:39:22 +00:00
![Linus Torvalds](/assets/img/avatar_default.png)
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>
19 lines
382 B
C
19 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
|