]> git.proxmox.com Git - libgit2.git/blob - src/config_file.h
Merge pull request #1315 from nulltoken/development
[libgit2.git] / src / config_file.h
1 /*
2 * Copyright (C) the libgit2 contributors. All rights reserved.
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
12 GIT_INLINE(int) git_config_file_open(git_config_backend *cfg, unsigned int level)
13 {
14 return cfg->open(cfg, level);
15 }
16
17 GIT_INLINE(void) git_config_file_free(git_config_backend *cfg)
18 {
19 cfg->free(cfg);
20 }
21
22 GIT_INLINE(int) git_config_file_get_string(
23 const git_config_entry **out, git_config_backend *cfg, const char *name)
24 {
25 return cfg->get(cfg, name, out);
26 }
27
28 GIT_INLINE(int) git_config_file_set_string(
29 git_config_backend *cfg, const char *name, const char *value)
30 {
31 return cfg->set(cfg, name, value);
32 }
33
34 GIT_INLINE(int) git_config_file_delete(
35 git_config_backend *cfg, const char *name)
36 {
37 return cfg->del(cfg, name);
38 }
39
40 GIT_INLINE(int) git_config_file_foreach(
41 git_config_backend *cfg,
42 int (*fn)(const git_config_entry *entry, void *data),
43 void *data)
44 {
45 return cfg->foreach(cfg, NULL, fn, data);
46 }
47
48 GIT_INLINE(int) git_config_file_foreach_match(
49 git_config_backend *cfg,
50 const char *regexp,
51 int (*fn)(const git_config_entry *entry, void *data),
52 void *data)
53 {
54 return cfg->foreach(cfg, regexp, fn, data);
55 }
56
57 extern int git_config_file_normalize_section(char *start, char *end);
58
59 #endif
60