~ubuntu-branches/ubuntu/trusty/subversion/trusty-proposed

« back to all changes in this revision

Viewing changes to subversion/include/svn_checksum.h

  • Committer: Package Import Robot
  • Author(s): Andy Whitcroft
  • Date: 2012-06-21 15:36:36 UTC
  • mfrom: (0.4.13 sid)
  • Revision ID: package-import@ubuntu.com-20120621153636-amqqmuidgwgxz1ly
Tags: 1.7.5-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - Create pot file on build.
  - Build a python-subversion-dbg package.
  - Build-depend on python-dbg.
  - Build-depend on default-jre-headless/-jdk.
  - Do not apply java-build patch.
  - debian/rules: Manually create the doxygen output directory, otherwise
    we get weird build failures when running parallel builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
2
 * @copyright
3
3
 * ====================================================================
4
 
 * Copyright (c) 2008 CollabNet.  All rights reserved.
5
 
 *
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.
11
 
 *
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
 
11
 *
 
12
 *      http://www.apache.org/licenses/LICENSE-2.0
 
13
 *
 
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
 
19
 *    under the License.
15
20
 * ====================================================================
16
21
 * @endcopyright
17
22
 *
37
42
 *
38
43
 * @since New in 1.6.
39
44
 */
40
 
typedef enum
 
45
typedef enum svn_checksum_kind_t
41
46
{
42
47
  /** The checksum is (or should be set to) an MD5 checksum. */
43
48
  svn_checksum_md5,
75
80
svn_checksum_create(svn_checksum_kind_t kind,
76
81
                    apr_pool_t *pool);
77
82
 
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.
80
85
 *
81
86
 * @since New in 1.6.
116
121
 
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.
120
126
 *
121
127
 * @since New in 1.6.
 
128
 * @note Passing NULL for @a checksum in 1.6 will cause a segfault.
122
129
 */
123
130
const char *
124
131
svn_checksum_to_cstring(const svn_checksum_t *checksum,
125
132
                        apr_pool_t *pool);
126
133
 
127
134
 
 
135
/** Return a serialized representation of @a checksum, allocated in
 
136
 * @a result_pool. Temporary allocations are performed in @a scratch_pool.
 
137
 *
 
138
 * Note that @a checksum may not be NULL.
 
139
 *
 
140
 * @since New in 1.7.
 
141
 */
 
142
const char *
 
143
svn_checksum_serialize(const svn_checksum_t *checksum,
 
144
                       apr_pool_t *result_pool,
 
145
                       apr_pool_t *scratch_pool);
 
146
 
 
147
 
 
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.
 
151
 *
 
152
 * @since New in 1.7.
 
153
 */
 
154
svn_error_t *
 
155
svn_checksum_deserialize(const svn_checksum_t **checksum,
 
156
                         const char *data,
 
157
                         apr_pool_t *result_pool,
 
158
                         apr_pool_t *scratch_pool);
 
159
 
 
160
 
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.
130
163
 *
208
241
 
209
242
 
210
243
/**
 
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.
 
247
 *
 
248
 * @note This function does not actually check for the mismatch, it just
 
249
 * constructs the error.
 
250
 *
 
251
 * @a scratch_pool is used for temporary allocations; the returned error
 
252
 * will be allocated in its own pool (as is typical).
 
253
 *
 
254
 * @since New in 1.7.
 
255
 */
 
256
svn_error_t *
 
257
svn_checksum_mismatch_err(const svn_checksum_t *expected,
 
258
                          const svn_checksum_t *actual,
 
259
                          apr_pool_t *scratch_pool,
 
260
                          const char *fmt,
 
261
                          ...)
 
262
  __attribute__ ((format(printf, 4, 5)));
 
263
 
 
264
 
 
265
/**
211
266
 * Internal function for creating a checksum from a binary digest.
212
267
 *
213
268
 * @since New in 1.6