Blame src/attrcache.h

Packit ae9e2a
/*
Packit ae9e2a
 * Copyright (C) the libgit2 contributors. All rights reserved.
Packit ae9e2a
 *
Packit ae9e2a
 * This file is part of libgit2, distributed under the GNU GPL v2 with
Packit ae9e2a
 * a Linking Exception. For full terms see the included COPYING file.
Packit ae9e2a
 */
Packit ae9e2a
#ifndef INCLUDE_attrcache_h__
Packit ae9e2a
#define INCLUDE_attrcache_h__
Packit ae9e2a
Packit ae9e2a
#include "attr_file.h"
Packit ae9e2a
#include "strmap.h"
Packit ae9e2a
Packit ae9e2a
#define GIT_ATTR_CONFIG       "core.attributesfile"
Packit ae9e2a
#define GIT_IGNORE_CONFIG     "core.excludesfile"
Packit ae9e2a
Packit ae9e2a
typedef struct {
Packit ae9e2a
	char *cfg_attr_file; /* cached value of core.attributesfile */
Packit ae9e2a
	char *cfg_excl_file; /* cached value of core.excludesfile */
Packit ae9e2a
	git_strmap *files;	 /* hash path to git_attr_cache_entry records */
Packit ae9e2a
	git_strmap *macros;	 /* hash name to vector<git_attr_assignment> */
Packit ae9e2a
	git_mutex lock;
Packit ae9e2a
	git_pool  pool;
Packit ae9e2a
} git_attr_cache;
Packit ae9e2a
Packit ae9e2a
extern int git_attr_cache__init(git_repository *repo);
Packit ae9e2a
Packit ae9e2a
/* get file - loading and reload as needed */
Packit ae9e2a
extern int git_attr_cache__get(
Packit ae9e2a
	git_attr_file **file,
Packit ae9e2a
	git_repository *repo,
Packit ae9e2a
	git_attr_session *attr_session,
Packit ae9e2a
	git_attr_file_source source,
Packit ae9e2a
	const char *base,
Packit ae9e2a
	const char *filename,
Packit ae9e2a
	git_attr_file_parser parser);
Packit ae9e2a
Packit ae9e2a
extern bool git_attr_cache__is_cached(
Packit ae9e2a
	git_repository *repo,
Packit ae9e2a
	git_attr_file_source source,
Packit ae9e2a
	const char *path);
Packit ae9e2a
Packit ae9e2a
extern int git_attr_cache__alloc_file_entry(
Packit ae9e2a
	git_attr_file_entry **out,
Packit ae9e2a
	const char *base,
Packit ae9e2a
	const char *path,
Packit ae9e2a
	git_pool *pool);
Packit ae9e2a
Packit ae9e2a
extern int git_attr_cache__insert_macro(
Packit ae9e2a
	git_repository *repo, git_attr_rule *macro);
Packit ae9e2a
Packit ae9e2a
extern git_attr_rule *git_attr_cache__lookup_macro(
Packit ae9e2a
	git_repository *repo, const char *name);
Packit ae9e2a
Packit ae9e2a
#endif