Commit a093bd64 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

param: Fold mgt_param_tbl.c into mgt_param.c

parent c6ee37a5
......@@ -87,7 +87,6 @@ varnishd_SOURCES = \
mgt/mgt_main.c \
mgt/mgt_param.c \
mgt/mgt_param_bits.c \
mgt/mgt_param_tbl.c \
mgt/mgt_param_tcp.c \
mgt/mgt_param_tweak.c \
mgt/mgt_shmem.c \
......
......@@ -191,7 +191,6 @@ void MCF_ParamConf(enum mcf_which_e, const char *param, const char *, ...)
void MCF_ParamSet(struct cli *, const char *param, const char *val);
void MCF_ParamProtect(struct cli *, const char *arg);
void MCF_DumpRstParam(void);
void MCF_AddParams(struct parspec *ps);
extern struct params mgt_param;
/* mgt_shmem.c */
......
......@@ -610,16 +610,25 @@ mcf_param_reset(struct cli *cli, const char * const *av, void *priv)
}
/*--------------------------------------------------------------------
* Add a group of parameters to the global set and sort by name.
* Initialize parameters and sort by name.
*/
void
MCF_AddParams(struct parspec *ps)
static struct parspec mgt_parspec[] = {
#define PARAM_ALL
#define PARAM_PRE {
#define PARAM(typ, fld, nm, ...) #nm, __VA_ARGS__
#define PARAM_POST },
#include "tbl/params.h"
{ NULL, NULL, NULL }
};
static void
mcf_init_params(void)
{
struct parspec *pp;
const char *s;
for (pp = ps; pp->name != NULL; pp++) {
for (pp = mgt_parspec; pp->name != NULL; pp++) {
AN(pp->func);
s = strchr(pp->descr, '\0');
if (isspace(s[-1])) {
......@@ -720,9 +729,7 @@ MCF_InitParams(struct cli *cli)
struct vsb *vsb;
ssize_t def, low;
MCF_AddParams(mgt_parspec);
MCF_AddParams(VSL_parspec);
mcf_init_params();
MCF_TcpParams();
def = 80 * 1024;
......
......@@ -87,7 +87,3 @@ tweak_t tweak_uint;
tweak_t tweak_vsl_buffer;
tweak_t tweak_vsl_mask;
tweak_t tweak_vsl_reclen;
extern struct parspec mgt_parspec[]; /* mgt_param_tbl.c */
extern struct parspec VSL_parspec[]; /* mgt_param_vsl.c */
extern struct parspec WRK_parspec[]; /* mgt_pool.c */
......@@ -215,11 +215,3 @@ tweak_feature(struct vsb *vsb, const struct parspec *par, const char *arg)
return (tweak_generic_bits(vsb, par, arg, mgt_param.feature_bits,
FEATURE_Reserved, feature_tags, "feature bit", '+'));
}
/*--------------------------------------------------------------------
* The parameter table itself
*/
struct parspec VSL_parspec[] = {
{ NULL, NULL, NULL }
};
/*-
* Copyright (c) 2006 Verdens Gang AS
* Copyright (c) 2006-2015 Varnish Software AS
* All rights reserved.
*
* Author: Poul-Henning Kamp <phk@phk.freebsd.dk>
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include "config.h"
#include <stdio.h>
#include "mgt/mgt.h"
#include "mgt/mgt_param.h"
struct parspec mgt_parspec[] = {
#define PARAM_ALL
#define PARAM_PRE {
#define PARAM(typ, fld, nm, ...) #nm, __VA_ARGS__
#define PARAM_POST },
#include "tbl/params.h"
{ NULL, NULL, NULL }
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment