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 🔗
Decompress buffer and write the result to text. The encoding of text_attr need not 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 otherwise it returns UNI_OK.
If text is NULL, then text_len must be zero and 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 compute the total length of the uncompressed text before calling it again with a sufficiently sized buffer.