1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

param: remove lp_get_parameter

Ensure lpcfg_parm_struct, its counterpart is equivalent

Change-Id: I127ce5d3cf7fe02ebf161aa011ec3b41bc32a656
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Garming Sam 2014-07-09 12:25:36 +12:00 committed by Michael Adam
parent 0796dc6fe0
commit 47f10ac65c
5 changed files with 4 additions and 25 deletions

View File

@ -730,15 +730,13 @@ int lpcfg_map_parameter(const char *pszParmName)
*/
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];
}
/**

View File

@ -3,7 +3,6 @@
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);

View File

@ -1042,7 +1042,6 @@ void *lp_local_ptr_by_snum(int snum, struct parm_struct *parm);
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);

View File

@ -2647,22 +2647,6 @@ bool dump_a_parameter(int snum, char *parm_name, FILE * f, bool isGlobal)
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.

View File

@ -58,7 +58,6 @@ static bool lp_load_for_s4_ctx(const char *filename)
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,