📄 svn_wc.h
字号:
/** * @copyright * ==================================================================== * Copyright (c) 2000-2006 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_wc.h * @brief The Subversion Working Copy Library * * Requires: * - A working copy * * Provides: * - Ability to manipulate working copy's versioned data. * - Ability to manipulate working copy's administrative files. * * Used By: * - Clients. */#ifndef SVN_WC_H#define SVN_WC_H#include <apr.h>#include <apr_pools.h>#include <apr_tables.h>#include <apr_hash.h>#include "svn_types.h"#include "svn_string.h"#include "svn_delta.h"#include "svn_error.h"#include "svn_opt.h"#include "svn_ra.h" /* for svn_ra_reporter_t type */#ifdef __cplusplusextern "C" {#endif /* __cplusplus *//** * Get libsvn_wc version information. * * @since New in 1.1. */const svn_version_t *svn_wc_version(void);/** Flags for use with svn_wc_translated_file2 * * @defgroup translate_flags Translation flags * * @{ */ /** Translate from Normal Form. * * The working copy text bases and repository files are stored * in normal form. Some files' contents - or ever representation - * differs between the working copy and the normal form. This flag * specifies to take the latter form as input and transform it * to the former. * * Either this flag or @c SVN_WC_TRANSLATE_TO_NF should be specified, * but not both. */#define SVN_WC_TRANSLATE_FROM_NF 0x00000000 /** Translate to Normal Form. * * Either this flag or @c SVN_WC_TRANSLATE_FROM_NF should be specified, * but not both. */#define SVN_WC_TRANSLATE_TO_NF 0x00000001 /** Force repair of eol styles, making sure the output file consistently * contains the one eol style as specified by the svn:eol-style * property and the required translation direction. * */#define SVN_WC_TRANSLATE_FORCE_EOL_REPAIR 0x00000002 /** Don't register a pool cleanup to delete the output file */#define SVN_WC_TRANSLATE_NO_OUTPUT_CLEANUP 0x00000004 /** Guarantee a new file is created on successful return. * The default shortcuts translation by returning the path * of the untranslated file when no translation is required. */#define SVN_WC_TRANSLATE_FORCE_COPY 0x00000008 /** Use a non-wc-local tmp directory for creating output files, * instead of in the working copy admin tmp area which is the default. * * @since New in 1.4. */#define SVN_WC_TRANSLATE_USE_GLOBAL_TMP 0x00000010/** @} *//* Locking/Opening/Closing *//** Baton for access to a working copy administrative area. * * One day all such access will require a baton, we're not there yet. * * Access batons can be grouped into sets, by passing an existing open * baton when opening a new baton. Given one baton in a set, other batons * may be retrieved. This allows an entire hierarchy to be locked, and * then the set of batons can be passed around by passing a single baton. */typedef struct svn_wc_adm_access_t svn_wc_adm_access_t;/** * Return, in @a *adm_access, a pointer to a new access baton for the working * copy administrative area associated with the directory @a path. If * @a write_lock is true the baton will include a write lock, otherwise the * baton can only be used for read access. If @a path refers to a directory * that is already write locked then the error @c SVN_ERR_WC_LOCKED will be * returned. The error @c SVN_ERR_WC_NOT_DIRECTORY will be returned if * @a path is not a versioned directory. * * If @a associated is an open access baton then @a adm_access will be added * to the set containing @a associated. @a associated can be @c NULL, in * which case @a adm_access is the start of a new set. * * @a depth specifies how much to lock. Zero means just the specified * directory. Any negative value means to lock the entire working copy * directory hierarchy under @a path. A positive value indicates the number of * levels of directories to lock -- 1 means just immediate subdirectories, 2 * means immediate subdirectories and their subdirectories, etc. All the * access batons will become part of the set containing @a adm_access. This * is an all-or-nothing option, if it is not possible to lock all the * requested directories then an error will be returned and @a adm_access will * be invalid, with the exception that subdirectories of @a path that are * missing from the physical filesystem will not be locked and will not cause * an error. The error @c SVN_ERR_WC_LOCKED will be returned if a * subdirectory of @a path is already write locked. * * If @a cancel_func is non-null, call it with @a cancel_baton to determine * if the client has cancelled the operation. * * @a pool will be used to allocate memory for the baton and any subsequently * cached items. If @a adm_access has not been closed when the pool is * cleared, it will be closed automatically at that point, and removed from * its set. A baton closed in this way will not remove physical locks from * the working copy if cleanup is required. * * The first baton in a set, with @a associated passed as @c NULL, must have * the longest lifetime of all the batons in the set. This implies it must be * the root of the hierarchy. * * @since New in 1.2. */svn_error_t *svn_wc_adm_open3(svn_wc_adm_access_t **adm_access, svn_wc_adm_access_t *associated, const char *path, svn_boolean_t write_lock, int depth, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool);/** * Similar to svn_wc_adm_open3(), but without cancellation support. * * @deprecated Provided for backward compatibility with the 1.1 API. */svn_error_t *svn_wc_adm_open2(svn_wc_adm_access_t **adm_access, svn_wc_adm_access_t *associated, const char *path, svn_boolean_t write_lock, int depth, apr_pool_t *pool);/** * Similar to svn_wc_adm_open2(), but with @a tree_lock instead of * @a depth. @a depth is set to -1 if @a tree_lock is @c TRUE, else 0. * * @deprecated Provided for backward compatibility with the 1.0 API. */svn_error_t *svn_wc_adm_open(svn_wc_adm_access_t **adm_access, svn_wc_adm_access_t *associated, const char *path, svn_boolean_t write_lock, svn_boolean_t tree_lock, apr_pool_t *pool);/** * Checks the working copy to determine the node type of @a path. If * @a path is a versioned directory then the behaviour is like that of * svn_wc_adm_open3(), otherwise, if @a path is a file or does not * exist, then the behaviour is like that of svn_wc_adm_open3() with * @a path replaced by the parent directory of @a path. If @a path is * an unversioned directory, the behaviour is also like that of * svn_wc_adm_open3() on the parent, except that if the open fails, * then the returned SVN_ERR_WC_NOT_DIRECTORY error refers to @a path, * not to @a path's parent. * * @since New in 1.2. */svn_error_t *svn_wc_adm_probe_open3(svn_wc_adm_access_t **adm_access, svn_wc_adm_access_t *associated, const char *path, svn_boolean_t write_lock, int depth, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool);/** * Similar to svn_wc_adm_probe_open3() without the cancel * functionality. * * @deprecated Provided for backward compatibility with the 1.1 API. */svn_error_t *svn_wc_adm_probe_open2(svn_wc_adm_access_t **adm_access, svn_wc_adm_access_t *associated, const char *path, svn_boolean_t write_lock, int depth, apr_pool_t *pool);/** * Similar to svn_wc_adm_probe_open2(), but with @a tree_lock instead of * @a depth. @a depth is set to -1 if @a tree_lock is @c TRUE, else 0. * * @deprecated Provided for backward compatibility with the 1.0 API. */svn_error_t *svn_wc_adm_probe_open(svn_wc_adm_access_t **adm_access, svn_wc_adm_access_t *associated, const char *path, svn_boolean_t write_lock, svn_boolean_t tree_lock, apr_pool_t *pool);/** * Open access batons for @a path and return in @a *anchor_access and * @a *target the anchor and target required to drive an editor. Return * in @a *target_access the access baton for the target, which may be the * same as @a *anchor_access. All the access batons will be in the * @a *anchor_access set. * * @a depth determines the depth used when opening @a path if @a path is a * versioned directory, @a depth is ignored otherwise. If @a write_lock is * @c TRUE the access batons will hold write locks. * * If @a cancel_func is non-null, call it with @a cancel_baton to determine * if the client has cancelled the operation. * * This function is essentially a combination of svn_wc_adm_open3() and * svn_wc_get_actual_target(), with the emphasis on reducing physical IO. * * @since New in 1.2. */svn_error_t *svn_wc_adm_open_anchor(svn_wc_adm_access_t **anchor_access, svn_wc_adm_access_t **target_access, const char **target, const char *path, svn_boolean_t write_lock, int depth, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool);/** Return, in @a *adm_access, a pointer to an existing access baton associated * with @a path. @a path must be a directory that is locked as part of the * set containing the @a associated access baton. * * If the requested access baton is marked as missing in, or is simply * absent from, @a associated, return SVN_ERR_WC_NOT_LOCKED. * * @a pool is used only for local processing, it is not used for the batons. */svn_error_t *svn_wc_adm_retrieve(svn_wc_adm_access_t **adm_access, svn_wc_adm_access_t *associated, const char *path, apr_pool_t *pool);/** Check the working copy to determine the node type of @a path. If * @a path is a versioned directory then the behaviour is like that of * svn_wc_adm_retrieve(), otherwise, if @a path is a file, an unversioned * directory, or does not exist, then the behaviour is like that of * svn_wc_adm_retrieve() with @a path replaced by the parent directory of * @a path. */svn_error_t *svn_wc_adm_probe_retrieve(svn_wc_adm_access_t **adm_access, svn_wc_adm_access_t *associated, const char *path, apr_pool_t *pool);/** * Try various ways to obtain an access baton for @a path. * * First, try to obtain @a *adm_access via svn_wc_adm_probe_retrieve(), * but if this fails because @a associated can't give a baton for * @a path or @a path's parent, then try svn_wc_adm_probe_open3(), * this time passing @a write_lock and @a depth. If there is * still no access because @a path is not a versioned directory, then * just set @a *adm_access to null and return success. But if it is * because @a path is locked, then return the error @c SVN_ERR_WC_LOCKED, * and the effect on @a *adm_access is undefined. (Or if the attempt * fails for any other reason, return the corresponding error, and the * effect on @a *adm_access is also undefined.) * * If svn_wc_adm_probe_open3() succeeds, then add @a *adm_access to * @a associated. * * If @a cancel_func is non-null, call it with @a cancel_baton to determine * if the client has cancelled the operation. * * Use @a pool only for local processing, not to allocate @a *adm_access. * * @since New in 1.2. */svn_error_t *svn_wc_adm_probe_try3(svn_wc_adm_access_t **adm_access, svn_wc_adm_access_t *associated, const char *path, svn_boolean_t write_lock, int depth, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool);/** * Similar to svn_wc_adm_probe_try3() without the cancel * functionality. * * @deprecated Provided for backward compatibility with the 1.1 API. */svn_error_t *svn_wc_adm_probe_try2(svn_wc_adm_access_t **adm_access, svn_wc_adm_access_t *associated, const char *path, svn_boolean_t write_lock,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -