]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: cli: add two general purpose pointers and integers in the CLI struct
authorWilly Tarreau <w@1wt.eu>
Fri, 16 Dec 2016 11:37:03 +0000 (12:37 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 16 Dec 2016 18:40:13 +0000 (19:40 +0100)
commita2d58722976c365a1beb2ef01c977f3cd15b4fb4
tree04af3d4045b3ed36ddb05fddbc46b6ea49a3e4d6
parentd25fc79d72ad5fa33217cc2f1c232647d456b60c
MINOR: cli: add two general purpose pointers and integers in the CLI struct

Most of the keywords don't need to have their own entry in the appctx
union, they just need to reuse some generic pointers like we've been
used to do in the appctx with st{0,1,2}. This patch adds p0, p1, i0, i1
and initializes them to zero before calling the parser. This way some
of the simplest existing keywords will be able to disappear from the
union.

It's worth noting that this is an extension to what was initially
attempted via the "private" member that I removed a few patches ago by
not understanding how it was supposed to be used. Here the fact that
we share the same union will force us to be stricter: the code either
uses the general purpose variables or it uses its own fields but not
both.
include/types/applet.h
src/cli.c