summaryrefslogtreecommitdiff
path: root/src/odb.c
diff options
context:
space:
mode:
authorMatthew Bowen <matthew@mgbowen.com>2014-03-05 21:49:23 -0500
committerMatthew Bowen <matthew@mgbowen.com>2014-03-05 21:49:23 -0500
commitb9f819978c571cc806827e8b3ebc1a58a0755999 (patch)
tree64c94ef334360b064a3bdf9b6069c1422f727150 /src/odb.c
parenta064dc2d0b6206116a35be4b62c58c3c1170d5de (diff)
downloadlibgit2-b9f819978c571cc806827e8b3ebc1a58a0755999.tar.gz
Added function-based initializers for every options struct.
The basic structure of each function is courtesy of arrbee.
Diffstat (limited to 'src/odb.c')
-rw-r--r--src/odb.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/odb.c b/src/odb.c
index 30bba9603..085eda594 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -1113,3 +1113,14 @@ int git_odb__error_ambiguous(const char *message)
return GIT_EAMBIGUOUS;
}
+int git_odb_init_backend(git_odb_backend* backend, int version)
+{
+ if (version != GIT_ODB_BACKEND_VERSION) {
+ giterr_set(GITERR_INVALID, "Invalid version %d for git_odb_backend", version);
+ return -1;
+ } else {
+ git_odb_backend b = GIT_ODB_BACKEND_INIT;
+ memcpy(backend, &b, sizeof(b));
+ return 0;
+ }
+}