config_snapshot: rename function names The configuration snapshot backend has been extracted from the old files backend back in 2bff84ba4 (config_file: separate out read-only backend, 2019-07-26). To keep code churn manageable, the local functions weren't renamed yet and thus still have references to the old diskfile backend. Rename them accordingly to make them easier to understand.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
diff --git a/src/config_snapshot.c b/src/config_snapshot.c
index e89a138..62b9068 100644
--- a/src/config_snapshot.c
+++ b/src/config_snapshot.c
@@ -22,7 +22,7 @@ static int config_error_readonly(void)
return -1;
}
-static int config_iterator_new_readonly(
+static int config_snapshot_iterator(
git_config_iterator **iter,
struct git_config_backend *backend)
{
@@ -41,13 +41,13 @@ out:
}
/* release the map containing the entry as an equivalent to freeing it */
-static void free_diskfile_entry(git_config_entry *entry)
+static void config_snapshot_entry_free(git_config_entry *entry)
{
git_config_entries *entries = (git_config_entries *) entry->payload;
git_config_entries_free(entries);
}
-static int config_get_readonly(git_config_backend *cfg, const char *key, git_config_entry **out)
+static int config_snapshot_get(git_config_backend *cfg, const char *key, git_config_entry **out)
{
config_snapshot_backend *b = GIT_CONTAINER_OF(cfg, config_snapshot_backend, parent);
git_config_entries *entries = NULL;
@@ -68,14 +68,14 @@ static int config_get_readonly(git_config_backend *cfg, const char *key, git_con
return error;
}
- entry->free = free_diskfile_entry;
+ entry->free = config_snapshot_entry_free;
entry->payload = entries;
*out = entry;
return 0;
}
-static int config_set_readonly(git_config_backend *cfg, const char *name, const char *value)
+static int config_snapshot_set(git_config_backend *cfg, const char *name, const char *value)
{
GIT_UNUSED(cfg);
GIT_UNUSED(name);
@@ -84,7 +84,7 @@ static int config_set_readonly(git_config_backend *cfg, const char *name, const
return config_error_readonly();
}
-static int config_set_multivar_readonly(
+static int config_snapshot_set_multivar(
git_config_backend *cfg, const char *name, const char *regexp, const char *value)
{
GIT_UNUSED(cfg);
@@ -95,7 +95,7 @@ static int config_set_multivar_readonly(
return config_error_readonly();
}
-static int config_delete_multivar_readonly(git_config_backend *cfg, const char *name, const char *regexp)
+static int config_snapshot_delete_multivar(git_config_backend *cfg, const char *name, const char *regexp)
{
GIT_UNUSED(cfg);
GIT_UNUSED(name);
@@ -104,7 +104,7 @@ static int config_delete_multivar_readonly(git_config_backend *cfg, const char *
return config_error_readonly();
}
-static int config_delete_readonly(git_config_backend *cfg, const char *name)
+static int config_snapshot_delete(git_config_backend *cfg, const char *name)
{
GIT_UNUSED(cfg);
GIT_UNUSED(name);
@@ -112,14 +112,14 @@ static int config_delete_readonly(git_config_backend *cfg, const char *name)
return config_error_readonly();
}
-static int config_lock_readonly(git_config_backend *_cfg)
+static int config_snapshot_lock(git_config_backend *_cfg)
{
GIT_UNUSED(_cfg);
return config_error_readonly();
}
-static int config_unlock_readonly(git_config_backend *_cfg, int success)
+static int config_snapshot_unlock(git_config_backend *_cfg, int success)
{
GIT_UNUSED(_cfg);
GIT_UNUSED(success);
@@ -127,7 +127,7 @@ static int config_unlock_readonly(git_config_backend *_cfg, int success)
return config_error_readonly();
}
-static void backend_readonly_free(git_config_backend *_backend)
+static void config_snapshot_free(git_config_backend *_backend)
{
config_snapshot_backend *backend = GIT_CONTAINER_OF(_backend, config_snapshot_backend, parent);
@@ -139,7 +139,7 @@ static void backend_readonly_free(git_config_backend *_backend)
git__free(backend);
}
-static int config_readonly_open(git_config_backend *cfg, git_config_level_t level, const git_repository *repo)
+static int config_snapshot_open(git_config_backend *cfg, git_config_level_t level, const git_repository *repo)
{
config_snapshot_backend *b = GIT_CONTAINER_OF(cfg, config_snapshot_backend, parent);
git_config_entries *entries = NULL;
@@ -188,17 +188,17 @@ int git_config_backend_snapshot(git_config_backend **out, git_config_backend *so
backend->parent.readonly = 1;
backend->parent.version = GIT_CONFIG_BACKEND_VERSION;
- backend->parent.open = config_readonly_open;
- backend->parent.get = config_get_readonly;
- backend->parent.set = config_set_readonly;
- backend->parent.set_multivar = config_set_multivar_readonly;
+ backend->parent.open = config_snapshot_open;
+ backend->parent.get = config_snapshot_get;
+ backend->parent.set = config_snapshot_set;
+ backend->parent.set_multivar = config_snapshot_set_multivar;
backend->parent.snapshot = git_config_backend_snapshot;
- backend->parent.del = config_delete_readonly;
- backend->parent.del_multivar = config_delete_multivar_readonly;
- backend->parent.iterator = config_iterator_new_readonly;
- backend->parent.lock = config_lock_readonly;
- backend->parent.unlock = config_unlock_readonly;
- backend->parent.free = backend_readonly_free;
+ backend->parent.del = config_snapshot_delete;
+ backend->parent.del_multivar = config_snapshot_delete_multivar;
+ backend->parent.iterator = config_snapshot_iterator;
+ backend->parent.lock = config_snapshot_lock;
+ backend->parent.unlock = config_snapshot_unlock;
+ backend->parent.free = config_snapshot_free;
*out = &backend->parent;