]> git.proxmox.com Git - libgit2.git/blob - src/odb.h
Fix the build on Emscripten
[libgit2.git] / src / odb.h
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 */
7 #ifndef INCLUDE_odb_h__
8 #define INCLUDE_odb_h__
9
10 #include "git2/odb.h"
11 #include "git2/oid.h"
12 #include "git2/types.h"
13
14 #include "vector.h"
15 #include "cache.h"
16
17 #define GIT_OBJECTS_DIR "objects/"
18 #define GIT_OBJECT_DIR_MODE 0777
19 #define GIT_OBJECT_FILE_MODE 0444
20
21 /* DO NOT EXPORT */
22 typedef struct {
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. */
26 } git_rawobj;
27
28 /* EXPORT */
29 struct git_odb_object {
30 git_cached_obj cached;
31 git_rawobj raw;
32 };
33
34 /* EXPORT */
35 struct git_odb {
36 git_refcount rc;
37 git_vector backends;
38 git_cache cache;
39 };
40
41 int git_odb__hash_obj(git_oid *id, git_rawobj *obj);
42
43 #endif