CLEANUP: cli: move the status print context into its own context
authorWilly Tarreau <w@1wt.eu>
Fri, 6 May 2022 15:16:35 +0000 (17:16 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 6 May 2022 16:33:22 +0000 (18:33 +0200)
commit1c0715b12a8bef3cc0b7666a0a43674afef0f1f1
tree59b0909ff0ff6da0be7bf44c3b94aef34b6272e7
parentaa229ccc4cdd1571c420ead77b96d561bd3904cb
CLEANUP: cli: move the status print context into its own context

Now that the CLI's print context is alone in the appctx, it's possible
to refine the appctx's ctx layout so that the cli part matches exactly
a regular svcctx, and as such move the CLI context into an svcctx like
other applets. External code will still build and work because the
struct cli perfectly maps onto the struct cli_print_ctx that's located
into svc.storage. This is of course only to make a smooth transition
during 2.6 and will disappear immediately after.

A tiny change had to be applied to the opentracing addon which performs
direct accesses to the CLI's err pointer in its own print function. The
rest uses the standard cli_print_* which were the only ones that needed
a small change.

The whole "ctx.cli" struct could be tagged as deprecated so that any
possibly existing external code that relies on it will get build
warnings, and the comments in the struct are pretty clear about the
way to fix it, and the lack of future of this old API.
addons/ot/src/cli.c
include/haproxy/applet-t.h
include/haproxy/cli-t.h
include/haproxy/cli.h
src/cli.c