Commit 8a385c04 by Ben Straub

Move git__date_parse declaration to util.h.

parent 2c2cde47
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <sys/time.h> #include <sys/time.h>
#endif #endif
#include "date.h" #include "util.h"
#include "cache.h" #include "cache.h"
#include "posix.h" #include "posix.h"
......
/*
* Copyright (C) 2009-2012 the libgit2 contributors
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#ifndef INCLUDE_date_h__
#define INCLUDE_date_h__
#include "git2/types.h"
int git__date_parse(git_time_t *out, const char *date);
#endif
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "common.h" #include "common.h"
#include "buffer.h" #include "buffer.h"
#include "date.h"
#include "tree.h" #include "tree.h"
#include "git2.h" #include "git2.h"
......
...@@ -230,4 +230,14 @@ GIT_INLINE(bool) git__iswildcard(int c) ...@@ -230,4 +230,14 @@ GIT_INLINE(bool) git__iswildcard(int c)
*/ */
extern int git__parse_bool(int *out, const char *value); extern int git__parse_bool(int *out, const char *value);
/*
* Parse a string into a value as a git_time_t.
*
* Sample valid input:
* - "yesterday"
* - "July 17, 2003"
* - "2003-7-17 08:23"
*/
int git__date_parse(git_time_t *out, const char *date);
#endif /* INCLUDE_util_h__ */ #endif /* INCLUDE_util_h__ */
#include "clar_libgit2.h" #include "clar_libgit2.h"
#include "date.h" #include "util.h"
void test_date_date__overflow(void) void test_date_date__overflow(void)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment