Add a little more to the svn_rangelist_intersect test to test the
[svn.git] / subversion / include / svn_time.h
blob2d77ed9d4e8f4cd0f01b6d4b968b22dbb18669bc
1 /**
2 * @copyright
3 * ====================================================================
4 * Copyright (c) 2000-2004 CollabNet. All rights reserved.
6 * This software is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at http://subversion.tigris.org/license-1.html.
9 * If newer versions of this license are posted there, you may use a
10 * newer version instead, at your option.
12 * This software consists of voluntary contributions made by many
13 * individuals. For exact contribution history, see the revision
14 * history and logs, available at http://subversion.tigris.org/.
15 * ====================================================================
16 * @endcopyright
18 * @file svn_time.h
19 * @brief Time/date utilities
22 #ifndef SVN_TIME_H
23 #define SVN_TIME_H
25 #include <apr_pools.h>
26 #include <apr_time.h>
28 #include "svn_error.h"
30 #ifdef __cplusplus
31 extern "C" {
32 #endif /* __cplusplus */
35 /** Convert @a when to a <tt>const char *</tt> representation allocated
36 * in @a pool. Use svn_time_from_cstring() for the reverse
37 * conversion.
39 const char *svn_time_to_cstring(apr_time_t when, apr_pool_t *pool);
41 /** Convert @a data to an @c apr_time_t @a when.
42 * Use @a pool for temporary memory allocation.
44 svn_error_t *svn_time_from_cstring(apr_time_t *when, const char *data,
45 apr_pool_t *pool);
47 /** Convert @a when to a <tt>const char *</tt> representation allocated
48 * in @a pool, suitable for human display in UTF8.
50 const char *svn_time_to_human_cstring(apr_time_t when, apr_pool_t *pool);
53 /** Convert a human-readable date @a text into an @c apr_time_t, using
54 * @a now as the current time and storing the result in @a result.
55 * The local time zone will be used to compute the appropriate GMT
56 * offset if @a text contains a local time specification. Set @a
57 * matched to indicate whether or not @a text was parsed successfully.
58 * Perform any allocation in @a pool. Return an error iff an internal
59 * error (rather than a simple parse error) occurs.
61 svn_error_t *
62 svn_parse_date(svn_boolean_t *matched, apr_time_t *result, const char *text,
63 apr_time_t now, apr_pool_t *pool);
66 /** Sleep until the next second, to ensure that any files modified
67 * after we exit have a different timestamp than the one we recorded.
69 void svn_sleep_for_timestamps(void);
71 #ifdef __cplusplus
73 #endif /* __cplusplus */
75 #endif /* SVN_TIME_H */