summaryrefslogtreecommitdiff
path: root/include/git2/odb.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-03-21 20:28:02 +0200
committerVicent Marti <tanoku@gmail.com>2011-03-22 20:38:33 +0200
commit1881f0783b6dd23fb40ba0b43a4ec98bb08a637c (patch)
treefd0f206bafd3f5a049dd72ad6797a7ff882dc0a9 /include/git2/odb.h
parentb932ef5b3d77b26b8f558bafa3ee416595279dce (diff)
downloadlibgit2-1881f0783b6dd23fb40ba0b43a4ec98bb08a637c.tar.gz
Add getters for `git_odb_object`
Diffstat (limited to 'include/git2/odb.h')
-rw-r--r--include/git2/odb.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/git2/odb.h b/include/git2/odb.h
index 8926b446c..1a0f0e64c 100644
--- a/include/git2/odb.h
+++ b/include/git2/odb.h
@@ -235,6 +235,48 @@ GIT_EXTERN(int) git_odb_hash(git_oid *id, const void *data, size_t len, git_otyp
*/
GIT_EXTERN(void) git_odb_object_close(git_odb_object *object);
+/**
+ * Return the OID of an ODB object
+ *
+ * This is the OID from which the object was read from
+ *
+ * @param object the object
+ * @return a pointer to the OID
+ */
+GIT_EXTERN(const git_oid *) git_odb_object_id(git_odb_object *object);
+
+/**
+ * Return the data of an ODB object
+ *
+ * This is the uncompressed, raw data as read from the ODB,
+ * without the leading header.
+ *
+ * This pointer is owned by the object and shall not be free'd.
+ *
+ * @param object the object
+ * @return a pointer to the data
+ */
+GIT_EXTERN(const void *) git_odb_object_data(git_odb_object *object);
+
+/**
+ * Return the size of an ODB object
+ *
+ * This is the real size of the `data` buffer, not the
+ * actual size of the object.
+ *
+ * @param object the object
+ * @return the size
+ */
+GIT_EXTERN(size_t) git_odb_object_size(git_odb_object *object);
+
+/**
+ * Return the type of an ODB object
+ *
+ * @param object the object
+ * @return the type
+ */
+GIT_EXTERN(git_otype) git_odb_object_type(git_odb_object *object);
+
/** @} */
GIT_END_DECL
#endif