2 * svn_fs_node_origins.h: Declarations for APIs of libsvn_fs_util to
3 * be consumed by only fs_* libs; access to the node origin index.
5 * ====================================================================
6 * Copyright (c) 2007 CollabNet. All rights reserved.
8 * This software is licensed as described in the file COPYING, which
9 * you should have received as part of this distribution. The terms
10 * are also available at http://subversion.tigris.org/license-1.html.
11 * If newer versions of this license are posted there, you may use a
12 * newer version instead, at your option.
14 * This software consists of voluntary contributions made by many
15 * individuals. For exact contribution history, see the revision
16 * history and logs, available at http://subversion.tigris.org/.
17 * ====================================================================
20 #ifndef SVN_FS_NODE_ORIGINS_H
21 #define SVN_FS_NODE_ORIGINS_H
25 #endif /* __cplusplus */
27 /* The node origin table is a cache of immutable data to assist
28 * svn_fs_node_origin_rev. Because both FS backends implement
29 * svn_fs_id_t as a structure where objects on the same line of
30 * history have a "Node ID" in common, we can cache responses to
31 * svn_fs_node_origin_rev based on the "Node ID". */
34 /* Update the node origin index for FS based on the hash
35 NODE_ORIGIN_FOR_PATHS, which maps from const char * "Node IDs" to
36 const svn_fs_id_t * node-rev-ids. Returns an error if any cache
37 entry exists with a different value; pre-existing entries with the
38 same value are ignored. Use POOL for any temporary allocations.
40 Because this is just an "optional" cache, this function does not
41 return an error if the underlying storage is readonly; it still
42 returns an error for other error conditions.
45 svn_fs__set_node_origins(svn_fs_t
*fs
,
46 apr_hash_t
*node_origins
,
49 /* Shorthand for calling svn_fs__set_node_origins with just one pair.
52 svn_fs__set_node_origin(svn_fs_t
*fs
,
54 const svn_fs_id_t
*node_rev_id
,
57 /* Set *ORIGIN_ID to the node revision ID from which the history of
58 all nodes in FS whose "Node ID" is NODE_ID springs, as determined
59 by a look in the index. ORIGIN_ID needs to be parsed in an
60 FS-backend-specific way. Use POOL for allocations.
62 If there is no entry for NODE_ID in the cache, return NULL
64 SVN_ERR_FS_NO_SUCH_NODE_ORIGIN. */
66 svn_fs__get_node_origin(const char **origin_id
,
73 #endif /* __cplusplus */
75 #endif /* SVN_FS_NODE_ORIGINS_H */