summaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'config.h')
-rw-r--r--config.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/config.h b/config.h
index 91fd4c5e96..060874488f 100644
--- a/config.h
+++ b/config.h
@@ -35,10 +35,22 @@ struct object_id;
#define CONFIG_REGEX_NONE ((void *)1)
+enum config_scope {
+ CONFIG_SCOPE_UNKNOWN = 0,
+ CONFIG_SCOPE_SYSTEM,
+ CONFIG_SCOPE_GLOBAL,
+ CONFIG_SCOPE_LOCAL,
+ CONFIG_SCOPE_WORKTREE,
+ CONFIG_SCOPE_COMMAND,
+ CONFIG_SCOPE_SUBMODULE,
+};
+const char *config_scope_name(enum config_scope scope);
+
struct git_config_source {
unsigned int use_stdin:1;
const char *file;
const char *blob;
+ enum config_scope scope;
};
enum config_origin_type {
@@ -242,7 +254,7 @@ int git_config_set_gently(const char *, const char *);
*/
void git_config_set(const char *, const char *);
-int git_config_parse_key(const char *, char **, int *);
+int git_config_parse_key(const char *, char **, size_t *);
int git_config_key_is_valid(const char *key);
int git_config_set_multivar_gently(const char *, const char *, const char *, int);
void git_config_set_multivar(const char *, const char *, const char *, int);
@@ -294,17 +306,10 @@ int config_error_nonbool(const char *);
int git_config_parse_parameter(const char *, config_fn_t fn, void *data);
-enum config_scope {
- CONFIG_SCOPE_UNKNOWN = 0,
- CONFIG_SCOPE_SYSTEM,
- CONFIG_SCOPE_GLOBAL,
- CONFIG_SCOPE_REPO,
- CONFIG_SCOPE_CMDLINE,
-};
-
enum config_scope current_config_scope(void);
const char *current_config_origin_type(void);
const char *current_config_name(void);
+int current_config_line(void);
/**
* Include Directives
@@ -354,7 +359,7 @@ int git_config_include(const char *name, const char *value, void *data);
*/
int parse_config_key(const char *var,
const char *section,
- const char **subsection, int *subsection_len,
+ const char **subsection, size_t *subsection_len,
const char **key);
/**