📄 svn_fs.h
字号:
/** Cleanup the dead transaction in @a fs whose ID is @a txn_id. Use * @a pool for all allocations. If the transaction is not yet dead, * the error @c SVN_ERR_FS_TRANSACTION_NOT_DEAD is returned. (The * caller probably forgot to abort the transaction, or the cleanup * step of that abort failed for some reason.) */svn_error_t *svn_fs_purge_txn(svn_fs_t *fs, const char *txn_id, apr_pool_t *pool);/** Set @a *name_p to the name of the transaction @a txn, as a * null-terminated string. Allocate the name in @a pool. */svn_error_t *svn_fs_txn_name(const char **name_p, svn_fs_txn_t *txn, apr_pool_t *pool);/** Return @a txn's base revision. */svn_revnum_t svn_fs_txn_base_revision(svn_fs_txn_t *txn);/** Open the transaction named @a name in the filesystem @a fs. Set @a *txn * to the transaction. * * If there is no such transaction, @c SVN_ERR_FS_NO_SUCH_TRANSACTION is * the error returned. * * Allocate the new transaction in @a pool; when @a pool is freed, the new * transaction will be closed (neither committed nor aborted). */svn_error_t *svn_fs_open_txn(svn_fs_txn_t **txn, svn_fs_t *fs, const char *name, apr_pool_t *pool);/** Set @a *names_p to an array of <tt>const char *</tt> ids which are the * names of all the currently active transactions in the filesystem @a fs. * Allocate the array in @a pool. */svn_error_t *svn_fs_list_transactions(apr_array_header_t **names_p, svn_fs_t *fs, apr_pool_t *pool);/* Transaction properties *//** Set @a *value_p to the value of the property named @a propname on * transaction @a txn. If @a txn has no property by that name, set * @a *value_p to zero. Allocate the result in @a pool. */svn_error_t *svn_fs_txn_prop(svn_string_t **value_p, svn_fs_txn_t *txn, const char *propname, apr_pool_t *pool);/** Set @a *table_p to the entire property list of transaction @a txn in * filesystem @a fs, as an APR hash table allocated in @a pool. The * resulting table maps property names to pointers to @c svn_string_t * objects containing the property value. */svn_error_t *svn_fs_txn_proplist(apr_hash_t **table_p, svn_fs_txn_t *txn, apr_pool_t *pool);/** Change a transactions @a txn's property's value, or add/delete a * property. @a name is the name of the property to change, and @a value * is the new value of the property, or zero if the property should be * removed altogether. Do any necessary temporary allocation in @a pool. */svn_error_t *svn_fs_change_txn_prop(svn_fs_txn_t *txn, const char *name, const svn_string_t *value, apr_pool_t *pool);/** @} *//** Roots. * * An @c svn_fs_root_t object represents the root directory of some * revision or transaction in a filesystem. To refer to particular * node, you provide a root, and a directory path relative that root. * * @defgroup svn_fs_roots filesystem roots * @{ *//** The Filesystem Root object. */typedef struct svn_fs_root_t svn_fs_root_t;/** Set @a *root_p to the root directory of revision @a rev in filesystem * @a fs. Allocate @a *root_p in @a pool. */svn_error_t *svn_fs_revision_root(svn_fs_root_t **root_p, svn_fs_t *fs, svn_revnum_t rev, apr_pool_t *pool);/** Set @a *root_p to the root directory of @a txn. Allocate @a *root_p in * @a pool. */svn_error_t *svn_fs_txn_root(svn_fs_root_t **root_p, svn_fs_txn_t *txn, apr_pool_t *pool);/** Free the root directory @a root. Simply clearing or destroying the * pool @a root was allocated in will have the same effect as calling * this function. */void svn_fs_close_root(svn_fs_root_t *root);/** Return the filesystem to which @a root belongs. */svn_fs_t *svn_fs_root_fs(svn_fs_root_t *root);/** Return @c TRUE iff @a root is a transaction root. */svn_boolean_t svn_fs_is_txn_root(svn_fs_root_t *root);/** Return @c TRUE iff @a root is a revision root. */svn_boolean_t svn_fs_is_revision_root(svn_fs_root_t *root);/** If @a root is the root of a transaction, return the name of the * transaction, allocated in @a pool; otherwise, return null. */const char *svn_fs_txn_root_name(svn_fs_root_t *root, apr_pool_t *pool);/** If @a root is the root of a revision, return the revision number. * Otherwise, return @c SVN_INVALID_REVNUM. */svn_revnum_t svn_fs_revision_root_revision(svn_fs_root_t *root);/** @} *//** Directory entry names and directory paths. * * Here are the rules for directory entry names, and directory paths: * * A directory entry name is a Unicode string encoded in UTF-8, and * may not contain the null character (U+0000). The name should be in * Unicode canonical decomposition and ordering. No directory entry * may be named '.', '..', or the empty string. Given a directory * entry name which fails to meet these requirements, a filesystem * function returns an SVN_ERR_FS_PATH_SYNTAX error. * * A directory path is a sequence of zero or more directory entry * names, separated by slash characters (U+002f), and possibly ending * with slash characters. Sequences of two or more consecutive slash * characters are treated as if they were a single slash. If a path * ends with a slash, it refers to the same node it would without the * slash, but that node must be a directory, or else the function * returns an SVN_ERR_FS_NOT_DIRECTORY error. * * A path consisting of the empty string, or a string containing only * slashes, refers to the root directory. * * @defgroup svn_fs_directories filesystem directories * @{ *//** The kind of change that occurred on the path. */typedef enum{ /** default value */ svn_fs_path_change_modify = 0, /** path added in txn */ svn_fs_path_change_add, /** path removed in txn */ svn_fs_path_change_delete, /** path removed and re-added in txn */ svn_fs_path_change_replace, /** ignore all previous change items for path (internal-use only) */ svn_fs_path_change_reset} svn_fs_path_change_kind_t;/** Change descriptor. */typedef struct svn_fs_path_change_t{ /** node revision id of changed path */ const svn_fs_id_t *node_rev_id; /** kind of change */ svn_fs_path_change_kind_t change_kind; /** were there text mods? */ svn_boolean_t text_mod; /** were there property mods? */ svn_boolean_t prop_mod;} svn_fs_path_change_t;/** Determine what has changed under a @a root. * * Allocate and return a hash @a *changed_paths_p containing descriptions * of the paths changed under @a root. The hash is keyed with * <tt>const char *</tt> paths, and has @c svn_fs_path_change_t * values. * Use @c pool for all allocations, including the hash and its values. */svn_error_t *svn_fs_paths_changed(apr_hash_t **changed_paths_p, svn_fs_root_t *root, apr_pool_t *pool);/** @} *//* Operations appropriate to all kinds of nodes. *//** Set @a *kind_p to the type of node present at @a path under @a * root. If @a path does not exist under @a root, set @a *kind to @c * svn_node_none. Use @a pool for temporary allocation. */svn_error_t *svn_fs_check_path(svn_node_kind_t *kind_p, svn_fs_root_t *root, const char *path, apr_pool_t *pool);/** An opaque node history object. */typedef struct svn_fs_history_t svn_fs_history_t;/** Set @a *history_p to an opaque node history object which * represents @a path under @a root. @a root must be a revision root. * Use @a pool for all allocations. */svn_error_t *svn_fs_node_history(svn_fs_history_t **history_p, svn_fs_root_t *root, const char *path, apr_pool_t *pool);/** Set @a *prev_history_t to an opaque node history object which * represents the previous (or "next oldest") interesting history * location for the filesystem node represented by @a history, or @c * NULL if no such previous history exists. If @a cross_copies is @c * FALSE, also return @c NULL if stepping backwards in history to @a * prev_history_t would cross a filesystem copy operation. * * @note If this is the first call to svn_fs_history_prev() for the @a * history object, it could return a history object whose location is * the same as the original. This will happen if the original * location was an interesting one (where the node was modified, or * took place in a copy event). This behavior allows looping callers * to avoid the calling svn_fs_history_location() on the object * returned by svn_fs_node_history(), and instead go ahead and begin * calling svn_fs_history_prev(). * * @note This function uses node-id ancestry alone to determine * modifiedness, and therefore does NOT claim that in any of the * returned revisions file contents changed, properties changed, * directory entries lists changed, etc. * * @note The revisions returned for @a path will be older than or * the same age as the revision of that path in @a root. That is, if * @a root is a revision root based on revision X, and @a path was * modified in some revision(s) younger than X, those revisions * younger than X will not be included for @a path. */svn_error_t *svn_fs_history_prev(svn_fs_history_t **prev_history_p, svn_fs_history_t *history, svn_boolean_t cross_copies, apr_pool_t *pool);/** Set @a *path and @a *revision to the path and revision, * respectively, of the @a history object. Use @a pool for all * allocations. */svn_error_t *svn_fs_history_location(const char **path, svn_revnum_t *revision, svn_fs_history_t *history, apr_pool_t *pool); /** Set @a *is_dir to @c TRUE iff @a path in @a root is a directory. * Do any necessary temporary allocation in @a pool. */svn_error_t *svn_fs_is_dir(svn_boolean_t *is_dir, svn_fs_root_t *root, const char *path, apr_pool_t *pool);/** Set @a *is_file to @c TRUE iff @a path in @a root is a file. * Do any necessary temporary allocation in @a pool. */svn_error_t *svn_fs_is_file(svn_boolean_t *is_file, svn_fs_root_t *root, const char *path, apr_pool_t *pool);/** Get the id of a node. * * Set @a *id_p to the node revision ID of @a path in @a root, allocated in * @a pool. * * If @a root is the root of a transaction, keep in mind that other * changes to the transaction can change which node @a path refers to, * and even whether the path exists at all. */svn_error_t *svn_fs_node_id(const svn_fs_id_t **id_p, svn_fs_root_t *root, const char *path, apr_pool_t *pool);/** Set @a *revision to the revision in which @a path under @a root was * created. Use @a pool for any temporary allocations. @a *revision will * be set to @c SVN_INVALID_REVNUM for uncommitted nodes (i.e. modified nodes * under a transaction root). */svn_error_t *svn_fs_node_created_rev(svn_revnum_t *revision, svn_fs_root_t *root,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -