Emile_Group_Compression(3)

NAME
Emile_Group_Compression - Non destructive general purpose compression functions.

 - Function that allow the compression and expansion of Eina_Binbuf with non destructive algorithm.

SYNOPSIS

  Enumerations
enum Emile_Compressor_Type { EMILE_ZLIB, EMILE_LZ4, EMILE_LZ4HC }
Supported type of compression algorithm.
enum Emile_Compressor_Level { EMILE_COMPRESSOR_DEFAULT = -1, EMILE_COMPRESSOR_NONE = 0, EMILE_COMPRESSOR_FAST = 1, EMILE_COMPRESSOR_BEST = 9 }
Compression level to apply.

  Functions
Eina_Binbuf * emile_compress (const Eina_Binbuf *in, Emile_Compressor_Type t, Emile_Compressor_Level level)
Compress an Eina_Binbuf into a new Eina_Binbuf.
Eina_Binbuf * emile_decompress (const Eina_Binbuf *in, Emile_Compressor_Type t, unsigned int dest_length)
Uncompress a buffer into a newly allocated buffer.
Eina_Bool emile_expand (const Eina_Binbuf *in, Eina_Binbuf *out, Emile_Compressor_Type t)
Uncompress a buffer into an existing buffer.

Detailed Description

Function that allow the compression and expansion of Eina_Binbuf with non destructive algorithm.

Enumeration Type Documentation

  enum Emile_Compressor_Type

Supported type of compression algorithm.

Since
    1.14

See also
    emile_binbuf_compress()

    emile_binbuf_uncompress()

    emile_binbuf_expand()

  enum Emile_Compressor_Level

Compression level to apply.

Since
    1.14

See also
    emile_binbuf_compress();

Function Documentation

  Eina_Binbuf* emile_compress (const Eina_Binbuf * in, Emile_Compressor_Type t, Emile_Compressor_Level level)

Compress an Eina_Binbuf into a new Eina_Binbuf.

Parameters
    in Buffer to compress.
    t Type of compression logic to use.
    level Level of compression to apply.

Returns
    On success it will return a buffer that contains the compressed data, NULL otherwise.

Since
    1.14

References EINA_FALSE.

Referenced by eet_alias(), and eet_write_cipher().

  Eina_Binbuf* emile_decompress (const Eina_Binbuf * in, Emile_Compressor_Type t, unsigned int dest_length)

Uncompress a buffer into a newly allocated buffer.

Parameters
    in Buffer to uncompress.
    t Type of compression logic to use.
    dest_length Expected length of the decompressed data.

Returns
    a newly allocated buffer with the uncompressed data, NULL if it failed.

Since
    1.14

Note
    That if dest_length doesn't match the expanded data, it will just fail and return NULL.

References eina_binbuf_free(), eina_binbuf_manage_new(), EINA_FALSE, and emile_expand().

Referenced by eet_alias_get(), and eet_read_direct().

  Eina_Bool emile_expand (const Eina_Binbuf * in, Eina_Binbuf * out, Emile_Compressor_Type t)

Uncompress a buffer into an existing buffer.

Parameters
    in Buffer to uncompress.
    out Buffer to expand data into.
    t Type of compression logic to use.

Returns
    EINA_TRUE if it succeed, EINA_FALSE if it failed.

Since
    1.14

Note
    The out buffer should have the necessary size to hold the expanded data or it will fail. In case of failure, random garbage could fill the out buffer.

References EINA_FALSE.

Referenced by emile_decompress().

Author

Generated automatically by Doxygen for EFL from the source code.