Function
uni_decompress
Decompress text.
Parameters 🔗
| buffer | in | Blob of bytes to decompress. |
| buffer_length | in | Length of |
| text | out | Compressed blob of bytes. |
| text_len | inout | Capacity of |
| text_attr | in | Attributes of the decompressed text (does not need to match the uncompressed encoding). |
Return Value 🔗
| UNI_OK | On success. |
| UNI_NO_SPACE | If |
| UNI_BAD_OPERATION | If |
| UNI_FEATURE_DISABLED | If Unicorn was configured without support for the compression algorithm. |
Discussion 🔗
This function decompresses buffer and writes the result to text. The encoding of text_attr does not need to match the encoding of the original uncompressed text.
The capacity of text is specified by text_len. If text is not null, then the implementation writes to text_len the total number of code units written to text. If the capacity of text is insufficient, then UNI_NO_SPACE is returned.
If text is null and text_len is zero, then the implementation writes to text_len the number of code units in the fully decompressed text and returns UNI_OK. Call the function this way to first compute the total length of the uncompressed text before calling it again with a sufficiently sized buffer.