Hash :
7d7cd885
Author :
Date :
2010-12-03T18:01:30
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
#ifndef INCLUDE_odb_h__
#define INCLUDE_odb_h__
#include <git/odb.h>
#include <git/oid.h>
#include "vector.h"
struct git_odb {
void *_internal;
git_vector backends;
};
struct git_odb_backend {
git_odb *odb;
int priority;
int (* read)(
git_rawobj *,
struct git_odb_backend *,
const git_oid *);
int (* read_header)(
git_rawobj *,
struct git_odb_backend *,
const git_oid *);
int (* write)(
git_oid *id,
struct git_odb_backend *,
git_rawobj *obj);
int (* exists)(
struct git_odb_backend *,
const git_oid *);
void (* free)(struct git_odb_backend *);
};
int git_odb__hash_obj(git_oid *id, char *hdr, size_t n, int *len, git_rawobj *obj);
int git_odb__inflate_buffer(void *in, size_t inlen, void *out, size_t outlen);
int git_odb_backend_loose(git_odb_backend **backend_out, const char *objects_dir);
int git_odb_backend_pack(git_odb_backend **backend_out, const char *objects_dir);
#endif