From 5e0dc4af013e23d0cbc737d8ab2756aaf38e1516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Sat, 4 Feb 2012 23:18:30 +0100 Subject: Support getting multivars --- include/git2/config.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/git2') diff --git a/include/git2/config.h b/include/git2/config.h index afa661fc..1f037c8e 100644 --- a/include/git2/config.h +++ b/include/git2/config.h @@ -29,6 +29,7 @@ struct git_config_file { /* Open means open the file/database and parse if necessary */ int (*open)(struct git_config_file *); int (*get)(struct git_config_file *, const char *key, const char **value); + int (*get_multivar)(struct git_config_file *, const char *key, const char *regexp, int (*fn)(const char *, void *), void *data); int (*set)(struct git_config_file *, const char *key, const char *value); int (*del)(struct git_config_file *, const char *key); int (*foreach)(struct git_config_file *, int (*fn)(const char *, const char *, void *), void *data); @@ -205,6 +206,12 @@ GIT_EXTERN(int) git_config_get_bool(git_config *cfg, const char *name, int *out) */ GIT_EXTERN(int) git_config_get_string(git_config *cfg, const char *name, const char **out); +/** + * Get each value of a multivar. The callback will be called on each + * variable found + */ +GIT_EXTERN(int) git_config_get_multivar(git_config *cfg, const char *name, const char *regexp, int (*fn)(const char *, void *), void *data); + /** * Set the value of an integer config variable. * -- cgit v1.2.1