]> git.kaiwu.me - haproxy.git/commit
IMPORT: slz/uslz: support SLZ_FMT_NONE format and force its value to 0
authorAurelien DARRAGON <adarragon@haproxy.com>
Fri, 21 Aug 2026 16:01:40 +0000 (18:01 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Fri, 21 Aug 2026 16:01:40 +0000 (18:01 +0200)
commit50872daa6a857e82afc40b1c5161924aef4172d7
tree15c004d91886c79cae55041cf899d9aad7f63b35
parentc1abbb11fab79d44fb03c9e3044e50fb423e4e0a
IMPORT: slz/uslz: support SLZ_FMT_NONE format and force its value to 0

For library users that rely on SLZ_FMT_* (through uslz_init_fmt()), it is
useful to have a default value that does nothing and can be compared
against, as users will typically store the fmt in a dedicated variable or
within a structure which will be zero-initialized. Having the SLZ_FMT_NONE
alias is also useful to compare a stored fmt value against it to know
whether or not it was set to an other value than the default one.

As a bonus, uslz_init_fmt() also supports the SLZ_FMT_NONE instead of
returning an error, this way, uslz_init_fmt() can be used in place of
uslz_init() even when no compression is needed, which can help write
more generic code for library users where they just need to pass the fmt
value as argument and let the library to its job.

This is libslz upstream commit 4adc28e64716f3db5df9a1edc6eeb9234a37f6ad
include/import/slz.h
src/uslz.c