mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-31 10:31:46 +00:00
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.
This commit is contained in:
parent
d25fc79d72
commit
a2d5872297
@ -93,6 +93,8 @@ struct appctx {
|
||||
struct {
|
||||
const char *msg; /* pointer to a persistent message to be returned in CLI_ST_PRINT state */
|
||||
char *err; /* pointer to a 'must free' message to be returned in CLI_ST_PRINT_FREE state */
|
||||
void *p0, *p1; /* general purpose pointers and integers for registered commands, initialized */
|
||||
int i0, i1; /* to 0 by the CLI before first invocation of the keyword parser. */
|
||||
} cli; /* context used by the CLI */
|
||||
|
||||
/* all entries below are used by various CLI commands, please
|
||||
|
Loading…
Reference in New Issue
Block a user