*/
struct parm_struct *lpcfg_parm_struct(struct loadparm_context *lp_ctx, const char *name)
{
- int parmnum;
+ int num = lpcfg_map_parameter(name);
- if (lp_ctx->s3_fns) {
- return lp_ctx->s3_fns->get_parm_struct(name);
+ if (num < 0) {
+ return NULL;
}
- parmnum = lpcfg_map_parameter(name);
- if (parmnum == -1) return NULL;
- return &parm_table[parmnum];
+ return &parm_table[num];
}
/**
struct loadparm_s3_helpers
{
- 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);
struct loadparm_service * (*get_default_loadparm_service)(void);
bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue);
bool lp_set_cmdline(const char *pszParmName, const char *pszParmValue);
bool dump_a_parameter(int snum, char *parm_name, FILE * f, bool isGlobal);
-struct parm_struct *lp_get_parameter(const char *param_name);
bool lp_snum_ok(int iService);
void lp_add_one_printer(const char *name, const char *comment,
const char *location, void *pdata);
return result;
}
-/***************************************************************************
- Return info about the requested parameter (given as a string).
- Return NULL when the string is not a valid parameter name.
-***************************************************************************/
-
-struct parm_struct *lp_get_parameter(const char *param_name)
-{
- int num = lpcfg_map_parameter(param_name);
-
- if (num < 0) {
- return NULL;
- }
-
- return &parm_table[num];
-}
-
#if 0
/***************************************************************************
Display the contents of a single copy structure.
static struct loadparm_s3_helpers s3_fns =
{
- .get_parm_struct = lp_get_parameter,
.get_parm_ptr = lp_parm_ptr,
.get_service = lp_service_for_s4_ctx,
.get_servicebynum = lp_servicebynum_for_s4_ctx,