Commit 7cb016a3 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

param: Introduce the notion of string parameters

Following the model of simple parameters, it is possible to find a home
for string parameters in params.h too. A new PARAM_STRING() macro deals
with the specificities of such parameters.

Since string parameters are typically not inherited by the cache process
they are guarded by a PARAM_ALL macro that defines whether a subset or
the whole list of parameters is processed when params.h is #include'd.

Refs #3250
parent 087329a5
......@@ -39,33 +39,10 @@
struct parspec mgt_parspec[] = {
#define PARAM_ALL
#define PARAM(ty, nm, ...) { #nm, __VA_ARGS__ },
#include "tbl/params.h"
{ "cc_command", tweak_string, &mgt_cc_cmd,
NULL, NULL, VCC_CC,
NULL,
"Command used for compiling the C source code to a "
"dlopen(3) loadable object. Any occurrence of %s in "
"the string will be replaced with the source file name, "
"and %o will be replaced with the output file name.",
MUST_RELOAD,
NULL, NULL, "defined when Varnish is built" },
{ "vcl_path", tweak_string, &mgt_vcl_path,
NULL, NULL, VARNISH_VCL_DIR,
NULL,
"Directory (or colon separated list of directories) "
"from which relative VCL filenames (vcl.load and "
"include) are to be found. By default Varnish searches "
"VCL files in both the system configuration and shared "
"data directories to allow packages to drop their VCL "
"files in a standard location where relative includes "
"would work." },
{ "vmod_path", tweak_string, &mgt_vmod_path,
NULL, NULL, VARNISH_VMOD_DIR,
NULL,
"Directory (or colon separated list of directories) "
"where VMODs are to be found." },
{ "vcc_err_unref", tweak_bool, &mgt_vcc_err_unref,
NULL, NULL, "on",
"bool",
......
......@@ -1260,6 +1260,57 @@ PARAM_SIMPLE(
#undef MEMPOOL_TEXT
#if defined(PARAM_ALL)
/*--------------------------------------------------------------------
* String parameters
*/
# define PARAM_STRING(nm, pv, def, ...) \
PARAM(, nm, tweak_string, pv, NULL, NULL, def, NULL, __VA_ARGS__)
PARAM_STRING(
/* name */ cc_command,
/* priv */ &mgt_cc_cmd,
/* def */ VCC_CC,
/* descr */
"Command used for compiling the C source code to a "
"dlopen(3) loadable object. Any occurrence of %s in "
"the string will be replaced with the source file name, "
"and %o will be replaced with the output file name.",
/* flags */ MUST_RELOAD
)
PARAM_STRING(
/* name */ vcl_path,
/* priv */ &mgt_vcl_path,
/* def */ VARNISH_VCL_DIR,
/* descr */
"Directory (or colon separated list of directories) "
"from which relative VCL filenames (vcl.load and "
"include) are to be found. By default Varnish searches "
"VCL files in both the system configuration and shared "
"data directories to allow packages to drop their VCL "
"files in a standard location where relative includes "
"would work."
)
PARAM_STRING(
/* name */ vmod_path,
/* priv */ &mgt_vmod_path,
/* def */ VARNISH_VMOD_DIR,
/* descr */
"Directory (or colon separated list of directories) "
"where VMODs are to be found."
)
# undef PARAM_ALL
# undef PARAM_STRING
#endif /* defined(PARAM_ALL) */
#undef PARAM_SIMPLE
#undef PARAM
#if 0 /* NOT ACTUALLY DEFINED HERE */
/* actual location mgt_param_bits.c*/
/* see tbl/debug_bits.h */
......@@ -1637,7 +1688,4 @@ PARAM(
)
#endif /* NOT ACTUALLY DEFINED HERE */
#undef PARAM_SIMPLE
#undef PARAM
/*lint -restore */
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