if (lp_ctx == NULL)
return NULL;
- if (lp_ctx->s3_fns) {
- return lp_ctx->s3_fns->get_parametric(service, type, option, NULL);
- }
-
data = get_parametric_helper(service,
type, option, lp_ctx->globals->param_opt);
struct loadparm_s3_helpers
{
- const char * (*get_parametric)(struct loadparm_service *, const char *type,
- const char *option, const char *def);
struct parm_struct * (*get_parm_struct)(const char *param_name);
void * (*get_parm_ptr)(struct loadparm_service *service, struct parm_struct *parm);
struct loadparm_service * (*get_service)(const char *service_name);
return data->value;
}
-const char *lp_parm_const_string_service(struct loadparm_service *service,
- const char *type, const char *option,
- const char *def)
-{
- struct parmlist_entry *data;
-
- data = get_parametric_helper(service, type, option, Globals.param_opt);
-
- if (data == NULL||data->value==NULL)
- return def;
-
- return data->value;
-}
-
/* Return parametric option from a given service. Type is a part of option before ':' */
/* Parametric option has following syntax: 'Type: option = value' */
static struct loadparm_s3_helpers s3_fns =
{
- .get_parametric = lp_parm_const_string_service,
.get_parm_struct = lp_get_parameter,
.get_parm_ptr = lp_parm_ptr,
.get_service = lp_service_for_s4_ctx,