]> git.ipfire.org Git - thirdparty/git.git/blobdiff - cache.h
add macro REALLOC_ARRAY
[thirdparty/git.git] / cache.h
diff --git a/cache.h b/cache.h
index 4d5b76c76ab2275f51c504cac62cda7e563e1d1d..dfa1a5696d448b407644276df58fb24e25c57113 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -8,6 +8,7 @@
 #include "gettext.h"
 #include "convert.h"
 #include "trace.h"
+#include "string-list.h"
 
 #include SHA1_HEADER
 #ifndef git_SHA_CTX
@@ -1296,7 +1297,7 @@ extern int git_config_from_buf(config_fn_t fn, const char *name,
                               const char *buf, size_t len, void *data);
 extern void git_config_push_parameter(const char *text);
 extern int git_config_from_parameters(config_fn_t fn, void *data);
-extern int git_config(config_fn_t fn, void *);
+extern void git_config(config_fn_t fn, void *);
 extern int git_config_with_options(config_fn_t fn, void *,
                                   struct git_config_source *config_source,
                                   int respect_includes);
@@ -1353,9 +1354,32 @@ extern int parse_config_key(const char *var,
                            const char **subsection, int *subsection_len,
                            const char **key);
 
+struct config_set_element {
+       struct hashmap_entry ent;
+       char *key;
+       struct string_list value_list;
+};
+
+struct configset_list_item {
+       struct config_set_element *e;
+       int value_index;
+};
+
+/*
+ * the contents of the list are ordered according to their
+ * position in the config files and order of parsing the files.
+ * (i.e. key-value pair at the last position of .git/config will
+ * be at the last item of the list)
+ */
+struct configset_list {
+       struct configset_list_item *items;
+       unsigned int nr, alloc;
+};
+
 struct config_set {
        struct hashmap config_hash;
        int hash_initialized;
+       struct configset_list list;
 };
 
 extern void git_configset_init(struct config_set *cs);
@@ -1385,6 +1409,14 @@ extern int git_config_get_bool_or_int(const char *key, int *is_bool, int *dest);
 extern int git_config_get_maybe_bool(const char *key, int *dest);
 extern int git_config_get_pathname(const char *key, const char **dest);
 
+struct key_value_info {
+       const char *filename;
+       int linenr;
+};
+
+extern NORETURN void git_die_config(const char *key, const char *err, ...) __attribute__((format(printf, 2, 3)));
+extern NORETURN void git_die_config_linenr(const char *key, const char *filename, int linenr);
+
 extern int committer_ident_sufficiently_given(void);
 extern int author_ident_sufficiently_given(void);