]> git.proxmox.com Git - libgit2.git/blame - src/odb.h
makefile: Define _GNU_SOURCE in the embed mkfile
[libgit2.git] / src / odb.h
CommitLineData
bb742ede
VM
1/*
2 * Copyright (C) 2009-2011 the libgit2 contributors
3 *
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
6 */
a7c60cfc
SP
7#ifndef INCLUDE_odb_h__
8#define INCLUDE_odb_h__
9
44908fe7
VM
10#include "git2/odb.h"
11#include "git2/oid.h"
72a3fe42 12#include "git2/types.h"
7d7cd885
VM
13
14#include "vector.h"
72a3fe42 15#include "cache.h"
7d7cd885 16
ce8cd006
BR
17#define GIT_OBJECTS_DIR "objects/"
18#define GIT_OBJECT_DIR_MODE 0777
01ad7b3a 19#define GIT_OBJECT_FILE_MODE 0444
ce8cd006 20
72a3fe42
VM
21/* DO NOT EXPORT */
22typedef struct {
87d9869f
VM
23 void *data; /**< Raw, decompressed object data. */
24 size_t len; /**< Total number of bytes in data. */
25 git_otype type; /**< Type of this object. */
72a3fe42
VM
26} git_rawobj;
27
28/* EXPORT */
29struct git_odb_object {
30 git_cached_obj cached;
31 git_rawobj raw;
32};
33
34/* EXPORT */
7d7cd885 35struct git_odb {
9462c471 36 git_refcount rc;
7d7cd885 37 git_vector backends;
72a3fe42 38 git_cache cache;
7d7cd885
VM
39};
40
c85e08b1 41int git_odb__hash_obj(git_oid *id, git_rawobj *obj);
7d7cd885 42
a7c60cfc 43#endif