~ubuntu-branches/ubuntu/natty/xz-utils/natty

« back to all changes in this revision

Viewing changes to src/liblzma/api/lzma/check.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Nieder
  • Date: 2009-11-01 00:22:04 UTC
  • mfrom: (1.1.1 upstream) (0.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20091101002204-5buej0pj86dyz053
Tags: 4.999.9beta+20091016-1
* New upstream snapshot, taken from upstream commit 78e92c1.
* Drop xzmore.1 patch, applied upstream.
* debian/rules: Disable assembler optimizations on hurd. (Closes: #553331)
* debian/control: Clarify binary package descriptions.  Thanks to
  Justin B Rye and Ben Finney for the text.
* debian/rules get-orig-source: Use commit date (instead of last patch
  date) to name snapshots.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
2
 * \file        lzma/check.h
3
3
 * \brief       Integrity checks
4
 
 *
5
 
 * \author      Copyright (C) 1999-2006 Igor Pavlov
6
 
 * \author      Copyright (C) 2007 Lasse Collin
7
 
 *
8
 
 * This library is free software; you can redistribute it and/or
9
 
 * modify it under the terms of the GNU Lesser General Public
10
 
 * License as published by the Free Software Foundation; either
11
 
 * version 2.1 of the License, or (at your option) any later version.
12
 
 *
13
 
 * This library is distributed in the hope that it will be useful,
14
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
 
 * Lesser General Public License for more details.
 
4
 */
 
5
 
 
6
/*
 
7
 * Author: Lasse Collin
 
8
 *
 
9
 * This file has been put into the public domain.
 
10
 * You can do whatever you want with this file.
 
11
 *
 
12
 * See ../lzma.h for information about liblzma as a whole.
17
13
 */
18
14
 
19
15
#ifndef LZMA_H_INTERNAL
25
21
 * \brief       Type of the integrity check (Check ID)
26
22
 *
27
23
 * The .xz format supports multiple types of checks that are calculated
28
 
 * from the uncompressed data. They very in both speed and ability to
 
24
 * from the uncompressed data. They vary in both speed and ability to
29
25
 * detect errors.
30
26
 */
31
27
typedef enum {
75
71
/**
76
72
 * \brief       Test if the given Check ID is supported
77
73
 *
78
 
 * Returns true if the given Check ID is supported by this liblzma build.
 
74
 * Return true if the given Check ID is supported by this liblzma build.
79
75
 * Otherwise false is returned. It is safe to call this with a value that
80
76
 * is not in the range [0, 15]; in that case the return value is always false.
81
77
 *
83
79
 * supported (even if liblzma is built with limited features).
84
80
 */
85
81
extern LZMA_API(lzma_bool) lzma_check_is_supported(lzma_check check)
86
 
                lzma_attr_const;
 
82
                lzma_nothrow lzma_attr_const;
87
83
 
88
84
 
89
85
/**
96
92
 *
97
93
 * If the argument is not in the range [0, 15], UINT32_MAX is returned.
98
94
 */
99
 
extern LZMA_API(uint32_t) lzma_check_size(lzma_check check) lzma_attr_const;
 
95
extern LZMA_API(uint32_t) lzma_check_size(lzma_check check)
 
96
                lzma_nothrow lzma_attr_const;
100
97
 
101
98
 
102
99
/**
108
105
/**
109
106
 * \brief       Calculate CRC32
110
107
 *
111
 
 * Calculates CRC32 using the polynomial from the IEEE 802.3 standard.
 
108
 * Calculate CRC32 using the polynomial from the IEEE 802.3 standard.
112
109
 *
113
110
 * \param       buf     Pointer to the input buffer
114
111
 * \param       size    Size of the input buffer
115
112
 * \param       crc     Previously returned CRC value. This is used to
116
113
 *                      calculate the CRC of a big buffer in smaller chunks.
117
 
 *                      Set to zero when there is no previous value.
 
114
 *                      Set to zero when starting a new calculation.
118
115
 *
119
116
 * \return      Updated CRC value, which can be passed to this function
120
117
 *              again to continue CRC calculation.
121
118
 */
122
119
extern LZMA_API(uint32_t) lzma_crc32(
123
120
                const uint8_t *buf, size_t size, uint32_t crc)
124
 
                lzma_attr_pure;
 
121
                lzma_nothrow lzma_attr_pure;
125
122
 
126
123
 
127
124
/**
128
125
 * \brief       Calculate CRC64
129
126
 *
130
 
 * Calculates CRC64 using the polynomial from the ECMA-182 standard.
 
127
 * Calculate CRC64 using the polynomial from the ECMA-182 standard.
131
128
 *
132
129
 * This function is used similarly to lzma_crc32(). See its documentation.
133
130
 */
134
131
extern LZMA_API(uint64_t) lzma_crc64(
135
132
                const uint8_t *buf, size_t size, uint64_t crc)
136
 
                lzma_attr_pure;
 
133
                lzma_nothrow lzma_attr_pure;
137
134
 
138
135
 
139
136
/*
149
146
 * returned LZMA_NO_CHECK, LZMA_UNSUPPORTED_CHECK, or LZMA_GET_CHECK.
150
147
 * Calling this function in any other situation has undefined behavior.
151
148
 */
152
 
extern LZMA_API(lzma_check) lzma_get_check(const lzma_stream *strm);
 
149
extern LZMA_API(lzma_check) lzma_get_check(const lzma_stream *strm)
 
150
                lzma_nothrow;