mirror of
https://github.com/git-for-windows/git.git
synced 2026-06-14 05:33:00 -05:00
In the next commit we're about to introduce the "packed" object database source. This source will embed a packfile list, and consequently we'll have to include "packfile.h" to make the struct definition available. This will unfortunately lead to a cyclic dependency that we cannot resolve with a forward declaration. Split out the code that relates to the packfile list into a separate compilation unit so that both "packfile.h" and "odb/source-packed.h" can include it. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
29 lines
831 B
C
29 lines
831 B
C
#ifndef PACKFILE_LIST_H
|
|
#define PACKFILE_LIST_H
|
|
|
|
struct object_id;
|
|
|
|
struct packfile_list {
|
|
struct packfile_list_entry *head, *tail;
|
|
};
|
|
|
|
struct packfile_list_entry {
|
|
struct packfile_list_entry *next;
|
|
struct packed_git *pack;
|
|
};
|
|
|
|
void packfile_list_clear(struct packfile_list *list);
|
|
void packfile_list_remove(struct packfile_list *list, struct packed_git *pack);
|
|
void packfile_list_prepend(struct packfile_list *list, struct packed_git *pack);
|
|
void packfile_list_append(struct packfile_list *list, struct packed_git *pack);
|
|
|
|
/*
|
|
* Find the pack within the "packs" list whose index contains the object
|
|
* "oid". For general object lookups, you probably don't want this; use
|
|
* find_pack_entry() instead.
|
|
*/
|
|
struct packed_git *packfile_list_find_oid(struct packfile_list_entry *packs,
|
|
const struct object_id *oid);
|
|
|
|
#endif
|