]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/subversion/subversion/include/private/svn_io_private.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / subversion / subversion / include / private / svn_io_private.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_io_private.h
24  * @brief Private IO API
25  */
26
27 #ifndef SVN_IO_PRIVATE_H
28 #define SVN_IO_PRIVATE_H
29
30 #include <apr.h>
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif /* __cplusplus */
35
36 /* The flags to pass to apr_stat to check for executable and/or readonly */
37 #if defined(WIN32) || defined(__OS2__)
38 #define SVN__APR_FINFO_EXECUTABLE (0)
39 #define SVN__APR_FINFO_READONLY (0)
40 #define SVN__APR_FINFO_MASK_OUT (APR_FINFO_PROT | APR_FINFO_OWNER)
41 #else
42 #define SVN__APR_FINFO_EXECUTABLE (APR_FINFO_PROT)
43 #define SVN__APR_FINFO_READONLY (APR_FINFO_PROT | APR_FINFO_OWNER)
44 #define SVN__APR_FINFO_MASK_OUT (0)
45 #endif
46
47
48 /** Set @a *executable TRUE if @a file_info is executable for the
49  * user, FALSE otherwise.
50  *
51  * Always returns FALSE on Windows or platforms without user support.
52  */
53 svn_error_t *
54 svn_io__is_finfo_executable(svn_boolean_t *executable,
55                             apr_finfo_t *file_info,
56                             apr_pool_t *pool);
57
58 /** Set @a *read_only TRUE if @a file_info is read-only for the user,
59  * FALSE otherwise.
60  */
61 svn_error_t *
62 svn_io__is_finfo_read_only(svn_boolean_t *read_only,
63                            apr_finfo_t *file_info,
64                            apr_pool_t *pool);
65
66
67 /** Buffer test handler function for a generic stream. @see svn_stream_t
68  * and svn_stream__is_buffered().
69  *
70  * @since New in 1.7.
71  */
72 typedef svn_boolean_t (*svn_stream__is_buffered_fn_t)(void *baton);
73
74 /** Set @a stream's buffer test function to @a is_buffered_fn
75  *
76  * @since New in 1.7.
77  */
78 void
79 svn_stream__set_is_buffered(svn_stream_t *stream,
80                             svn_stream__is_buffered_fn_t is_buffered_fn);
81
82 /** Return whether this generic @a stream uses internal buffering.
83  * This may be used to work around subtle differences between buffered
84  * an non-buffered APR files.  A lazy-open stream cannot report the
85  * true buffering state until after the lazy open: a stream that
86  * initially reports as non-buffered may report as buffered later.
87  *
88  * @since New in 1.7.
89  */
90 svn_boolean_t
91 svn_stream__is_buffered(svn_stream_t *stream);
92
93 /** Return the underlying file, if any, associated with the stream, or
94  * NULL if not available.  Accessing the file bypasses the stream.
95  */
96 apr_file_t *
97 svn_stream__aprfile(svn_stream_t *stream);
98
99 #ifdef __cplusplus
100 }
101 #endif /* __cplusplus */
102
103
104 #endif /* SVN_IO_PRIVATE_H */