diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-08-05 16:22:51 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-08-05 16:22:51 +0000 |
commit | cf46733632c7279a9fd0fe6ce26f9185a4ae82a9 (patch) | |
tree | da27775a2161723ef342e91af41a8b51fedef405 /subversion/include/private/svn_io_private.h | |
parent | bb0ef45f7c46b0ae221b26265ef98a768c33f820 (diff) | |
download | subversion-tarball-master.tar.gz |
subversion-1.9.7HEADsubversion-1.9.7master
Diffstat (limited to 'subversion/include/private/svn_io_private.h')
-rw-r--r-- | subversion/include/private/svn_io_private.h | 99 |
1 files changed, 98 insertions, 1 deletions
diff --git a/subversion/include/private/svn_io_private.h b/subversion/include/private/svn_io_private.h index 239cd6e..814c27a 100644 --- a/subversion/include/private/svn_io_private.h +++ b/subversion/include/private/svn_io_private.h @@ -44,6 +44,15 @@ extern "C" { #define SVN__APR_FINFO_MASK_OUT (0) #endif +/* 90% of the lines we encounter will be less than this many chars. + * + * Line-based functions like svn_stream_readline should fetch data in + * blocks no longer than this. Although using a larger prefetch size is + * not illegal and must not break any functionality, it may be + * significantly less efficient in certain situations. + */ +#define SVN__LINE_CHUNK_SIZE 80 + /** Set @a *executable TRUE if @a file_info is executable for the * user, FALSE otherwise. @@ -64,6 +73,18 @@ svn_io__is_finfo_read_only(svn_boolean_t *read_only, apr_pool_t *pool); +/** + * Lock file at @a lock_file. If that file does not exist, create an empty + * file. + * + * Lock will be automatically released when @a pool is cleared or destroyed. + * Use @a pool for memory allocations. + */ +svn_error_t * +svn_io__file_lock_autocreate(const char *lock_file, + apr_pool_t *pool); + + /** Buffer test handler function for a generic stream. @see svn_stream_t * and svn_stream__is_buffered(). * @@ -81,7 +102,7 @@ svn_stream__set_is_buffered(svn_stream_t *stream, /** Return whether this generic @a stream uses internal buffering. * This may be used to work around subtle differences between buffered - * an non-buffered APR files. A lazy-open stream cannot report the + * and non-buffered APR files. A lazy-open stream cannot report the * true buffering state until after the lazy open: a stream that * initially reports as non-buffered may report as buffered later. * @@ -96,6 +117,82 @@ svn_stream__is_buffered(svn_stream_t *stream); apr_file_t * svn_stream__aprfile(svn_stream_t *stream); +/* Creates as *INSTALL_STREAM a stream that once completed can be installed + using Windows checkouts much slower than Unix. + + While writing the stream is temporarily stored in TMP_ABSPATH. + */ +svn_error_t * +svn_stream__create_for_install(svn_stream_t **install_stream, + const char *tmp_abspath, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool); + +/* Installs a stream created with svn_stream__create_for_install in its final + location FINAL_ABSPATH, potentially using platform specific optimizations. + + If MAKE_PARENTS is TRUE, this function will create missing parent + directories if needed. + */ +svn_error_t * +svn_stream__install_stream(svn_stream_t *install_stream, + const char *final_abspath, + svn_boolean_t make_parents, + apr_pool_t *scratch_pool); + +/* Deletes the install stream (when installing is not necessary after all) */ +svn_error_t * +svn_stream__install_delete(svn_stream_t *install_stream, + apr_pool_t *scratch_pool); + +/* Optimized apr_file_stat / apr_file_info_get operating on a closed + install stream */ +svn_error_t * +svn_stream__install_get_info(apr_finfo_t *finfo, + svn_stream_t *install_stream, + apr_int32_t wanted, + apr_pool_t *scratch_pool); + + +#if defined(WIN32) + +/* ### Move to something like io.h or subr.h, to avoid making it + part of the DLL api */ + +/* This is semantically the same as the APR utf8_to_unicode_path + function, but reimplemented here because APR does not export it. + + Note that this function creates "\\?\" paths so the resulting path + can only be used for WINAPI functions that explicitly document support + for this kind of paths. Newer Windows functions (Vista+) that support + long paths directly DON'T want this kind of escaping. + */ +svn_error_t* +svn_io__utf8_to_unicode_longpath(const WCHAR **result, + const char *source, + apr_pool_t *result_pool); + +/* This Windows-specific function marks the file to be deleted on close using + an existing file handle. It can be used to avoid having to reopen the file + as part of the delete handling. Return SVN_ERR_UNSUPPORTED_FEATURE if + delete on close operation is not supported by OS. */ +svn_error_t * +svn_io__win_delete_file_on_close(apr_file_t *file, + const char *path, + apr_pool_t *pool); + +/* This Windows-specific function renames the file using an existing file + handle. It can be used to avoid having to reopen the file as part of the + rename operation. Return SVN_ERR_UNSUPPORTED_FEATURE if renaming open + file is not supported by OS.*/ +svn_error_t * +svn_io__win_rename_open_file(apr_file_t *file, + const char *from_path, + const char *to_path, + apr_pool_t *pool); + +#endif /* WIN32 */ + #ifdef __cplusplus } #endif /* __cplusplus */ |