Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/lzma
File: vli.h
/**
[0] Fix | Delete
* \file lzma/vli.h
[1] Fix | Delete
* \brief Variable-length integer handling
[2] Fix | Delete
*
[3] Fix | Delete
* In the .xz format, most integers are encoded in a variable-length
[4] Fix | Delete
* representation, which is sometimes called little endian base-128 encoding.
[5] Fix | Delete
* This saves space when smaller values are more likely than bigger values.
[6] Fix | Delete
*
[7] Fix | Delete
* The encoding scheme encodes seven bits to every byte, using minimum
[8] Fix | Delete
* number of bytes required to represent the given value. Encodings that use
[9] Fix | Delete
* non-minimum number of bytes are invalid, thus every integer has exactly
[10] Fix | Delete
* one encoded representation. The maximum number of bits in a VLI is 63,
[11] Fix | Delete
* thus the vli argument must be less than or equal to UINT64_MAX / 2. You
[12] Fix | Delete
* should use LZMA_VLI_MAX for clarity.
[13] Fix | Delete
*/
[14] Fix | Delete
[15] Fix | Delete
/*
[16] Fix | Delete
* Author: Lasse Collin
[17] Fix | Delete
*
[18] Fix | Delete
* This file has been put into the public domain.
[19] Fix | Delete
* You can do whatever you want with this file.
[20] Fix | Delete
*
[21] Fix | Delete
* See ../lzma.h for information about liblzma as a whole.
[22] Fix | Delete
*/
[23] Fix | Delete
[24] Fix | Delete
#ifndef LZMA_H_INTERNAL
[25] Fix | Delete
# error Never include this file directly. Use <lzma.h> instead.
[26] Fix | Delete
#endif
[27] Fix | Delete
[28] Fix | Delete
[29] Fix | Delete
/**
[30] Fix | Delete
* \brief Maximum supported value of a variable-length integer
[31] Fix | Delete
*/
[32] Fix | Delete
#define LZMA_VLI_MAX (UINT64_MAX / 2)
[33] Fix | Delete
[34] Fix | Delete
/**
[35] Fix | Delete
* \brief VLI value to denote that the value is unknown
[36] Fix | Delete
*/
[37] Fix | Delete
#define LZMA_VLI_UNKNOWN UINT64_MAX
[38] Fix | Delete
[39] Fix | Delete
/**
[40] Fix | Delete
* \brief Maximum supported encoded length of variable length integers
[41] Fix | Delete
*/
[42] Fix | Delete
#define LZMA_VLI_BYTES_MAX 9
[43] Fix | Delete
[44] Fix | Delete
/**
[45] Fix | Delete
* \brief VLI constant suffix
[46] Fix | Delete
*/
[47] Fix | Delete
#define LZMA_VLI_C(n) UINT64_C(n)
[48] Fix | Delete
[49] Fix | Delete
[50] Fix | Delete
/**
[51] Fix | Delete
* \brief Variable-length integer type
[52] Fix | Delete
*
[53] Fix | Delete
* Valid VLI values are in the range [0, LZMA_VLI_MAX]. Unknown value is
[54] Fix | Delete
* indicated with LZMA_VLI_UNKNOWN, which is the maximum value of the
[55] Fix | Delete
* underlaying integer type.
[56] Fix | Delete
*
[57] Fix | Delete
* lzma_vli will be uint64_t for the foreseeable future. If a bigger size
[58] Fix | Delete
* is needed in the future, it is guaranteed that 2 * LZMA_VLI_MAX will
[59] Fix | Delete
* not overflow lzma_vli. This simplifies integer overflow detection.
[60] Fix | Delete
*/
[61] Fix | Delete
typedef uint64_t lzma_vli;
[62] Fix | Delete
[63] Fix | Delete
[64] Fix | Delete
/**
[65] Fix | Delete
* \brief Validate a variable-length integer
[66] Fix | Delete
*
[67] Fix | Delete
* This is useful to test that application has given acceptable values
[68] Fix | Delete
* for example in the uncompressed_size and compressed_size variables.
[69] Fix | Delete
*
[70] Fix | Delete
* \return True if the integer is representable as VLI or if it
[71] Fix | Delete
* indicates unknown value.
[72] Fix | Delete
*/
[73] Fix | Delete
#define lzma_vli_is_valid(vli) \
[74] Fix | Delete
((vli) <= LZMA_VLI_MAX || (vli) == LZMA_VLI_UNKNOWN)
[75] Fix | Delete
[76] Fix | Delete
[77] Fix | Delete
/**
[78] Fix | Delete
* \brief Encode a variable-length integer
[79] Fix | Delete
*
[80] Fix | Delete
* This function has two modes: single-call and multi-call. Single-call mode
[81] Fix | Delete
* encodes the whole integer at once; it is an error if the output buffer is
[82] Fix | Delete
* too small. Multi-call mode saves the position in *vli_pos, and thus it is
[83] Fix | Delete
* possible to continue encoding if the buffer becomes full before the whole
[84] Fix | Delete
* integer has been encoded.
[85] Fix | Delete
*
[86] Fix | Delete
* \param vli Integer to be encoded
[87] Fix | Delete
* \param vli_pos How many VLI-encoded bytes have already been written
[88] Fix | Delete
* out. When starting to encode a new integer in
[89] Fix | Delete
* multi-call mode, *vli_pos must be set to zero.
[90] Fix | Delete
* To use single-call encoding, set vli_pos to NULL.
[91] Fix | Delete
* \param out Beginning of the output buffer
[92] Fix | Delete
* \param out_pos The next byte will be written to out[*out_pos].
[93] Fix | Delete
* \param out_size Size of the out buffer; the first byte into
[94] Fix | Delete
* which no data is written to is out[out_size].
[95] Fix | Delete
*
[96] Fix | Delete
* \return Slightly different return values are used in multi-call and
[97] Fix | Delete
* single-call modes.
[98] Fix | Delete
*
[99] Fix | Delete
* Single-call (vli_pos == NULL):
[100] Fix | Delete
* - LZMA_OK: Integer successfully encoded.
[101] Fix | Delete
* - LZMA_PROG_ERROR: Arguments are not sane. This can be due
[102] Fix | Delete
* to too little output space; single-call mode doesn't use
[103] Fix | Delete
* LZMA_BUF_ERROR, since the application should have checked
[104] Fix | Delete
* the encoded size with lzma_vli_size().
[105] Fix | Delete
*
[106] Fix | Delete
* Multi-call (vli_pos != NULL):
[107] Fix | Delete
* - LZMA_OK: So far all OK, but the integer is not
[108] Fix | Delete
* completely written out yet.
[109] Fix | Delete
* - LZMA_STREAM_END: Integer successfully encoded.
[110] Fix | Delete
* - LZMA_BUF_ERROR: No output space was provided.
[111] Fix | Delete
* - LZMA_PROG_ERROR: Arguments are not sane.
[112] Fix | Delete
*/
[113] Fix | Delete
extern LZMA_API(lzma_ret) lzma_vli_encode(lzma_vli vli, size_t *vli_pos,
[114] Fix | Delete
uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow;
[115] Fix | Delete
[116] Fix | Delete
[117] Fix | Delete
/**
[118] Fix | Delete
* \brief Decode a variable-length integer
[119] Fix | Delete
*
[120] Fix | Delete
* Like lzma_vli_encode(), this function has single-call and multi-call modes.
[121] Fix | Delete
*
[122] Fix | Delete
* \param vli Pointer to decoded integer. The decoder will
[123] Fix | Delete
* initialize it to zero when *vli_pos == 0, so
[124] Fix | Delete
* application isn't required to initialize *vli.
[125] Fix | Delete
* \param vli_pos How many bytes have already been decoded. When
[126] Fix | Delete
* starting to decode a new integer in multi-call
[127] Fix | Delete
* mode, *vli_pos must be initialized to zero. To
[128] Fix | Delete
* use single-call decoding, set vli_pos to NULL.
[129] Fix | Delete
* \param in Beginning of the input buffer
[130] Fix | Delete
* \param in_pos The next byte will be read from in[*in_pos].
[131] Fix | Delete
* \param in_size Size of the input buffer; the first byte that
[132] Fix | Delete
* won't be read is in[in_size].
[133] Fix | Delete
*
[134] Fix | Delete
* \return Slightly different return values are used in multi-call and
[135] Fix | Delete
* single-call modes.
[136] Fix | Delete
*
[137] Fix | Delete
* Single-call (vli_pos == NULL):
[138] Fix | Delete
* - LZMA_OK: Integer successfully decoded.
[139] Fix | Delete
* - LZMA_DATA_ERROR: Integer is corrupt. This includes hitting
[140] Fix | Delete
* the end of the input buffer before the whole integer was
[141] Fix | Delete
* decoded; providing no input at all will use LZMA_DATA_ERROR.
[142] Fix | Delete
* - LZMA_PROG_ERROR: Arguments are not sane.
[143] Fix | Delete
*
[144] Fix | Delete
* Multi-call (vli_pos != NULL):
[145] Fix | Delete
* - LZMA_OK: So far all OK, but the integer is not
[146] Fix | Delete
* completely decoded yet.
[147] Fix | Delete
* - LZMA_STREAM_END: Integer successfully decoded.
[148] Fix | Delete
* - LZMA_DATA_ERROR: Integer is corrupt.
[149] Fix | Delete
* - LZMA_BUF_ERROR: No input was provided.
[150] Fix | Delete
* - LZMA_PROG_ERROR: Arguments are not sane.
[151] Fix | Delete
*/
[152] Fix | Delete
extern LZMA_API(lzma_ret) lzma_vli_decode(lzma_vli *vli, size_t *vli_pos,
[153] Fix | Delete
const uint8_t *in, size_t *in_pos, size_t in_size)
[154] Fix | Delete
lzma_nothrow;
[155] Fix | Delete
[156] Fix | Delete
[157] Fix | Delete
/**
[158] Fix | Delete
* \brief Get the number of bytes required to encode a VLI
[159] Fix | Delete
*
[160] Fix | Delete
* \return Number of bytes on success (1-9). If vli isn't valid,
[161] Fix | Delete
* zero is returned.
[162] Fix | Delete
*/
[163] Fix | Delete
extern LZMA_API(uint32_t) lzma_vli_size(lzma_vli vli)
[164] Fix | Delete
lzma_nothrow lzma_attr_pure;
[165] Fix | Delete
[166] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function