1 /* reps-strings.h : interpreting representations with respect to strings
3 * ====================================================================
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
20 * ====================================================================
23 #ifndef SVN_LIBSVN_FS_REPS_STRINGS_H
24 #define SVN_LIBSVN_FS_REPS_STRINGS_H
27 #include "svn_private_config.h"
37 #endif /* __cplusplus */
41 /* Get or create a mutable representation in FS, and set *NEW_REP_KEY to its
44 TXN_ID is the id of the Subversion transaction under which this occurs.
46 If REP_KEY is not null and is already a mutable representation, set
47 *NEW_REP_KEY to REP_KEY, else create a brand new rep and set *NEW_REP_KEY
48 to its key, allocated in POOL. */
49 svn_error_t *svn_fs_base__get_mutable_rep(const char **new_rep_key,
57 /* Delete REP_KEY from FS if REP_KEY is mutable, as part of trail, or
58 do nothing if REP_KEY is immutable. If a mutable rep is deleted,
59 the string it refers to is deleted as well. TXN_ID is the id of
60 the Subversion transaction under which this occurs.
62 If no such rep, return SVN_ERR_FS_NO_SUCH_REPRESENTATION. */
63 svn_error_t *svn_fs_base__delete_rep_if_mutable(svn_fs_t *fs,
72 /*** Reading and writing rep contents. ***/
74 /* Set *SIZE_P to the size of REP_KEY's contents in FS, as part of TRAIL.
75 Note: this is the fulltext size, no matter how the contents are
76 represented in storage. */
77 svn_error_t *svn_fs_base__rep_contents_size(svn_filesize_t *size_p,
84 /* If MD5_CHECKSUM is non-NULL, set *MD5_CHECKSUM to the MD5 checksum
85 for REP_KEY in FS, as part of TRAIL.
87 If SHA1_CHECKSUM is non-NULL, set *SHA1_CHECKSUM to the SHA1
88 checksum for REP_KEY in FS, as part of TRAIL.
90 These are the prerecorded checksums for the rep's contents'
91 fulltext. If one or both of the checksums is not stored, do not
92 calculate one dynamically, just put NULL into the respective return
93 value. (By convention, the NULL checksum is considered to match
96 svn_fs_base__rep_contents_checksums(svn_checksum_t **md5_checksum,
97 svn_checksum_t **sha1_checksum,
104 /* Set STR->data to the contents of REP_KEY in FS, and STR->len to the
105 contents' length, as part of TRAIL. The data is allocated in
106 POOL. If an error occurs, the effect on STR->data and
107 STR->len is undefined.
109 Note: this is the fulltext contents, no matter how the contents are
110 represented in storage. */
111 svn_error_t *svn_fs_base__rep_contents(svn_string_t *str,
118 /* Set *RS_P to a stream to read the contents of REP_KEY in FS.
119 Allocate the stream in POOL.
121 REP_KEY may be null, in which case reads just return 0 bytes.
123 If USE_TRAIL_FOR_READS is TRUE, the stream's reads are part
124 of TRAIL; otherwise, each read happens in an internal, one-off
125 trail (though TRAIL is still required). POOL may be TRAIL->pool. */
127 svn_fs_base__rep_contents_read_stream(svn_stream_t **rs_p,
130 svn_boolean_t use_trail_for_reads,
135 /* Set *WS_P to a stream to write the contents of REP_KEY. Allocate
136 the stream in POOL. TXN_ID is the id of the Subversion transaction
137 under which this occurs.
139 If USE_TRAIL_FOR_WRITES is TRUE, the stream's writes are part
140 of TRAIL; otherwise, each write happens in an internal, one-off
141 trail (though TRAIL is still required). POOL may be TRAIL->pool.
143 If REP_KEY is not mutable, writes to *WS_P will return the
144 error SVN_ERR_FS_REP_NOT_MUTABLE. */
146 svn_fs_base__rep_contents_write_stream(svn_stream_t **ws_p,
150 svn_boolean_t use_trail_for_writes,
156 /*** Deltified storage. ***/
158 /* Offer TARGET the chance to store its contents as a delta against
159 SOURCE, in FS, as part of TRAIL. TARGET and SOURCE are both
162 This usually results in TARGET's data being stored as a diff
163 against SOURCE; but it might not, if it turns out to be more
164 efficient to store the contents some other way. */
165 svn_error_t *svn_fs_base__rep_deltify(svn_fs_t *fs,
174 #endif /* __cplusplus */
176 #endif /* SVN_LIBSVN_FS_REPS_STRINGS_H */