Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/lzma
File: base.h
/**
[0] Fix | Delete
* \file lzma/base.h
[1] Fix | Delete
* \brief Data types and functions used in many places in liblzma API
[2] Fix | Delete
*/
[3] Fix | Delete
[4] Fix | Delete
/*
[5] Fix | Delete
* Author: Lasse Collin
[6] Fix | Delete
*
[7] Fix | Delete
* This file has been put into the public domain.
[8] Fix | Delete
* You can do whatever you want with this file.
[9] Fix | Delete
*
[10] Fix | Delete
* See ../lzma.h for information about liblzma as a whole.
[11] Fix | Delete
*/
[12] Fix | Delete
[13] Fix | Delete
#ifndef LZMA_H_INTERNAL
[14] Fix | Delete
# error Never include this file directly. Use <lzma.h> instead.
[15] Fix | Delete
#endif
[16] Fix | Delete
[17] Fix | Delete
[18] Fix | Delete
/**
[19] Fix | Delete
* \brief Boolean
[20] Fix | Delete
*
[21] Fix | Delete
* This is here because C89 doesn't have stdbool.h. To set a value for
[22] Fix | Delete
* variables having type lzma_bool, you can use
[23] Fix | Delete
* - C99's `true' and `false' from stdbool.h;
[24] Fix | Delete
* - C++'s internal `true' and `false'; or
[25] Fix | Delete
* - integers one (true) and zero (false).
[26] Fix | Delete
*/
[27] Fix | Delete
typedef unsigned char lzma_bool;
[28] Fix | Delete
[29] Fix | Delete
[30] Fix | Delete
/**
[31] Fix | Delete
* \brief Type of reserved enumeration variable in structures
[32] Fix | Delete
*
[33] Fix | Delete
* To avoid breaking library ABI when new features are added, several
[34] Fix | Delete
* structures contain extra variables that may be used in future. Since
[35] Fix | Delete
* sizeof(enum) can be different than sizeof(int), and sizeof(enum) may
[36] Fix | Delete
* even vary depending on the range of enumeration constants, we specify
[37] Fix | Delete
* a separate type to be used for reserved enumeration variables. All
[38] Fix | Delete
* enumeration constants in liblzma API will be non-negative and less
[39] Fix | Delete
* than 128, which should guarantee that the ABI won't break even when
[40] Fix | Delete
* new constants are added to existing enumerations.
[41] Fix | Delete
*/
[42] Fix | Delete
typedef enum {
[43] Fix | Delete
LZMA_RESERVED_ENUM = 0
[44] Fix | Delete
} lzma_reserved_enum;
[45] Fix | Delete
[46] Fix | Delete
[47] Fix | Delete
/**
[48] Fix | Delete
* \brief Return values used by several functions in liblzma
[49] Fix | Delete
*
[50] Fix | Delete
* Check the descriptions of specific functions to find out which return
[51] Fix | Delete
* values they can return. With some functions the return values may have
[52] Fix | Delete
* more specific meanings than described here; those differences are
[53] Fix | Delete
* described per-function basis.
[54] Fix | Delete
*/
[55] Fix | Delete
typedef enum {
[56] Fix | Delete
LZMA_OK = 0,
[57] Fix | Delete
/**<
[58] Fix | Delete
* \brief Operation completed successfully
[59] Fix | Delete
*/
[60] Fix | Delete
[61] Fix | Delete
LZMA_STREAM_END = 1,
[62] Fix | Delete
/**<
[63] Fix | Delete
* \brief End of stream was reached
[64] Fix | Delete
*
[65] Fix | Delete
* In encoder, LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, or
[66] Fix | Delete
* LZMA_FINISH was finished. In decoder, this indicates
[67] Fix | Delete
* that all the data was successfully decoded.
[68] Fix | Delete
*
[69] Fix | Delete
* In all cases, when LZMA_STREAM_END is returned, the last
[70] Fix | Delete
* output bytes should be picked from strm->next_out.
[71] Fix | Delete
*/
[72] Fix | Delete
[73] Fix | Delete
LZMA_NO_CHECK = 2,
[74] Fix | Delete
/**<
[75] Fix | Delete
* \brief Input stream has no integrity check
[76] Fix | Delete
*
[77] Fix | Delete
* This return value can be returned only if the
[78] Fix | Delete
* LZMA_TELL_NO_CHECK flag was used when initializing
[79] Fix | Delete
* the decoder. LZMA_NO_CHECK is just a warning, and
[80] Fix | Delete
* the decoding can be continued normally.
[81] Fix | Delete
*
[82] Fix | Delete
* It is possible to call lzma_get_check() immediately after
[83] Fix | Delete
* lzma_code has returned LZMA_NO_CHECK. The result will
[84] Fix | Delete
* naturally be LZMA_CHECK_NONE, but the possibility to call
[85] Fix | Delete
* lzma_get_check() may be convenient in some applications.
[86] Fix | Delete
*/
[87] Fix | Delete
[88] Fix | Delete
LZMA_UNSUPPORTED_CHECK = 3,
[89] Fix | Delete
/**<
[90] Fix | Delete
* \brief Cannot calculate the integrity check
[91] Fix | Delete
*
[92] Fix | Delete
* The usage of this return value is different in encoders
[93] Fix | Delete
* and decoders.
[94] Fix | Delete
*
[95] Fix | Delete
* Encoders can return this value only from the initialization
[96] Fix | Delete
* function. If initialization fails with this value, the
[97] Fix | Delete
* encoding cannot be done, because there's no way to produce
[98] Fix | Delete
* output with the correct integrity check.
[99] Fix | Delete
*
[100] Fix | Delete
* Decoders can return this value only from lzma_code() and
[101] Fix | Delete
* only if the LZMA_TELL_UNSUPPORTED_CHECK flag was used when
[102] Fix | Delete
* initializing the decoder. The decoding can still be
[103] Fix | Delete
* continued normally even if the check type is unsupported,
[104] Fix | Delete
* but naturally the check will not be validated, and possible
[105] Fix | Delete
* errors may go undetected.
[106] Fix | Delete
*
[107] Fix | Delete
* With decoder, it is possible to call lzma_get_check()
[108] Fix | Delete
* immediately after lzma_code() has returned
[109] Fix | Delete
* LZMA_UNSUPPORTED_CHECK. This way it is possible to find
[110] Fix | Delete
* out what the unsupported Check ID was.
[111] Fix | Delete
*/
[112] Fix | Delete
[113] Fix | Delete
LZMA_GET_CHECK = 4,
[114] Fix | Delete
/**<
[115] Fix | Delete
* \brief Integrity check type is now available
[116] Fix | Delete
*
[117] Fix | Delete
* This value can be returned only by the lzma_code() function
[118] Fix | Delete
* and only if the decoder was initialized with the
[119] Fix | Delete
* LZMA_TELL_ANY_CHECK flag. LZMA_GET_CHECK tells the
[120] Fix | Delete
* application that it may now call lzma_get_check() to find
[121] Fix | Delete
* out the Check ID. This can be used, for example, to
[122] Fix | Delete
* implement a decoder that accepts only files that have
[123] Fix | Delete
* strong enough integrity check.
[124] Fix | Delete
*/
[125] Fix | Delete
[126] Fix | Delete
LZMA_MEM_ERROR = 5,
[127] Fix | Delete
/**<
[128] Fix | Delete
* \brief Cannot allocate memory
[129] Fix | Delete
*
[130] Fix | Delete
* Memory allocation failed, or the size of the allocation
[131] Fix | Delete
* would be greater than SIZE_MAX.
[132] Fix | Delete
*
[133] Fix | Delete
* Due to internal implementation reasons, the coding cannot
[134] Fix | Delete
* be continued even if more memory were made available after
[135] Fix | Delete
* LZMA_MEM_ERROR.
[136] Fix | Delete
*/
[137] Fix | Delete
[138] Fix | Delete
LZMA_MEMLIMIT_ERROR = 6,
[139] Fix | Delete
/**
[140] Fix | Delete
* \brief Memory usage limit was reached
[141] Fix | Delete
*
[142] Fix | Delete
* Decoder would need more memory than allowed by the
[143] Fix | Delete
* specified memory usage limit. To continue decoding,
[144] Fix | Delete
* the memory usage limit has to be increased with
[145] Fix | Delete
* lzma_memlimit_set().
[146] Fix | Delete
*/
[147] Fix | Delete
[148] Fix | Delete
LZMA_FORMAT_ERROR = 7,
[149] Fix | Delete
/**<
[150] Fix | Delete
* \brief File format not recognized
[151] Fix | Delete
*
[152] Fix | Delete
* The decoder did not recognize the input as supported file
[153] Fix | Delete
* format. This error can occur, for example, when trying to
[154] Fix | Delete
* decode .lzma format file with lzma_stream_decoder,
[155] Fix | Delete
* because lzma_stream_decoder accepts only the .xz format.
[156] Fix | Delete
*/
[157] Fix | Delete
[158] Fix | Delete
LZMA_OPTIONS_ERROR = 8,
[159] Fix | Delete
/**<
[160] Fix | Delete
* \brief Invalid or unsupported options
[161] Fix | Delete
*
[162] Fix | Delete
* Invalid or unsupported options, for example
[163] Fix | Delete
* - unsupported filter(s) or filter options; or
[164] Fix | Delete
* - reserved bits set in headers (decoder only).
[165] Fix | Delete
*
[166] Fix | Delete
* Rebuilding liblzma with more features enabled, or
[167] Fix | Delete
* upgrading to a newer version of liblzma may help.
[168] Fix | Delete
*/
[169] Fix | Delete
[170] Fix | Delete
LZMA_DATA_ERROR = 9,
[171] Fix | Delete
/**<
[172] Fix | Delete
* \brief Data is corrupt
[173] Fix | Delete
*
[174] Fix | Delete
* The usage of this return value is different in encoders
[175] Fix | Delete
* and decoders. In both encoder and decoder, the coding
[176] Fix | Delete
* cannot continue after this error.
[177] Fix | Delete
*
[178] Fix | Delete
* Encoders return this if size limits of the target file
[179] Fix | Delete
* format would be exceeded. These limits are huge, thus
[180] Fix | Delete
* getting this error from an encoder is mostly theoretical.
[181] Fix | Delete
* For example, the maximum compressed and uncompressed
[182] Fix | Delete
* size of a .xz Stream is roughly 8 EiB (2^63 bytes).
[183] Fix | Delete
*
[184] Fix | Delete
* Decoders return this error if the input data is corrupt.
[185] Fix | Delete
* This can mean, for example, invalid CRC32 in headers
[186] Fix | Delete
* or invalid check of uncompressed data.
[187] Fix | Delete
*/
[188] Fix | Delete
[189] Fix | Delete
LZMA_BUF_ERROR = 10,
[190] Fix | Delete
/**<
[191] Fix | Delete
* \brief No progress is possible
[192] Fix | Delete
*
[193] Fix | Delete
* This error code is returned when the coder cannot consume
[194] Fix | Delete
* any new input and produce any new output. The most common
[195] Fix | Delete
* reason for this error is that the input stream being
[196] Fix | Delete
* decoded is truncated or corrupt.
[197] Fix | Delete
*
[198] Fix | Delete
* This error is not fatal. Coding can be continued normally
[199] Fix | Delete
* by providing more input and/or more output space, if
[200] Fix | Delete
* possible.
[201] Fix | Delete
*
[202] Fix | Delete
* Typically the first call to lzma_code() that can do no
[203] Fix | Delete
* progress returns LZMA_OK instead of LZMA_BUF_ERROR. Only
[204] Fix | Delete
* the second consecutive call doing no progress will return
[205] Fix | Delete
* LZMA_BUF_ERROR. This is intentional.
[206] Fix | Delete
*
[207] Fix | Delete
* With zlib, Z_BUF_ERROR may be returned even if the
[208] Fix | Delete
* application is doing nothing wrong, so apps will need
[209] Fix | Delete
* to handle Z_BUF_ERROR specially. The above hack
[210] Fix | Delete
* guarantees that liblzma never returns LZMA_BUF_ERROR
[211] Fix | Delete
* to properly written applications unless the input file
[212] Fix | Delete
* is truncated or corrupt. This should simplify the
[213] Fix | Delete
* applications a little.
[214] Fix | Delete
*/
[215] Fix | Delete
[216] Fix | Delete
LZMA_PROG_ERROR = 11,
[217] Fix | Delete
/**<
[218] Fix | Delete
* \brief Programming error
[219] Fix | Delete
*
[220] Fix | Delete
* This indicates that the arguments given to the function are
[221] Fix | Delete
* invalid or the internal state of the decoder is corrupt.
[222] Fix | Delete
* - Function arguments are invalid or the structures
[223] Fix | Delete
* pointed by the argument pointers are invalid
[224] Fix | Delete
* e.g. if strm->next_out has been set to NULL and
[225] Fix | Delete
* strm->avail_out > 0 when calling lzma_code().
[226] Fix | Delete
* - lzma_* functions have been called in wrong order
[227] Fix | Delete
* e.g. lzma_code() was called right after lzma_end().
[228] Fix | Delete
* - If errors occur randomly, the reason might be flaky
[229] Fix | Delete
* hardware.
[230] Fix | Delete
*
[231] Fix | Delete
* If you think that your code is correct, this error code
[232] Fix | Delete
* can be a sign of a bug in liblzma. See the documentation
[233] Fix | Delete
* how to report bugs.
[234] Fix | Delete
*/
[235] Fix | Delete
} lzma_ret;
[236] Fix | Delete
[237] Fix | Delete
[238] Fix | Delete
/**
[239] Fix | Delete
* \brief The `action' argument for lzma_code()
[240] Fix | Delete
*
[241] Fix | Delete
* After the first use of LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, LZMA_FULL_BARRIER,
[242] Fix | Delete
* or LZMA_FINISH, the same `action' must is used until lzma_code() returns
[243] Fix | Delete
* LZMA_STREAM_END. Also, the amount of input (that is, strm->avail_in) must
[244] Fix | Delete
* not be modified by the application until lzma_code() returns
[245] Fix | Delete
* LZMA_STREAM_END. Changing the `action' or modifying the amount of input
[246] Fix | Delete
* will make lzma_code() return LZMA_PROG_ERROR.
[247] Fix | Delete
*/
[248] Fix | Delete
typedef enum {
[249] Fix | Delete
LZMA_RUN = 0,
[250] Fix | Delete
/**<
[251] Fix | Delete
* \brief Continue coding
[252] Fix | Delete
*
[253] Fix | Delete
* Encoder: Encode as much input as possible. Some internal
[254] Fix | Delete
* buffering will probably be done (depends on the filter
[255] Fix | Delete
* chain in use), which causes latency: the input used won't
[256] Fix | Delete
* usually be decodeable from the output of the same
[257] Fix | Delete
* lzma_code() call.
[258] Fix | Delete
*
[259] Fix | Delete
* Decoder: Decode as much input as possible and produce as
[260] Fix | Delete
* much output as possible.
[261] Fix | Delete
*/
[262] Fix | Delete
[263] Fix | Delete
LZMA_SYNC_FLUSH = 1,
[264] Fix | Delete
/**<
[265] Fix | Delete
* \brief Make all the input available at output
[266] Fix | Delete
*
[267] Fix | Delete
* Normally the encoder introduces some latency.
[268] Fix | Delete
* LZMA_SYNC_FLUSH forces all the buffered data to be
[269] Fix | Delete
* available at output without resetting the internal
[270] Fix | Delete
* state of the encoder. This way it is possible to use
[271] Fix | Delete
* compressed stream for example for communication over
[272] Fix | Delete
* network.
[273] Fix | Delete
*
[274] Fix | Delete
* Only some filters support LZMA_SYNC_FLUSH. Trying to use
[275] Fix | Delete
* LZMA_SYNC_FLUSH with filters that don't support it will
[276] Fix | Delete
* make lzma_code() return LZMA_OPTIONS_ERROR. For example,
[277] Fix | Delete
* LZMA1 doesn't support LZMA_SYNC_FLUSH but LZMA2 does.
[278] Fix | Delete
*
[279] Fix | Delete
* Using LZMA_SYNC_FLUSH very often can dramatically reduce
[280] Fix | Delete
* the compression ratio. With some filters (for example,
[281] Fix | Delete
* LZMA2), fine-tuning the compression options may help
[282] Fix | Delete
* mitigate this problem significantly (for example,
[283] Fix | Delete
* match finder with LZMA2).
[284] Fix | Delete
*
[285] Fix | Delete
* Decoders don't support LZMA_SYNC_FLUSH.
[286] Fix | Delete
*/
[287] Fix | Delete
[288] Fix | Delete
LZMA_FULL_FLUSH = 2,
[289] Fix | Delete
/**<
[290] Fix | Delete
* \brief Finish encoding of the current Block
[291] Fix | Delete
*
[292] Fix | Delete
* All the input data going to the current Block must have
[293] Fix | Delete
* been given to the encoder (the last bytes can still be
[294] Fix | Delete
* pending in *next_in). Call lzma_code() with LZMA_FULL_FLUSH
[295] Fix | Delete
* until it returns LZMA_STREAM_END. Then continue normally
[296] Fix | Delete
* with LZMA_RUN or finish the Stream with LZMA_FINISH.
[297] Fix | Delete
*
[298] Fix | Delete
* This action is currently supported only by Stream encoder
[299] Fix | Delete
* and easy encoder (which uses Stream encoder). If there is
[300] Fix | Delete
* no unfinished Block, no empty Block is created.
[301] Fix | Delete
*/
[302] Fix | Delete
[303] Fix | Delete
LZMA_FULL_BARRIER = 4,
[304] Fix | Delete
/**<
[305] Fix | Delete
* \brief Finish encoding of the current Block
[306] Fix | Delete
*
[307] Fix | Delete
* This is like LZMA_FULL_FLUSH except that this doesn't
[308] Fix | Delete
* necessarily wait until all the input has been made
[309] Fix | Delete
* available via the output buffer. That is, lzma_code()
[310] Fix | Delete
* might return LZMA_STREAM_END as soon as all the input
[311] Fix | Delete
* has been consumed (avail_in == 0).
[312] Fix | Delete
*
[313] Fix | Delete
* LZMA_FULL_BARRIER is useful with a threaded encoder if
[314] Fix | Delete
* one wants to split the .xz Stream into Blocks at specific
[315] Fix | Delete
* offsets but doesn't care if the output isn't flushed
[316] Fix | Delete
* immediately. Using LZMA_FULL_BARRIER allows keeping
[317] Fix | Delete
* the threads busy while LZMA_FULL_FLUSH would make
[318] Fix | Delete
* lzma_code() wait until all the threads have finished
[319] Fix | Delete
* until more data could be passed to the encoder.
[320] Fix | Delete
*
[321] Fix | Delete
* With a lzma_stream initialized with the single-threaded
[322] Fix | Delete
* lzma_stream_encoder() or lzma_easy_encoder(),
[323] Fix | Delete
* LZMA_FULL_BARRIER is an alias for LZMA_FULL_FLUSH.
[324] Fix | Delete
*/
[325] Fix | Delete
[326] Fix | Delete
LZMA_FINISH = 3
[327] Fix | Delete
/**<
[328] Fix | Delete
* \brief Finish the coding operation
[329] Fix | Delete
*
[330] Fix | Delete
* All the input data must have been given to the encoder
[331] Fix | Delete
* (the last bytes can still be pending in next_in).
[332] Fix | Delete
* Call lzma_code() with LZMA_FINISH until it returns
[333] Fix | Delete
* LZMA_STREAM_END. Once LZMA_FINISH has been used,
[334] Fix | Delete
* the amount of input must no longer be changed by
[335] Fix | Delete
* the application.
[336] Fix | Delete
*
[337] Fix | Delete
* When decoding, using LZMA_FINISH is optional unless the
[338] Fix | Delete
* LZMA_CONCATENATED flag was used when the decoder was
[339] Fix | Delete
* initialized. When LZMA_CONCATENATED was not used, the only
[340] Fix | Delete
* effect of LZMA_FINISH is that the amount of input must not
[341] Fix | Delete
* be changed just like in the encoder.
[342] Fix | Delete
*/
[343] Fix | Delete
} lzma_action;
[344] Fix | Delete
[345] Fix | Delete
[346] Fix | Delete
/**
[347] Fix | Delete
* \brief Custom functions for memory handling
[348] Fix | Delete
*
[349] Fix | Delete
* A pointer to lzma_allocator may be passed via lzma_stream structure
[350] Fix | Delete
* to liblzma, and some advanced functions take a pointer to lzma_allocator
[351] Fix | Delete
* as a separate function argument. The library will use the functions
[352] Fix | Delete
* specified in lzma_allocator for memory handling instead of the default
[353] Fix | Delete
* malloc() and free(). C++ users should note that the custom memory
[354] Fix | Delete
* handling functions must not throw exceptions.
[355] Fix | Delete
*
[356] Fix | Delete
* Single-threaded mode only: liblzma doesn't make an internal copy of
[357] Fix | Delete
* lzma_allocator. Thus, it is OK to change these function pointers in
[358] Fix | Delete
* the middle of the coding process, but obviously it must be done
[359] Fix | Delete
* carefully to make sure that the replacement `free' can deallocate
[360] Fix | Delete
* memory allocated by the earlier `alloc' function(s).
[361] Fix | Delete
*
[362] Fix | Delete
* Multithreaded mode: liblzma might internally store pointers to the
[363] Fix | Delete
* lzma_allocator given via the lzma_stream structure. The application
[364] Fix | Delete
* must not change the allocator pointer in lzma_stream or the contents
[365] Fix | Delete
* of the pointed lzma_allocator structure until lzma_end() has been used
[366] Fix | Delete
* to free the memory associated with that lzma_stream. The allocation
[367] Fix | Delete
* functions might be called simultaneously from multiple threads, and
[368] Fix | Delete
* thus they must be thread safe.
[369] Fix | Delete
*/
[370] Fix | Delete
typedef struct {
[371] Fix | Delete
/**
[372] Fix | Delete
* \brief Pointer to a custom memory allocation function
[373] Fix | Delete
*
[374] Fix | Delete
* If you don't want a custom allocator, but still want
[375] Fix | Delete
* custom free(), set this to NULL and liblzma will use
[376] Fix | Delete
* the standard malloc().
[377] Fix | Delete
*
[378] Fix | Delete
* \param opaque lzma_allocator.opaque (see below)
[379] Fix | Delete
* \param nmemb Number of elements like in calloc(). liblzma
[380] Fix | Delete
* will always set nmemb to 1, so it is safe to
[381] Fix | Delete
* ignore nmemb in a custom allocator if you like.
[382] Fix | Delete
* The nmemb argument exists only for
[383] Fix | Delete
* compatibility with zlib and libbzip2.
[384] Fix | Delete
* \param size Size of an element in bytes.
[385] Fix | Delete
* liblzma never sets this to zero.
[386] Fix | Delete
*
[387] Fix | Delete
* \return Pointer to the beginning of a memory block of
[388] Fix | Delete
* `size' bytes, or NULL if allocation fails
[389] Fix | Delete
* for some reason. When allocation fails, functions
[390] Fix | Delete
* of liblzma return LZMA_MEM_ERROR.
[391] Fix | Delete
*
[392] Fix | Delete
* The allocator should not waste time zeroing the allocated buffers.
[393] Fix | Delete
* This is not only about speed, but also memory usage, since the
[394] Fix | Delete
* operating system kernel doesn't necessarily allocate the requested
[395] Fix | Delete
* memory in physical memory until it is actually used. With small
[396] Fix | Delete
* input files, liblzma may actually need only a fraction of the
[397] Fix | Delete
* memory that it requested for allocation.
[398] Fix | Delete
*
[399] Fix | Delete
* \note LZMA_MEM_ERROR is also used when the size of the
[400] Fix | Delete
* allocation would be greater than SIZE_MAX. Thus,
[401] Fix | Delete
* don't assume that the custom allocator must have
[402] Fix | Delete
* returned NULL if some function from liblzma
[403] Fix | Delete
* returns LZMA_MEM_ERROR.
[404] Fix | Delete
*/
[405] Fix | Delete
void *(LZMA_API_CALL *alloc)(void *opaque, size_t nmemb, size_t size);
[406] Fix | Delete
[407] Fix | Delete
/**
[408] Fix | Delete
* \brief Pointer to a custom memory freeing function
[409] Fix | Delete
*
[410] Fix | Delete
* If you don't want a custom freeing function, but still
[411] Fix | Delete
* want a custom allocator, set this to NULL and liblzma
[412] Fix | Delete
* will use the standard free().
[413] Fix | Delete
*
[414] Fix | Delete
* \param opaque lzma_allocator.opaque (see below)
[415] Fix | Delete
* \param ptr Pointer returned by lzma_allocator.alloc(),
[416] Fix | Delete
* or when it is set to NULL, a pointer returned
[417] Fix | Delete
* by the standard malloc().
[418] Fix | Delete
*/
[419] Fix | Delete
void (LZMA_API_CALL *free)(void *opaque, void *ptr);
[420] Fix | Delete
[421] Fix | Delete
/**
[422] Fix | Delete
* \brief Pointer passed to .alloc() and .free()
[423] Fix | Delete
*
[424] Fix | Delete
* opaque is passed as the first argument to lzma_allocator.alloc()
[425] Fix | Delete
* and lzma_allocator.free(). This intended to ease implementing
[426] Fix | Delete
* custom memory allocation functions for use with liblzma.
[427] Fix | Delete
*
[428] Fix | Delete
* If you don't need this, you should set this to NULL.
[429] Fix | Delete
*/
[430] Fix | Delete
void *opaque;
[431] Fix | Delete
[432] Fix | Delete
} lzma_allocator;
[433] Fix | Delete
[434] Fix | Delete
[435] Fix | Delete
/**
[436] Fix | Delete
* \brief Internal data structure
[437] Fix | Delete
*
[438] Fix | Delete
* The contents of this structure is not visible outside the library.
[439] Fix | Delete
*/
[440] Fix | Delete
typedef struct lzma_internal_s lzma_internal;
[441] Fix | Delete
[442] Fix | Delete
[443] Fix | Delete
/**
[444] Fix | Delete
* \brief Passing data to and from liblzma
[445] Fix | Delete
*
[446] Fix | Delete
* The lzma_stream structure is used for
[447] Fix | Delete
* - passing pointers to input and output buffers to liblzma;
[448] Fix | Delete
* - defining custom memory hander functions; and
[449] Fix | Delete
* - holding a pointer to coder-specific internal data structures.
[450] Fix | Delete
*
[451] Fix | Delete
* Typical usage:
[452] Fix | Delete
*
[453] Fix | Delete
* - After allocating lzma_stream (on stack or with malloc()), it must be
[454] Fix | Delete
* initialized to LZMA_STREAM_INIT (see LZMA_STREAM_INIT for details).
[455] Fix | Delete
*
[456] Fix | Delete
* - Initialize a coder to the lzma_stream, for example by using
[457] Fix | Delete
* lzma_easy_encoder() or lzma_auto_decoder(). Some notes:
[458] Fix | Delete
* - In contrast to zlib, strm->next_in and strm->next_out are
[459] Fix | Delete
* ignored by all initialization functions, thus it is safe
[460] Fix | Delete
* to not initialize them yet.
[461] Fix | Delete
* - The initialization functions always set strm->total_in and
[462] Fix | Delete
* strm->total_out to zero.
[463] Fix | Delete
* - If the initialization function fails, no memory is left allocated
[464] Fix | Delete
* that would require freeing with lzma_end() even if some memory was
[465] Fix | Delete
* associated with the lzma_stream structure when the initialization
[466] Fix | Delete
* function was called.
[467] Fix | Delete
*
[468] Fix | Delete
* - Use lzma_code() to do the actual work.
[469] Fix | Delete
*
[470] Fix | Delete
* - Once the coding has been finished, the existing lzma_stream can be
[471] Fix | Delete
* reused. It is OK to reuse lzma_stream with different initialization
[472] Fix | Delete
* function without calling lzma_end() first. Old allocations are
[473] Fix | Delete
* automatically freed.
[474] Fix | Delete
*
[475] Fix | Delete
* - Finally, use lzma_end() to free the allocated memory. lzma_end() never
[476] Fix | Delete
* frees the lzma_stream structure itself.
[477] Fix | Delete
*
[478] Fix | Delete
* Application may modify the values of total_in and total_out as it wants.
[479] Fix | Delete
* They are updated by liblzma to match the amount of data read and
[480] Fix | Delete
* written but aren't used for anything else except as a possible return
[481] Fix | Delete
* values from lzma_get_progress().
[482] Fix | Delete
*/
[483] Fix | Delete
typedef struct {
[484] Fix | Delete
const uint8_t *next_in; /**< Pointer to the next input byte. */
[485] Fix | Delete
size_t avail_in; /**< Number of available input bytes in next_in. */
[486] Fix | Delete
uint64_t total_in; /**< Total number of bytes read by liblzma. */
[487] Fix | Delete
[488] Fix | Delete
uint8_t *next_out; /**< Pointer to the next output position. */
[489] Fix | Delete
size_t avail_out; /**< Amount of free space in next_out. */
[490] Fix | Delete
uint64_t total_out; /**< Total number of bytes written by liblzma. */
[491] Fix | Delete
[492] Fix | Delete
/**
[493] Fix | Delete
* \brief Custom memory allocation functions
[494] Fix | Delete
*
[495] Fix | Delete
* In most cases this is NULL which makes liblzma use
[496] Fix | Delete
* the standard malloc() and free().
[497] Fix | Delete
*
[498] Fix | Delete
* \note In 5.0.x this is not a const pointer.
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function