diff options
author | Vicent Marti <tanoku@gmail.com> | 2011-06-16 02:48:48 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2011-06-16 02:50:08 +0200 |
commit | f1d018513aced2fb4e6c87f2d417b6f826dbe998 (patch) | |
tree | ed3f93db76dc70f854f20f4b3bd7f627c0ca6d19 /include/git2/oid.h | |
parent | fa48608ec30758dbf6d0d26d3c4f8efba8efe8e9 (diff) | |
download | libgit2-f1d018513aced2fb4e6c87f2d417b6f826dbe998.tar.gz |
oid: Uniformize ncmp methods
Drop redundant methods. The ncmp method is now public
Diffstat (limited to 'include/git2/oid.h')
-rw-r--r-- | include/git2/oid.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/include/git2/oid.h b/include/git2/oid.h index 74d5bd3d4..06bbfcc55 100644 --- a/include/git2/oid.h +++ b/include/git2/oid.h @@ -55,6 +55,7 @@ typedef struct { /** * Parse a hex formatted object id into a git_oid. + * * @param out oid structure the result is written into. * @param str input hex string; must be pointing at the start of * the hex sequence and have at least the number of bytes @@ -65,6 +66,7 @@ GIT_EXTERN(int) git_oid_fromstr(git_oid *out, const char *str); /** * Copy an already raw oid into a git_oid structure. + * * @param out oid structure the result is written into. * @param raw the raw input bytes to be copied. */ @@ -72,6 +74,7 @@ GIT_EXTERN(void) git_oid_fromraw(git_oid *out, const unsigned char *raw); /** * Format a git_oid into a hex string. + * * @param str output hex string; must be pointing at the start of * the hex sequence and have at least the number of bytes * needed for an oid encoded in hex (40 bytes). Only the @@ -83,7 +86,7 @@ GIT_EXTERN(void) git_oid_fmt(char *str, const git_oid *oid); /** * Format a git_oid into a loose-object path string. - * <p> + * * The resulting string is "aa/...", where "aa" is the first two * hex digitis of the oid and "..." is the remaining 38 digits. * @@ -98,6 +101,7 @@ GIT_EXTERN(void) git_oid_pathfmt(char *str, const git_oid *oid); /** * Format a git_oid into a newly allocated c-string. + * * @param oid the oid structure to format * @return the c-string; NULL if memory is exhausted. Caller must * deallocate the string with free(). @@ -106,7 +110,7 @@ GIT_EXTERN(char *) git_oid_allocfmt(const git_oid *oid); /** * Format a git_oid into a buffer as a hex format c-string. - * <p> + * * If the buffer is smaller than GIT_OID_HEXSZ+1, then the resulting * oid c-string will be truncated to n-1 characters. If there are * any input parameter errors (out == NULL, n == 0, oid == NULL), @@ -123,6 +127,7 @@ GIT_EXTERN(char *) git_oid_to_string(char *out, size_t n, const git_oid *oid); /** * Copy an oid from one structure to another. + * * @param out oid structure the result is written into. * @param src oid structure to copy from. */ @@ -130,6 +135,7 @@ GIT_EXTERN(void) git_oid_cpy(git_oid *out, const git_oid *src); /** * Compare two oid structures. + * * @param a first oid structure. * @param b second oid structure. * @return <0, 0, >0 if a < b, a == b, a > b. @@ -139,12 +145,13 @@ GIT_EXTERN(int) git_oid_cmp(const git_oid *a, const git_oid *b); /** * Compare the first 'len' hexadecimal characters (packets of 4 bits) * of two oid structures. - * @param len the number of hex chars to compare + * * @param a first oid structure. * @param b second oid structure. + * @param len the number of hex chars to compare * @return 0 in case of a match */ -GIT_EXTERN(int) git_oid_ncmp(unsigned int len, git_oid *a, git_oid *b); +GIT_EXTERN(int) git_oid_ncmp(const git_oid *a, const git_oid *b, unsigned int len); /** * OID Shortener object |