git/Documentation/howto
Patrick Steinhardt ce76cec964 git-zlib: use `struct z_stream_s` instead of typedef
Throughout the Git codebase we're using the typedeffed version of
`z_stream`, which maps to `struct z_stream_s`. By using a typedef
instead of the struct it becomes somewhat harder to predeclare the
symbol so that headers depending on the struct can do so without having
to pull in "zlib-compat.h".

We don't yet have users that would really care about this: the only
users that declare `z_stream` as a pointer are in "reftable/block.h",
which is a header that is internal to the reftable library. But in the
next step we're going to expose the `struct reftable_block` publicly,
and that struct does contain a pointer to `z_stream`. And as the public
header shouldn't depend on "reftable/system.h", which is an internal
implementation detail, we won't have the typedef for `z_stream` readily
available.

Prepare for this change by using `struct z_stream_s` throughout our code
base. In case zlib-ng is used we use a define to map from `z_stream_s`
to `zng_stream_s`.

Drop the pre-declaration of `struct z_stream` while at it. This struct
does not exist in the first place, and the declaration wasn't needed
because "reftable/block.h" already includes "reftable/basics.h" which
transitively includes "reftable/system.h" and thus "git-zlib.h".

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-04-07 14:53:11 -07:00
..
coordinate-embargoed-releases.adoc doc: use .adoc extension for AsciiDoc files 2025-01-21 12:56:06 -08:00
howto-index.sh doc: update howto-index.sh for .adoc extensions 2025-03-01 10:00:51 -08:00
keep-canonical-history-correct.adoc doc: use .adoc extension for AsciiDoc files 2025-01-21 12:56:06 -08:00
maintain-git.adoc doc: use .adoc extension for AsciiDoc files 2025-01-21 12:56:06 -08:00
meson.build Merge branch 'pw/build-meson-technical-and-howto-docs' 2025-03-05 10:37:45 -08:00
new-command.adoc howto/new-command: update reference to builtin docs 2025-03-03 13:49:20 -08:00
rebase-from-internal-branch.adoc doc: use .adoc extension for AsciiDoc files 2025-01-21 12:56:06 -08:00
rebuild-from-update-hook.adoc doc: use .adoc extension for AsciiDoc files 2025-01-21 12:56:06 -08:00
recover-corrupted-blob-object.adoc doc: use .adoc extension for AsciiDoc files 2025-01-21 12:56:06 -08:00
recover-corrupted-object-harder.adoc git-zlib: use `struct z_stream_s` instead of typedef 2025-04-07 14:53:11 -07:00
revert-a-faulty-merge.adoc doc: use .adoc extension for AsciiDoc files 2025-01-21 12:56:06 -08:00
revert-branch-rebase.adoc doc: use .adoc extension for AsciiDoc files 2025-01-21 12:56:06 -08:00
separating-topic-branches.adoc doc: use .adoc extension for AsciiDoc files 2025-01-21 12:56:06 -08:00
setup-git-server-over-http.adoc doc: use .adoc extension for AsciiDoc files 2025-01-21 12:56:06 -08:00
update-hook-example.adoc doc: use .adoc extension for AsciiDoc files 2025-01-21 12:56:06 -08:00
use-git-daemon.adoc doc: use .adoc extension for AsciiDoc files 2025-01-21 12:56:06 -08:00
using-merge-subtree.adoc doc: use .adoc extension for AsciiDoc files 2025-01-21 12:56:06 -08:00
using-signed-tag-in-pull-request.adoc doc: use .adoc extension for AsciiDoc files 2025-01-21 12:56:06 -08:00