summaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2014-04-08 17:18:47 -0700
committerEdward Thomson <ethomson@github.com>2016-05-26 11:36:11 -0500
commitd34f68261ef95b517944d4fa89ee13b4a68d3cb4 (patch)
tree686b92a0e7174b891bd4e5a61e480acfc1be5002 /src/util.h
parent7cb904ba4443c22ff5396769b7d07a7f329c0102 (diff)
downloadlibgit2-d34f68261ef95b517944d4fa89ee13b4a68d3cb4.tar.gz
Patch parsing from patch files
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index d0c3cd04a..eb15250d8 100644
--- a/src/util.h
+++ b/src/util.h
@@ -263,7 +263,10 @@ GIT_INLINE(int) git__signum(int val)
}
extern int git__strtol32(int32_t *n, const char *buff, const char **end_buf, int base);
+extern int git__strntol32(int32_t *n, const char *buff, size_t buff_len, const char **end_buf, int base);
extern int git__strtol64(int64_t *n, const char *buff, const char **end_buf, int base);
+extern int git__strntol64(int64_t *n, const char *buff, size_t buff_len, const char **end_buf, int base);
+
extern void git__hexdump(const char *buffer, size_t n);
extern uint32_t git__hash(const void *key, int len, uint32_t seed);
@@ -290,6 +293,8 @@ GIT_INLINE(int) git__tolower(int c)
# define git__tolower(a) tolower(a)
#endif
+extern size_t git__linenlen(const char *buffer, size_t buffer_len);
+
GIT_INLINE(const char *) git__next_line(const char *s)
{
while (*s && *s != '\n') s++;
@@ -466,6 +471,11 @@ GIT_INLINE(bool) git__iswildcard(int c)
return (c == '*' || c == '?' || c == '[');
}
+GIT_INLINE(bool) git__isxdigit(int c)
+{
+ return ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'));
+}
+
/*
* Parse a string value as a boolean, just like Core Git does.
*