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
12 * http://www.apache.org/licenses/LICENSE-2.0
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
20 * ====================================================================
23 * @file svn_io_private.h
24 * @brief Private IO API
27 #ifndef SVN_IO_PRIVATE_H
28 #define SVN_IO_PRIVATE_H
34 #endif /* __cplusplus */
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)
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)
48 /** Set @a *executable TRUE if @a file_info is executable for the
49 * user, FALSE otherwise.
51 * Always returns FALSE on Windows or platforms without user support.
54 svn_io__is_finfo_executable(svn_boolean_t *executable,
55 apr_finfo_t *file_info,
58 /** Set @a *read_only TRUE if @a file_info is read-only for the user,
62 svn_io__is_finfo_read_only(svn_boolean_t *read_only,
63 apr_finfo_t *file_info,
67 /** Buffer test handler function for a generic stream. @see svn_stream_t
68 * and svn_stream__is_buffered().
72 typedef svn_boolean_t (*svn_stream__is_buffered_fn_t)(void *baton);
74 /** Set @a stream's buffer test function to @a is_buffered_fn
79 svn_stream__set_is_buffered(svn_stream_t *stream,
80 svn_stream__is_buffered_fn_t is_buffered_fn);
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.
91 svn_stream__is_buffered(svn_stream_t *stream);
93 /** Return the underlying file, if any, associated with the stream, or
94 * NULL if not available. Accessing the file bypasses the stream.
97 svn_stream__aprfile(svn_stream_t *stream);
101 #endif /* __cplusplus */
104 #endif /* SVN_IO_PRIVATE_H */