Subversion 1.6.16
|
00001 /** 00002 * @copyright 00003 * ==================================================================== 00004 * Copyright (c) 2000-2004, 2008 CollabNet. All rights reserved. 00005 * 00006 * This software is licensed as described in the file COPYING, which 00007 * you should have received as part of this distribution. The terms 00008 * are also available at http://subversion.tigris.org/license-1.html. 00009 * If newer versions of this license are posted there, you may use a 00010 * newer version instead, at your option. 00011 * 00012 * This software consists of voluntary contributions made by many 00013 * individuals. For exact contribution history, see the revision 00014 * history and logs, available at http://subversion.tigris.org/. 00015 * ==================================================================== 00016 * @endcopyright 00017 * 00018 * @file svn_time.h 00019 * @brief Time/date utilities 00020 */ 00021 00022 #ifndef SVN_TIME_H 00023 #define SVN_TIME_H 00024 00025 #include <apr_pools.h> 00026 #include <apr_time.h> 00027 00028 #include "svn_error.h" 00029 00030 #ifdef __cplusplus 00031 extern "C" { 00032 #endif /* __cplusplus */ 00033 00034 00035 /** Convert @a when to a <tt>const char *</tt> representation allocated 00036 * in @a pool. Use svn_time_from_cstring() for the reverse 00037 * conversion. 00038 */ 00039 const char * 00040 svn_time_to_cstring(apr_time_t when, 00041 apr_pool_t *pool); 00042 00043 /** Convert @a data to an @c apr_time_t @a when. 00044 * Use @a pool for temporary memory allocation. 00045 */ 00046 svn_error_t * 00047 svn_time_from_cstring(apr_time_t *when, 00048 const char *data, 00049 apr_pool_t *pool); 00050 00051 /** Convert @a when to a <tt>const char *</tt> representation allocated 00052 * in @a pool, suitable for human display in UTF8. 00053 */ 00054 const char * 00055 svn_time_to_human_cstring(apr_time_t when, 00056 apr_pool_t *pool); 00057 00058 00059 /** Convert a human-readable date @a text into an @c apr_time_t, using 00060 * @a now as the current time and storing the result in @a result. 00061 * The local time zone will be used to compute the appropriate GMT 00062 * offset if @a text contains a local time specification. Set @a 00063 * matched to indicate whether or not @a text was parsed successfully. 00064 * Perform any allocation in @a pool. Return an error iff an internal 00065 * error (rather than a simple parse error) occurs. 00066 */ 00067 svn_error_t * 00068 svn_parse_date(svn_boolean_t *matched, 00069 apr_time_t *result, 00070 const char *text, 00071 apr_time_t now, 00072 apr_pool_t *pool); 00073 00074 00075 /** Sleep until the next second, to ensure that any files modified 00076 * after we exit have a different timestamp than the one we recorded. 00077 * 00078 * @deprecated Provided for backward compatibility with the 1.5 API. 00079 * Use svn_io_sleep_for_timestamps() instead. 00080 */ 00081 SVN_DEPRECATED 00082 void 00083 svn_sleep_for_timestamps(void); 00084 00085 #ifdef __cplusplus 00086 } 00087 #endif /* __cplusplus */ 00088 00089 #endif /* SVN_TIME_H */