summaryrefslogtreecommitdiff
path: root/include/git2/refdb_backend.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-04-19 17:17:44 -0700
committerRussell Belfer <rb@github.com>2013-04-21 11:57:21 -0700
commit4dcd87801972e1b880afa9cd0998842bae7af5b5 (patch)
tree9309689dad171921b5d91372ee78f264c79bbe3d /include/git2/refdb_backend.h
parent9233b3de4ea264a8ae846c784acc70c505022d8b (diff)
downloadlibgit2-4dcd87801972e1b880afa9cd0998842bae7af5b5.tar.gz
Move refdb_backend to include/git2/sys
This moves most of the refdb stuff over to the include/git2/sys directory, with some minor shifts in function organization. While I was making the necessary updates, I also removed the trailing whitespace in a few files that I modified just because I was there and it was bugging me.
Diffstat (limited to 'include/git2/refdb_backend.h')
-rw-r--r--include/git2/refdb_backend.h108
1 files changed, 0 insertions, 108 deletions
diff --git a/include/git2/refdb_backend.h b/include/git2/refdb_backend.h
deleted file mode 100644
index 20eb6a9dd..000000000
--- a/include/git2/refdb_backend.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) the libgit2 contributors. All rights reserved.
- *
- * This file is part of libgit2, distributed under the GNU GPL v2 with
- * a Linking Exception. For full terms see the included COPYING file.
- */
-#ifndef INCLUDE_git_refdb_backend_h__
-#define INCLUDE_git_refdb_backend_h__
-
-#include "common.h"
-#include "types.h"
-#include "oid.h"
-
-/**
- * @file git2/refdb_backend.h
- * @brief Git custom refs backend functions
- * @defgroup git_refdb_backend Git custom refs backend API
- * @ingroup Git
- * @{
- */
-GIT_BEGIN_DECL
-
-/** An instance for a custom backend */
-struct git_refdb_backend {
- unsigned int version;
-
- /**
- * Queries the refdb backend to determine if the given ref_name
- * exists. A refdb implementation must provide this function.
- */
- int (*exists)(
- int *exists,
- struct git_refdb_backend *backend,
- const char *ref_name);
-
- /**
- * Queries the refdb backend for a given reference. A refdb
- * implementation must provide this function.
- */
- int (*lookup)(
- git_reference **out,
- struct git_refdb_backend *backend,
- const char *ref_name);
-
- /**
- * Enumerates each reference in the refdb. A refdb implementation must
- * provide this function.
- */
- int (*foreach)(
- struct git_refdb_backend *backend,
- unsigned int list_flags,
- git_reference_foreach_cb callback,
- void *payload);
-
- /**
- * Enumerates each reference in the refdb that matches the given
- * glob string. A refdb implementation may provide this function;
- * if it is not provided, foreach will be used and the results filtered
- * against the glob.
- */
- int (*foreach_glob)(
- struct git_refdb_backend *backend,
- const char *glob,
- unsigned int list_flags,
- git_reference_foreach_cb callback,
- void *payload);
-
- /**
- * Writes the given reference to the refdb. A refdb implementation
- * must provide this function.
- */
- int (*write)(struct git_refdb_backend *backend, const git_reference *ref);
-
- /**
- * Deletes the given reference from the refdb. A refdb implementation
- * must provide this function.
- */
- int (*delete)(struct git_refdb_backend *backend, const git_reference *ref);
-
- /**
- * Suggests that the given refdb compress or optimize its references.
- * This mechanism is implementation specific. (For on-disk reference
- * databases, this may pack all loose references.) A refdb
- * implementation may provide this function; if it is not provided,
- * nothing will be done.
- */
- int (*compress)(struct git_refdb_backend *backend);
-
- /**
- * Frees any resources held by the refdb. A refdb implementation may
- * provide this function; if it is not provided, nothing will be done.
- */
- void (*free)(struct git_refdb_backend *backend);
-};
-
-#define GIT_ODB_BACKEND_VERSION 1
-#define GIT_ODB_BACKEND_INIT {GIT_ODB_BACKEND_VERSION}
-
-/**
- * Constructors for default refdb backends.
- */
-GIT_EXTERN(int) git_refdb_backend_fs(
- struct git_refdb_backend **backend_out,
- git_repository *repo);
-
-GIT_END_DECL
-
-#endif