tree-cache.h 858 Bytes
Newer Older
1
/*
Edward Thomson committed
2
 * Copyright (C) the libgit2 contributors. All rights reserved.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
 *
 * This file is part of libgit2, distributed under the GNU GPL v2 with
 * a Linking Exception. For full terms see the included COPYING file.
 */

#ifndef INCLUDE_tree_cache_h__
#define INCLUDE_tree_cache_h__

#include "common.h"
#include "git2/oid.h"

struct git_tree_cache {
	struct git_tree_cache *parent;
	struct git_tree_cache **children;
	size_t children_count;

	ssize_t entries;
	git_oid oid;
21
	char name[GIT_FLEX_ARRAY];
22 23 24 25 26
};

typedef struct git_tree_cache git_tree_cache;

int git_tree_cache_read(git_tree_cache **tree, const char *buffer, size_t buffer_size);
27
void git_tree_cache_invalidate_path(git_tree_cache *tree, const char *path);
28
const git_tree_cache *git_tree_cache_get(const git_tree_cache *tree, const char *path);
29 30 31
void git_tree_cache_free(git_tree_cache *tree);

#endif