Mark many merge tests as skip-against-old-server.
[svn.git] / subversion / libsvn_fs_base / reps-strings.h
blob83bf6815bea4221c56c667b4716ea89bf3244e6d
1 /* reps-strings.h : interpreting representations with respect to strings
3 * ====================================================================
4 * Copyright (c) 2000-2004 CollabNet. All rights reserved.
6 * This software is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at http://subversion.tigris.org/license-1.html.
9 * If newer versions of this license are posted there, you may use a
10 * newer version instead, at your option.
12 * This software consists of voluntary contributions made by many
13 * individuals. For exact contribution history, see the revision
14 * history and logs, available at http://subversion.tigris.org/.
15 * ====================================================================
18 #ifndef SVN_LIBSVN_FS_REPS_STRINGS_H
19 #define SVN_LIBSVN_FS_REPS_STRINGS_H
21 #define APU_WANT_DB
22 #include <apu_want.h>
24 #include "svn_io.h"
25 #include "svn_fs.h"
27 #include "trail.h"
30 #ifdef __cplusplus
31 extern "C" {
32 #endif /* __cplusplus */
36 /* Get or create a mutable representation in FS, store the new rep's
37 key in *NEW_REP_KEY.
39 TXN_ID is the id of the Subversion transaction under which this occurs.
41 If REP_KEY is already a mutable representation, set *NEW_REP_KEY to
42 REP_KEY, else set *NEW_REP_KEY to a brand new rep key allocated in
43 POOL. */
44 svn_error_t *svn_fs_base__get_mutable_rep(const char **new_rep_key,
45 const char *rep_key,
46 svn_fs_t *fs,
47 const char *txn_id,
48 trail_t *trail,
49 apr_pool_t *pool);
52 /* Delete REP_KEY from FS if REP_KEY is mutable, as part of trail, or
53 do nothing if REP_KEY is immutable. If a mutable rep is deleted,
54 the string it refers to is deleted as well. TXN_ID is the id of
55 the Subversion transaction under which this occurs.
57 If no such rep, return SVN_ERR_FS_NO_SUCH_REPRESENTATION. */
58 svn_error_t *svn_fs_base__delete_rep_if_mutable(svn_fs_t *fs,
59 const char *rep_key,
60 const char *txn_id,
61 trail_t *trail,
62 apr_pool_t *pool);
67 /*** Reading and writing rep contents. ***/
69 /* Set *SIZE_P to the size of REP_KEY's contents in FS, as part of TRAIL.
70 Note: this is the fulltext size, no matter how the contents are
71 represented in storage. */
72 svn_error_t *svn_fs_base__rep_contents_size(svn_filesize_t *size_p,
73 svn_fs_t *fs,
74 const char *rep_key,
75 trail_t *trail,
76 apr_pool_t *pool);
79 /* Put into DIGEST the MD5 checksum for REP_KEY in FS, as part of TRAIL.
80 This is the prerecorded checksum for the rep's contents' fulltext.
81 If no checksum is available, do not calculate one dynamically, just
82 put all 0's into DIGEST. (By convention, the all-zero checksum is
83 considered to match any checksum.) */
84 svn_error_t *svn_fs_base__rep_contents_checksum(unsigned char digest[],
85 svn_fs_t *fs,
86 const char *rep_key,
87 trail_t *trail,
88 apr_pool_t *pool);
91 /* Set STR->data to the contents of REP_KEY in FS, and STR->len to the
92 contents' length, as part of TRAIL. The data is allocated in
93 POOL. If an error occurs, the effect on STR->data and
94 STR->len is undefined.
96 Note: this is the fulltext contents, no matter how the contents are
97 represented in storage. */
98 svn_error_t *svn_fs_base__rep_contents(svn_string_t *str,
99 svn_fs_t *fs,
100 const char *rep_key,
101 trail_t *trail,
102 apr_pool_t *pool);
105 /* Set *RS_P to a stream to read the contents of REP_KEY in FS.
106 Allocate the stream in POOL.
108 REP_KEY may be null, in which case reads just return 0 bytes.
110 If USE_TRAIL_FOR_READS is TRUE, the stream's reads are part
111 of TRAIL; otherwise, each read happens in an internal, one-off
112 trail (though TRAIL is still required). POOL may be TRAIL->pool. */
113 svn_error_t *
114 svn_fs_base__rep_contents_read_stream(svn_stream_t **rs_p,
115 svn_fs_t *fs,
116 const char *rep_key,
117 svn_boolean_t use_trail_for_reads,
118 trail_t *trail,
119 apr_pool_t *pool);
122 /* Set *WS_P to a stream to write the contents of REP_KEY. Allocate
123 the stream in POOL. TXN_ID is the id of the Subversion transaction
124 under which this occurs.
126 If USE_TRAIL_FOR_WRITES is TRUE, the stream's writes are part
127 of TRAIL; otherwise, each write happens in an internal, one-off
128 trail (though TRAIL is still required). POOL may be TRAIL->pool.
130 If REP_KEY is not mutable, writes to *WS_P will return the
131 error SVN_ERR_FS_REP_NOT_MUTABLE. */
132 svn_error_t *
133 svn_fs_base__rep_contents_write_stream(svn_stream_t **ws_p,
134 svn_fs_t *fs,
135 const char *rep_key,
136 const char *txn_id,
137 svn_boolean_t use_trail_for_writes,
138 trail_t *trail,
139 apr_pool_t *pool);
143 /*** Deltified storage. ***/
145 /* Offer TARGET the chance to store its contents as a delta against
146 SOURCE, in FS, as part of TRAIL. TARGET and SOURCE are both
147 representation keys.
149 This usually results in TARGET's data being stored as a diff
150 against SOURCE; but it might not, if it turns out to be more
151 efficient to store the contents some other way. */
152 svn_error_t *svn_fs_base__rep_deltify(svn_fs_t *fs,
153 const char *target,
154 const char *source,
155 trail_t *trail,
156 apr_pool_t *pool);
160 #ifdef __cplusplus
162 #endif /* __cplusplus */
164 #endif /* SVN_LIBSVN_FS_REPS_STRINGS_H */