coder.h File Reference

Compresses or uncompresses a file. More...

## Enumerations

enum | operation_mode { MODE_COMPRESS , MODE_DECOMPRESS , MODE_TEST , MODE_LIST }
enum | format_type { FORMAT_AUTO , FORMAT_XZ , FORMAT_LZMA , FORMAT_RAW }

## Functions

void | coder_set_check (lzma_check check)
| Set the integrity check type used when compressing. More...
void | coder_set_preset (uint32_t new_preset)
| Set preset number. More...
void | coder_set_extreme (void)
| Enable extreme mode. More...
void | coder_add_filter (lzma_vli id, void *options)
| Add a filter to the custom filter chain. More...
void | coder_set_compression_settings (void)
void | coder_run (const char *filename)
| Compress or decompress the given file. More...
void | coder_free (void)
| Free the memory allocated for the coder and kill the worker threads. More...

## Variables

enum operation_mode | opt_mode
enum format_type | opt_format
bool | opt_auto_adjust
bool | opt_single_stream
| If true, stop after decoding the first stream. More...
uint64_t | opt_block_size
uint64_t * | opt_block_list

## Detailed Description

Compresses or uncompresses a file.

## Function Documentation

## coder_set_check()

void coder_set_check | ( | lzma_check | check | ) |

Set the integrity check type used when compressing.

References check, and check_default.

## coder_set_preset()

void coder_set_preset | ( | uint32_t | new_preset | ) |

Set preset number.

References LZMA_PRESET_LEVEL_MASK, and preset_number.

## coder_set_extreme()

void coder_set_extreme | ( | void |  | ) |

Enable extreme mode.

References LZMA_PRESET_EXTREME, and preset_number.

## coder_add_filter()

void coder_add_filter | ( | lzma_vli | id,
|  | void * | options
| ) |  |

Add a filter to the custom filter chain.

References filters_count, LZMA_FILTERS_MAX, and message_fatal().

## coder_run()

void coder_run | ( | const char * | filename | ) |

Compress or decompress the given file.

References filename, io_open_src(), message_filename(), and opt_mode.

## coder_free()

void coder_free | ( | void |  | ) |

Free the memory allocated for the coder and kill the worker threads.

References lzma_end(), and strm.

## Variable Documentation

## opt_mode

enum operation_mode opt_mode

extern

Operation mode of the command line tool. This is set in args.c and read in several files.

Referenced by coder_run(), message_filename(), message_mem_needed(), and mytime_get_flush_timeout().

## opt_format

enum format_type opt_format

extern

File format to use when encoding or what format(s) to accept when decoding. This is a global because it's needed also in suffix.c. This is set in args.c.

Referenced by list_file(), and uncompressed_name().

## opt_auto_adjust

bool opt_auto_adjust

extern

If true, the compression settings are automatically adjusted down if they exceed the memory usage limit.

## opt_single_stream

bool opt_single_stream

extern

If true, stop after decoding the first stream.

## opt_block_size

uint64_t opt_block_size

extern

If non-zero, start a new .xz Block after every opt_block_size bytes of input. This has an effect only when compressing to the .xz format.

## opt_block_list

uint64_t* opt_block_list

extern

This is non-NULL if –block-list was used. This contains the Block sizes as an array that is terminated with 0.