summaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorVicent Marti <vicent@github.com>2014-04-16 19:09:35 +0200
committerVicent Marti <vicent@github.com>2014-04-16 19:09:35 +0200
commitc5cacc4ec2c13e93164b8e3013b0d18c8c6d820c (patch)
tree19ee82e4327f0d30a4e75bc5d7997430fbb2becf /src/util.h
parent3b2d14a7b83e0db272c84046f90b53b7b773180e (diff)
parent39206ca256409edb7102edf0d30a6ced2e5f16e3 (diff)
downloadlibgit2-c5cacc4ec2c13e93164b8e3013b0d18c8c6d820c.tar.gz
Merge pull request #2261 from jacquesg/format-patch
Support for format-patch
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index e378786d9..5c2c563d6 100644
--- a/src/util.h
+++ b/src/util.h
@@ -20,6 +20,8 @@
# define max(a,b) ((a) > (b) ? (a) : (b))
#endif
+#define GIT_DATE_RFC2822_SZ 32
+
/*
* Custom memory allocation wrappers
* that set error code and error message
@@ -329,6 +331,16 @@ extern int git__parse_bool(int *out, const char *value);
extern int git__date_parse(git_time_t *out, const char *date);
/*
+ * Format a git_time as a RFC2822 string
+ *
+ * @param out buffer to store formatted date; a '\\0' terminator will automatically be added.
+ * @param len size of the buffer; should be atleast `GIT_DATE_RFC2822_SZ` in size;
+ * @param date the date to be formatted
+ * @return 0 if successful; -1 on error
+ */
+extern int git__date_rfc2822_fmt(char *out, size_t len, const git_time *date);
+
+/*
* Unescapes a string in-place.
*
* Edge cases behavior: