]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/subversion/subversion/include/svn_cache_config.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / subversion / subversion / include / svn_cache_config.h
1 /**
2  * @copyright
3  * ====================================================================
4  *    Licensed to the Apache Software Foundation (ASF) under one
5  *    or more contributor license agreements.  See the NOTICE file
6  *    distributed with this work for additional information
7  *    regarding copyright ownership.  The ASF licenses this file
8  *    to you under the Apache License, Version 2.0 (the
9  *    "License"); you may not use this file except in compliance
10  *    with the License.  You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  *    Unless required by applicable law or agreed to in writing,
15  *    software distributed under the License is distributed on an
16  *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17  *    KIND, either express or implied.  See the License for the
18  *    specific language governing permissions and limitations
19  *    under the License.
20  * ====================================================================
21  * @endcopyright
22  *
23  * @file svn_cache_config.h
24  * @brief Configuration interface to internal Subversion caches.
25  */
26
27 #ifndef SVN_CACHE_CONFIG_H
28 #define SVN_CACHE_CONFIG_H
29
30 #include <apr.h>
31 #include "svn_types.h"
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif /* __cplusplus */
36
37 /** @defgroup svn_fs_cache_config caching configuration
38  * @{
39  * @since New in 1.7. */
40
41 /** Cache resource settings. It controls what caches, in what size and
42    how they will be created. The settings apply for the whole process.
43
44    @since New in 1.7.
45  */
46 typedef struct svn_cache_config_t
47 {
48   /** total cache size in bytes. Please note that this is only soft limit
49      to the total application memory usage and will be exceeded due to
50      temporary objects and other program state.
51      May be 0, resulting in default caching code being used. */
52   apr_uint64_t cache_size;
53
54   /** maximum number of files kept open */
55   apr_size_t file_handle_count;
56
57   /** is this application guaranteed to be single-threaded? */
58   svn_boolean_t single_threaded;
59 } svn_cache_config_t;
60
61 /** Get the current cache configuration. If it has not been set,
62    this function will return the default settings.
63
64    @since New in 1.7.
65  */
66 const svn_cache_config_t *
67 svn_cache_config_get(void);
68
69 /** Set the cache configuration. Please note that it may not change
70    the actual configuration *in use*. Therefore, call it before reading
71    data from any repo and call it only once.
72
73    This function is not thread-safe. Therefore, it should be called
74    from the processes' initialization code only.
75
76    @since New in 1.7.
77  */
78 void
79 svn_cache_config_set(const svn_cache_config_t *settings);
80
81 /** @} */
82
83 /** @} */
84
85
86 #ifdef __cplusplus
87 }
88 #endif /* __cplusplus */
89
90 #endif /* SVN_CACHE_CONFIG_H */