diff options
author | Vicent Marti <tanoku@gmail.com> | 2010-12-03 22:22:10 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2010-12-06 01:14:15 +0200 |
commit | d12299fe22e549a20e632668fdbe13cab9def9df (patch) | |
tree | 9d70b6bc154e776c49eaaddd9a66eb97aebab661 /src/git/odb.h | |
parent | 7d7cd8857a451ff50b126e452bcbdc0fb397db35 (diff) | |
download | libgit2-d12299fe22e549a20e632668fdbe13cab9def9df.tar.gz |
Change include structure for the project
The maze with include dependencies has been fixed.
There is now a global include:
#include <git.h>
The git_odb_backend API has been exposed.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/git/odb.h')
-rw-r--r-- | src/git/odb.h | 59 |
1 files changed, 2 insertions, 57 deletions
diff --git a/src/git/odb.h b/src/git/odb.h index 584a848c5..6be6ea2cf 100644 --- a/src/git/odb.h +++ b/src/git/odb.h @@ -2,8 +2,8 @@ #define INCLUDE_git_odb_h__ #include "common.h" +#include "types.h" #include "oid.h" -#include <stdlib.h> /** * @file git/odb.h @@ -14,12 +14,6 @@ */ GIT_BEGIN_DECL -/** An open object database handle. */ -typedef struct git_odb git_odb; - -/** A custom backend in an ODB */ -typedef struct git_odb_backend git_odb_backend; - /** * Create a new object database with no backends. * @@ -69,20 +63,6 @@ GIT_EXTERN(int) git_odb_add_backend(git_odb *odb, git_odb_backend *backend); */ GIT_EXTERN(void) git_odb_close(git_odb *db); -/** Basic type (loose or packed) of any Git object. */ -typedef enum { - GIT_OBJ_ANY = -2, /**< Object can be any of the following */ - GIT_OBJ_BAD = -1, /**< Object is invalid. */ - GIT_OBJ__EXT1 = 0, /**< Reserved for future use. */ - GIT_OBJ_COMMIT = 1, /**< A commit object. */ - GIT_OBJ_TREE = 2, /**< A tree (directory listing) object. */ - GIT_OBJ_BLOB = 3, /**< A file revision object. */ - GIT_OBJ_TAG = 4, /**< An annotated tag object. */ - GIT_OBJ__EXT2 = 5, /**< Reserved for future use. */ - GIT_OBJ_OFS_DELTA = 6, /**< A delta, base is given by an offset. */ - GIT_OBJ_REF_DELTA = 7, /**< A delta, base is given by object id. */ -} git_otype; - /** An object read from the database. */ typedef struct { void *data; /**< Raw, decompressed object data. */ @@ -173,42 +153,7 @@ GIT_EXTERN(int) git_rawobj_hash(git_oid *id, git_rawobj *obj); * * @param obj object descriptor to free. */ -GIT_INLINE(void) git_rawobj_close(git_rawobj *obj) -{ - free(obj->data); - obj->data = NULL; -} - - - - -/** - * Convert an object type to it's string representation. - * - * The result is a pointer to a string in static memory and - * should not be free()'ed. - * - * @param type object type to convert. - * @return the corresponding string representation. - */ -GIT_EXTERN(const char *) git_otype_tostring(git_otype type); - -/** - * Convert a string object type representation to it's git_otype. - * - * @param str the string to convert. - * @return the corresponding git_otype. - */ -GIT_EXTERN(git_otype) git_otype_fromstring(const char *str); - -/** - * Determine if the given git_otype is a valid loose object type. - * - * @param type object type to test. - * @return true if the type represents a valid loose object type, - * false otherwise. - */ -GIT_EXTERN(int) git_otype_is_loose(git_otype type); +GIT_EXTERN(void) git_rawobj_close(git_rawobj *obj); /** @} */ GIT_END_DECL |