summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2018-11-14 21:12:55 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2018-12-01 10:44:16 +0000
commit7e7859a15a65df17fc7e59d75492a5227402490f (patch)
tree1aac92fab3e48977e243cbac6a15cd17ad9a0cd5
parent4e892ae5f053c9199ae128997471f5d2b660e361 (diff)
downloadlibgit2-7e7859a15a65df17fc7e59d75492a5227402490f.tar.gz
object_type: update enumeration names
Update the `git_otype` names to reflect our current naming conventions. `git_otype` is now `git_object_t` and the `GIT_OBJ_*` values are now `GIT_OBJECT_*` values. The old macro, enumeration and structure names are retained and simply set to the new names.
-rw-r--r--include/git2/types.h46
1 files changed, 35 insertions, 11 deletions
diff --git a/include/git2/types.h b/include/git2/types.h
index 3c127e3eb..7d0734e07 100644
--- a/include/git2/types.h
+++ b/include/git2/types.h
@@ -68,17 +68,17 @@ typedef int64_t git_time_t;
/** 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;
+ GIT_OBJECT_ANY = -2, /**< Object can be any of the following */
+ GIT_OBJECT_BAD = -1, /**< Object is invalid. */
+ GIT_OBJECT__EXT1 = 0, /**< Reserved. */
+ GIT_OBJECT_COMMIT = 1, /**< A commit object. */
+ GIT_OBJECT_TREE = 2, /**< A tree (directory listing) object. */
+ GIT_OBJECT_BLOB = 3, /**< A file revision object. */
+ GIT_OBJECT_TAG = 4, /**< An annotated tag object. */
+ GIT_OBJECT__EXT2 = 5, /**< Reserved. */
+ GIT_OBJECT_OFS_DELTA = 6, /**< A delta, base is given by an offset. */
+ GIT_OBJECT_REF_DELTA = 7, /**< A delta, base is given by object id. */
+} git_object_t;
/** An open object database handle. */
typedef struct git_odb git_odb;
@@ -443,6 +443,30 @@ struct git_writestream {
/** Representation of .mailmap file state. */
typedef struct git_mailmap git_mailmap;
+/** @name Deprecated Index Structures
+ *
+ * These macros, structures and enumerations are retained for backward
+ * compatibility. The newer versions of these functions and structures
+ * should be preferred in all new code.
+ */
+
+/**@{*/
+
+#define GIT_OBJ_ANY GIT_OBJECT_ANY
+#define GIT_OBJ_BAD GIT_OBJECT_BAD
+#define GIT_OBJ__EXT1 0
+#define GIT_OBJ_COMMIT GIT_OBJECT_COMMIT
+#define GIT_OBJ_TREE GIT_OBJECT_TREE
+#define GIT_OBJ_BLOB GIT_OBJECT_BLOB
+#define GIT_OBJ_TAG GIT_OBJECT_TAG
+#define GIT_OBJ__EXT2 5
+#define GIT_OBJ_OFS_DELTA GIT_OBJECT_OFS_DELTA
+#define GIT_OBJ_REF_DELTA GIT_OBJECT_REF_DELTA
+
+#define git_otype git_object_t
+
+/**@}*/
+
/** @} */
GIT_END_DECL