summaryrefslogtreecommitdiff
path: root/src/git
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2010-09-19 03:21:06 +0300
committerVicent Marti <tanoku@gmail.com>2010-09-19 03:21:06 +0300
commitf49a2e4981d747f96246bc0c8e75e618419f4eee (patch)
treecae3615bb5d0f94a4ac7dadbb53fbe20f4a52c8f /src/git
parenta7a7ddbe0f097923feb9ed31502857891e02824f (diff)
downloadlibgit2-f49a2e4981d747f96246bc0c8e75e618419f4eee.tar.gz
Give object structures more descriptive names
The 'git_obj' structure is now called 'git_rawobj', since it represents a raw object read from the ODB. The 'git_repository_object' structure is now called 'git_object', since it's the base object class for all objects. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/git')
-rw-r--r--src/git/common.h2
-rw-r--r--src/git/odb.h16
-rw-r--r--src/git/repository.h8
-rw-r--r--src/git/tag.h2
-rw-r--r--src/git/tree.h4
5 files changed, 16 insertions, 16 deletions
diff --git a/src/git/common.h b/src/git/common.h
index b43f4ee01..faf9702a7 100644
--- a/src/git/common.h
+++ b/src/git/common.h
@@ -92,7 +92,7 @@ GIT_BEGIN_DECL
typedef struct git_repository git_repository;
/* Representation of a generic object in a repository */
-typedef struct git_repository_object git_repository_object;
+typedef struct git_object git_object;
/** Parsed representation of a person */
typedef struct git_person {
diff --git a/src/git/odb.h b/src/git/odb.h
index 5d105ba70..a132346c6 100644
--- a/src/git/odb.h
+++ b/src/git/odb.h
@@ -52,7 +52,7 @@ typedef struct {
void *data; /**< Raw, decompressed object data. */
size_t len; /**< Total number of bytes in data. */
git_otype type; /**< Type of this object. */
-} git_obj;
+} git_rawobj;
/**
* Read an object from the database.
@@ -66,7 +66,7 @@ typedef struct {
* - GIT_SUCCESS if the object was read;
* - GIT_ENOTFOUND if the object is not in the database.
*/
-GIT_EXTERN(int) git_odb_read(git_obj *out, git_odb *db, const git_oid *id);
+GIT_EXTERN(int) git_odb_read(git_rawobj *out, git_odb *db, const git_oid *id);
/**
* Read an object from the database using only pack files.
@@ -80,7 +80,7 @@ GIT_EXTERN(int) git_odb_read(git_obj *out, git_odb *db, const git_oid *id);
* - GIT_SUCCESS if the object was read.
* - GIT_ENOTFOUND if the object is not in the database.
*/
-GIT_EXTERN(int) git_odb__read_packed(git_obj *out, git_odb *db, const git_oid *id);
+GIT_EXTERN(int) git_odb__read_packed(git_rawobj *out, git_odb *db, const git_oid *id);
/**
* Read an object from the database using only loose object files.
@@ -94,7 +94,7 @@ GIT_EXTERN(int) git_odb__read_packed(git_obj *out, git_odb *db, const git_oid *i
* - GIT_SUCCESS if the object was read.
* - GIT_ENOTFOUND if the object is not in the database.
*/
-GIT_EXTERN(int) git_odb__read_loose(git_obj *out, git_odb *db, const git_oid *id);
+GIT_EXTERN(int) git_odb__read_loose(git_rawobj *out, git_odb *db, const git_oid *id);
/**
* Write an object to the database.
@@ -106,7 +106,7 @@ GIT_EXTERN(int) git_odb__read_loose(git_obj *out, git_odb *db, const git_oid *id
* - GIT_SUCCESS if the object was written;
* - GIT_ERROR otherwise.
*/
-GIT_EXTERN(int) git_odb_write(git_oid *id, git_odb *db, git_obj *obj);
+GIT_EXTERN(int) git_odb_write(git_oid *id, git_odb *db, git_rawobj *obj);
/**
* Release all memory used by the obj structure.
@@ -117,7 +117,7 @@ GIT_EXTERN(int) git_odb_write(git_oid *id, git_odb *db, git_obj *obj);
*
* @param obj object descriptor to free.
*/
-GIT_INLINE(void) git_obj_close(git_obj *obj)
+GIT_INLINE(void) git_obj_close(git_rawobj *obj)
{
free(obj->data);
obj->data = NULL;
@@ -152,7 +152,7 @@ GIT_EXTERN(git_otype) git_obj_string_to_type(const char *str);
GIT_EXTERN(int) git_obj__loose_object_type(git_otype type);
/**
- * Determine the object-ID (sha1 hash) of the given git_obj.
+ * Determine the object-ID (sha1 hash) of the given git_rawobj.
*
* The input obj must be a valid loose object type and the data
* pointer must not be NULL, unless the len field is also zero.
@@ -163,7 +163,7 @@ GIT_EXTERN(int) git_obj__loose_object_type(git_otype type);
* - GIT_SUCCESS if the object-ID was correctly determined.
* - GIT_ERROR if the given object is malformed.
*/
-GIT_EXTERN(int) git_obj_hash(git_oid *id, git_obj *obj);
+GIT_EXTERN(int) git_obj_hash(git_oid *id, git_rawobj *obj);
/**
* Determine if the given object can be found in the object database.
diff --git a/src/git/repository.h b/src/git/repository.h
index a61e5b6cc..33bb2fcef 100644
--- a/src/git/repository.h
+++ b/src/git/repository.h
@@ -47,7 +47,7 @@ GIT_EXTERN(git_repository *) git_repository_alloc(git_odb *odb);
* @param type the type of the object
* @return a reference to the object
*/
-GIT_EXTERN(git_repository_object *) git_repository_lookup(git_repository *repo, const git_oid *id, git_otype type);
+GIT_EXTERN(git_object *) git_repository_lookup(git_repository *repo, const git_oid *id, git_otype type);
/**
* Get the object database behind a Git repository
@@ -63,7 +63,7 @@ GIT_EXTERN(git_odb *) git_repository_database(git_repository *repo);
* @param obj the repository object
* @return the SHA1 id
*/
-const git_oid *git_repository_object_id(git_repository_object *obj);
+const git_oid *git_object_id(git_object *obj);
/**
* Get the object type of an object
@@ -71,7 +71,7 @@ const git_oid *git_repository_object_id(git_repository_object *obj);
* @param obj the repository object
* @return the object's type
*/
-git_otype git_repository_object_type(git_repository_object *obj);
+git_otype git_object_type(git_object *obj);
/**
* Free a reference to one of the objects in the repostory.
@@ -85,7 +85,7 @@ git_otype git_repository_object_type(git_repository_object *obj);
*
* @param object the object to free
*/
-GIT_EXTERN(void) git_repository_object_free(git_repository_object *object);
+GIT_EXTERN(void) git_object_free(git_object *object);
/**
* Free a previously allocated repository
diff --git a/src/git/tag.h b/src/git/tag.h
index d94083b11..a6efabb0e 100644
--- a/src/git/tag.h
+++ b/src/git/tag.h
@@ -41,7 +41,7 @@ GIT_EXTERN(const git_oid *) git_tag_id(git_tag *tag);
* @param tag a previously loaded tag.
* @return reference to a repository object
*/
-GIT_EXTERN(const git_repository_object *) git_tag_target(git_tag *t);
+GIT_EXTERN(const git_object *) git_tag_target(git_tag *t);
/**
* Get the type of a tag's tagged object
diff --git a/src/git/tree.h b/src/git/tree.h
index fcc38d5e0..646c085bb 100644
--- a/src/git/tree.h
+++ b/src/git/tree.h
@@ -85,11 +85,11 @@ GIT_EXTERN(const char *) git_tree_entry_name(const git_tree_entry *entry);
GIT_EXTERN(const git_oid *) git_tree_entry_id(const git_tree_entry *entry);
/**
- * Convert a tree entry to the git_repository_object it points too.
+ * Convert a tree entry to the git_object it points too.
* @param entry a tree entry
* @return a reference to the pointed object in the repository
*/
-GIT_EXTERN(git_repository_object *) git_tree_entry_2object(const git_tree_entry *entry);
+GIT_EXTERN(git_object *) git_tree_entry_2object(const git_tree_entry *entry);
/** @} */
GIT_END_DECL