Merge branch 'jk/config-parsing-cleanup'
[gitweb.git] / cache.h
diff --git a/cache.h b/cache.h
index 94ffcda8f6cbb603b79eda1ae441a21450a16cb5..9038fb500e45e926a696598b91a3759c22e3b306 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -1170,6 +1170,21 @@ struct config_include_data {
 #define CONFIG_INCLUDE_INIT { 0 }
 extern int git_config_include(const char *name, const char *value, void *data);
 
+/*
+ * Match and parse a config key of the form:
+ *
+ *   section.(subsection.)?key
+ *
+ * (i.e., what gets handed to a config_fn_t). The caller provides the section;
+ * we return -1 if it does not match, 0 otherwise. The subsection and key
+ * out-parameters are filled by the function (and subsection is NULL if it is
+ * missing).
+ */
+extern int parse_config_key(const char *var,
+                           const char *section,
+                           const char **subsection, int *subsection_len,
+                           const char **key);
+
 extern int committer_ident_sufficiently_given(void);
 extern int author_ident_sufficiently_given(void);