]> git.proxmox.com Git - libgit2.git/blame - src/config_file.h
Merge branch 'development' into clar2
[libgit2.git] / src / config_file.h
CommitLineData
bfc9ca59
RB
1/*
2 * Copyright (C) 2012 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_config_file_h__
8#define INCLUDE_config_file_h__
9
10#include "git2/config.h"
11
54b2a37a 12GIT_INLINE(int) git_config_file_open(git_config_backend *cfg, unsigned int level)
bfc9ca59 13{
a1abe66a 14 return cfg->open(cfg, level);
bfc9ca59
RB
15}
16
54b2a37a 17GIT_INLINE(void) git_config_file_free(git_config_backend *cfg)
bfc9ca59
RB
18{
19 cfg->free(cfg);
20}
21
aa13bf05 22GIT_INLINE(int) git_config_file_get_string(
54b2a37a 23 const git_config_entry **out, git_config_backend *cfg, const char *name)
aa13bf05
RB
24{
25 return cfg->get(cfg, name, out);
26}
27
b3ff1dab 28GIT_INLINE(int) git_config_file_set_string(
54b2a37a 29 git_config_backend *cfg, const char *name, const char *value)
b3ff1dab
RB
30{
31 return cfg->set(cfg, name, value);
32}
33
aa13bf05 34GIT_INLINE(int) git_config_file_delete(
54b2a37a 35 git_config_backend *cfg, const char *name)
aa13bf05
RB
36{
37 return cfg->del(cfg, name);
38}
39
bfc9ca59 40GIT_INLINE(int) git_config_file_foreach(
54b2a37a 41 git_config_backend *cfg,
a1abe66a 42 int (*fn)(const git_config_entry *entry, void *data),
bfc9ca59
RB
43 void *data)
44{
b3ff1dab
RB
45 return cfg->foreach(cfg, NULL, fn, data);
46}
47
48GIT_INLINE(int) git_config_file_foreach_match(
54b2a37a 49 git_config_backend *cfg,
b3ff1dab 50 const char *regexp,
a1abe66a 51 int (*fn)(const git_config_entry *entry, void *data),
b3ff1dab
RB
52 void *data)
53{
54 return cfg->foreach(cfg, regexp, fn, data);
bfc9ca59
RB
55}
56
57#endif
58