summaryrefslogtreecommitdiff
path: root/src/git
diff options
context:
space:
mode:
authorRamsay Jones <ramsay@ramsay1.demon.co.uk>2008-12-10 18:31:28 +0000
committerShawn O. Pearce <spearce@spearce.org>2008-12-10 11:49:06 -0800
commit7b6e8067ec96acef9a4184b43210d583b6d2f99a (patch)
tree20c4a63e8cd8a70bc0f894ada6a54afbdefffadf /src/git
parentb3be0fc7562d51df415c14abf671deb37d8f89ef (diff)
downloadlibgit2-7b6e8067ec96acef9a4184b43210d583b6d2f99a.tar.gz
Add some git_otype string conversion and testing routines
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'src/git')
-rw-r--r--src/git/odb.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/git/odb.h b/src/git/odb.h
index 07f4f5f82..e8b17444a 100644
--- a/src/git/odb.h
+++ b/src/git/odb.h
@@ -110,6 +110,34 @@ GIT_INLINE(void) git_obj_close(git_obj *obj)
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_obj_type_to_string(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_obj_string_to_type(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_obj__loose_object_type(git_otype type);
+
/** @} */
GIT_END_DECL
#endif