00001 /** 00002 * @copyright 00003 * ==================================================================== 00004 * Licensed to the Apache Software Foundation (ASF) under one 00005 * or more contributor license agreements. See the NOTICE file 00006 * distributed with this work for additional information 00007 * regarding copyright ownership. The ASF licenses this file 00008 * to you under the Apache License, Version 2.0 (the 00009 * "License"); you may not use this file except in compliance 00010 * with the License. You may obtain a copy of the License at 00011 * 00012 * http://www.apache.org/licenses/LICENSE-2.0 00013 * 00014 * Unless required by applicable law or agreed to in writing, 00015 * software distributed under the License is distributed on an 00016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 00017 * KIND, either express or implied. See the License for the 00018 * specific language governing permissions and limitations 00019 * under the License. 00020 * ==================================================================== 00021 * @endcopyright 00022 * 00023 * @file svn_time.h 00024 * @brief Time/date utilities 00025 */ 00026 00027 #ifndef SVN_TIME_H 00028 #define SVN_TIME_H 00029 00030 #include <apr_pools.h> 00031 #include <apr_time.h> 00032 00033 #include "svn_error.h" 00034 00035 #ifdef __cplusplus 00036 extern "C" { 00037 #endif /* __cplusplus */ 00038 00039 00040 /** Convert @a when to a <tt>const char *</tt> representation allocated 00041 * in @a pool. 00042 * 00043 * @see svn_time_from_cstring() for the reverse conversion. 00044 */ 00045 const char * 00046 svn_time_to_cstring(apr_time_t when, 00047 apr_pool_t *pool); 00048 00049 /** Convert @a data to an @c apr_time_t @a when. 00050 * 00051 * @see svn_time_to_cstring() for the reverse conversion. 00052 * 00053 * @deprecated Also accepts a format that was used before Subversion 0.14. 00054 * See implementation for details. Use of this format is deprecated. 00055 * 00056 * Use @a pool for temporary memory allocation. 00057 */ 00058 svn_error_t * 00059 svn_time_from_cstring(apr_time_t *when, 00060 const char *data, 00061 apr_pool_t *pool); 00062 00063 /** Convert @a when to a <tt>const char *</tt> representation allocated 00064 * in @a pool, suitable for human display in UTF8. 00065 */ 00066 const char * 00067 svn_time_to_human_cstring(apr_time_t when, 00068 apr_pool_t *pool); 00069 00070 00071 /** Convert a human-readable date @a text into an @c apr_time_t, using 00072 * @a now as the current time and storing the result in @a result. 00073 * The local time zone will be used to compute the appropriate GMT 00074 * offset if @a text contains a local time specification. Set @a 00075 * matched to indicate whether or not @a text was parsed successfully. 00076 * Perform any allocation in @a pool. Return an error iff an internal 00077 * error (rather than a simple parse error) occurs. 00078 */ 00079 svn_error_t * 00080 svn_parse_date(svn_boolean_t *matched, 00081 apr_time_t *result, 00082 const char *text, 00083 apr_time_t now, 00084 apr_pool_t *pool); 00085 00086 00087 /** Sleep until the next second, to ensure that any files modified 00088 * after we exit have a different timestamp than the one we recorded. 00089 * 00090 * @deprecated Provided for backward compatibility with the 1.5 API. 00091 * Use svn_io_sleep_for_timestamps() instead. 00092 */ 00093 SVN_DEPRECATED 00094 void 00095 svn_sleep_for_timestamps(void); 00096 00097 #ifdef __cplusplus 00098 } 00099 #endif /* __cplusplus */ 00100 00101 #endif /* SVN_TIME_H */
1.6.1