Deleted Added
full compact
vli.h (207842) vli.h (213700)
1/**
2 * \file lzma/vli.h
3 * \brief Variable-length integer handling
4 *
5 * In the .xz format, most integers are encoded in a variable-length
6 * representation, which is sometimes called little endian base-128 encoding.
7 * This saves space when smaller values are more likely than bigger values.
8 *

--- 99 unchanged lines hidden (view full) ---

108 *
109 * Multi-call (vli_pos != NULL):
110 * - LZMA_OK: So far all OK, but the integer is not
111 * completely written out yet.
112 * - LZMA_STREAM_END: Integer successfully encoded.
113 * - LZMA_BUF_ERROR: No output space was provided.
114 * - LZMA_PROG_ERROR: Arguments are not sane.
115 */
1/**
2 * \file lzma/vli.h
3 * \brief Variable-length integer handling
4 *
5 * In the .xz format, most integers are encoded in a variable-length
6 * representation, which is sometimes called little endian base-128 encoding.
7 * This saves space when smaller values are more likely than bigger values.
8 *

--- 99 unchanged lines hidden (view full) ---

108 *
109 * Multi-call (vli_pos != NULL):
110 * - LZMA_OK: So far all OK, but the integer is not
111 * completely written out yet.
112 * - LZMA_STREAM_END: Integer successfully encoded.
113 * - LZMA_BUF_ERROR: No output space was provided.
114 * - LZMA_PROG_ERROR: Arguments are not sane.
115 */
116extern LZMA_API(lzma_ret) lzma_vli_encode(lzma_vli vli,
117 size_t *vli_pos, uint8_t *lzma_restrict out,
118 size_t *lzma_restrict out_pos, size_t out_size) lzma_nothrow;
116extern LZMA_API(lzma_ret) lzma_vli_encode(lzma_vli vli, size_t *vli_pos,
117 uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow;
119
120
121/**
122 * \brief Decode a variable-length integer
123 *
124 * Like lzma_vli_encode(), this function has single-call and multi-call modes.
125 *
126 * \param vli Pointer to decoded integer. The decoder will

--- 21 unchanged lines hidden (view full) ---

148 * Multi-call (vli_pos != NULL):
149 * - LZMA_OK: So far all OK, but the integer is not
150 * completely decoded yet.
151 * - LZMA_STREAM_END: Integer successfully decoded.
152 * - LZMA_DATA_ERROR: Integer is corrupt.
153 * - LZMA_BUF_ERROR: No input was provided.
154 * - LZMA_PROG_ERROR: Arguments are not sane.
155 */
118
119
120/**
121 * \brief Decode a variable-length integer
122 *
123 * Like lzma_vli_encode(), this function has single-call and multi-call modes.
124 *
125 * \param vli Pointer to decoded integer. The decoder will

--- 21 unchanged lines hidden (view full) ---

147 * Multi-call (vli_pos != NULL):
148 * - LZMA_OK: So far all OK, but the integer is not
149 * completely decoded yet.
150 * - LZMA_STREAM_END: Integer successfully decoded.
151 * - LZMA_DATA_ERROR: Integer is corrupt.
152 * - LZMA_BUF_ERROR: No input was provided.
153 * - LZMA_PROG_ERROR: Arguments are not sane.
154 */
156extern LZMA_API(lzma_ret) lzma_vli_decode(lzma_vli *lzma_restrict vli,
157 size_t *vli_pos, const uint8_t *lzma_restrict in,
158 size_t *lzma_restrict in_pos, size_t in_size) lzma_nothrow;
155extern LZMA_API(lzma_ret) lzma_vli_decode(lzma_vli *vli, size_t *vli_pos,
156 const uint8_t *in, size_t *in_pos, size_t in_size)
157 lzma_nothrow;
159
160
161/**
162 * \brief Get the number of bytes required to encode a VLI
163 *
164 * \return Number of bytes on success (1-9). If vli isn't valid,
165 * zero is returned.
166 */
167extern LZMA_API(uint32_t) lzma_vli_size(lzma_vli vli)
168 lzma_nothrow lzma_attr_pure;
158
159
160/**
161 * \brief Get the number of bytes required to encode a VLI
162 *
163 * \return Number of bytes on success (1-9). If vli isn't valid,
164 * zero is returned.
165 */
166extern LZMA_API(uint32_t) lzma_vli_size(lzma_vli vli)
167 lzma_nothrow lzma_attr_pure;