From: Jeff Hostetler Date: Thu, 04 Jan 2018 19:59:37 GMT Subject: Re: [PATCH 01/40] Add initial external odb support Message-ID: <96c60f40-052c-b098-f58f-e39e308694f0@jeffhostetler.com> In-Reply-To: <20180103163403.11303-2-chriscool@tuxfamily.org> On 1/3/2018 11:33 AM, Christian Couder wrote: > The external-odb.{c,h} files will contain the functions > that are called by the rest of Git mostly from > "sha1_file.c" to access the objects managed by the > external odbs. > > The odb-helper.{c,h} files will contain the functions to > actually implement communication with either the internal > functions or the external scripts or processes that will > manage and provide external git objects. > > For now only infrastructure to create helpers from the > config and to manage a cache for the 'have' command is > implemented. > > Helped-by: Jeff King > Signed-off-by: Christian Couder > --- [...] > diff --git a/odb-helper.h b/odb-helper.h > new file mode 100644 > index 0000000000..9395e606ce > --- /dev/null > +++ b/odb-helper.h > @@ -0,0 +1,24 @@ > +#ifndef ODB_HELPER_H > +#define ODB_HELPER_H > + > +struct odb_helper { > + const char *name; > + const char *dealer; > + > + struct odb_helper_object { > + unsigned char sha1[20]; Should this be "struct object_id" ? > + unsigned long size; > + enum object_type type; > + } *have; > + int have_nr; > + int have_alloc; > + int have_valid; > + > + struct odb_helper *next; > +}; > + > +extern struct odb_helper *odb_helper_new(const char *name, int namelen); > +extern int odb_helper_has_object(struct odb_helper *o, > + const unsigned char *sha1); > + > +#endif /* ODB_HELPER_H */ Jeff