3
3
* ====================================================================
4
* Copyright (c) 2008 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/.
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
15
20
* ====================================================================
75
80
svn_checksum_create(svn_checksum_kind_t kind,
78
/** Set @c checksum->digest to all zeros, which, by convention, matches
83
/** Set @a checksum->digest to all zeros, which, by convention, matches
79
84
* all other checksums.
81
86
* @since New in 1.6.
117
122
/** Return the hex representation of @a checksum, allocating the
118
123
* string in @a pool. If @a checksum->digest is all zeros (that is,
119
* 0, not '0'), then return NULL.
124
* 0, not '0') then return NULL. In 1.7+, @a checksum may be NULL
125
* and NULL will be returned in that case.
121
127
* @since New in 1.6.
128
* @note Passing NULL for @a checksum in 1.6 will cause a segfault.
124
131
svn_checksum_to_cstring(const svn_checksum_t *checksum,
125
132
apr_pool_t *pool);
135
/** Return a serialized representation of @a checksum, allocated in
136
* @a result_pool. Temporary allocations are performed in @a scratch_pool.
138
* Note that @a checksum may not be NULL.
143
svn_checksum_serialize(const svn_checksum_t *checksum,
144
apr_pool_t *result_pool,
145
apr_pool_t *scratch_pool);
148
/** Return @a checksum from the serialized format at @a data. The checksum
149
* will be allocated in @a result_pool, with any temporary allocations
150
* performed in @a scratch_pool.
155
svn_checksum_deserialize(const svn_checksum_t **checksum,
157
apr_pool_t *result_pool,
158
apr_pool_t *scratch_pool);
128
161
/** Parse the hex representation @a hex of a checksum of kind @a kind and
129
162
* set @a *checksum to the result, allocating in @a pool.
244
* Return an error of type #SVN_ERR_CHECKSUM_MISMATCH for @a actual and
245
* @a expected checksums which do not match. Use @a fmt, and the following
246
* parameters to populate the error message.
248
* @note This function does not actually check for the mismatch, it just
249
* constructs the error.
251
* @a scratch_pool is used for temporary allocations; the returned error
252
* will be allocated in its own pool (as is typical).
257
svn_checksum_mismatch_err(const svn_checksum_t *expected,
258
const svn_checksum_t *actual,
259
apr_pool_t *scratch_pool,
262
__attribute__ ((format(printf, 4, 5)));
211
266
* Internal function for creating a checksum from a binary digest.
213
268
* @since New in 1.6