Subversion
svn_time.h
Go to the documentation of this file.
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.  Use svn_time_from_cstring() for the reverse
00042  * conversion.
00043  */
00044 const char *
00045 svn_time_to_cstring(apr_time_t when,
00046                     apr_pool_t *pool);
00047 
00048 /** Convert @a data to an @c apr_time_t @a when.
00049  * Use @a pool for temporary memory allocation.
00050  */
00051 svn_error_t *
00052 svn_time_from_cstring(apr_time_t *when,
00053                       const char *data,
00054                       apr_pool_t *pool);
00055 
00056 /** Convert @a when to a <tt>const char *</tt> representation allocated
00057  * in @a pool, suitable for human display in UTF8.
00058  */
00059 const char *
00060 svn_time_to_human_cstring(apr_time_t when,
00061                           apr_pool_t *pool);
00062 
00063 
00064 /** Convert a human-readable date @a text into an @c apr_time_t, using
00065  * @a now as the current time and storing the result in @a result.
00066  * The local time zone will be used to compute the appropriate GMT
00067  * offset if @a text contains a local time specification.  Set @a
00068  * matched to indicate whether or not @a text was parsed successfully.
00069  * Perform any allocation in @a pool.  Return an error iff an internal
00070  * error (rather than a simple parse error) occurs.
00071  */
00072 svn_error_t *
00073 svn_parse_date(svn_boolean_t *matched,
00074                apr_time_t *result,
00075                const char *text,
00076                apr_time_t now,
00077                apr_pool_t *pool);
00078 
00079 
00080 /** Sleep until the next second, to ensure that any files modified
00081  * after we exit have a different timestamp than the one we recorded.
00082  *
00083  * @deprecated Provided for backward compatibility with the 1.5 API.
00084  * Use svn_io_sleep_for_timestamps() instead.
00085  */
00086 SVN_DEPRECATED
00087 void
00088 svn_sleep_for_timestamps(void);
00089 
00090 #ifdef __cplusplus
00091 }
00092 #endif /* __cplusplus */
00093 
00094 #endif /* SVN_TIME_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines