summaryrefslogtreecommitdiff
path: root/lib/param
diff options
context:
space:
mode:
Diffstat (limited to 'lib/param')
-rw-r--r--lib/param/loadparm.c21
-rw-r--r--lib/param/param.h1
2 files changed, 22 insertions, 0 deletions
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index c130a198df..e2dde453f8 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -2087,6 +2087,27 @@ void *lpcfg_parm_ptr(struct loadparm_context *lp_ctx,
}
/**
+ return the parameter pointer for a parameter
+*/
+bool lpcfg_parm_is_cmdline(struct loadparm_context *lp_ctx, const char *name)
+{
+ int parmnum;
+
+ if (lp_ctx->s3_fns) {
+ struct parm_struct *parm = lp_ctx->s3_fns->get_parm_struct(name);
+ if (parm) {
+ return parm->flags & FLAG_CMDLINE;
+ }
+ return false;
+ }
+
+ parmnum = map_parameter(name);
+ if (parmnum == -1) return false;
+
+ return lp_ctx->flags[parmnum] & FLAG_CMDLINE;
+}
+
+/**
* Find a service by name. Otherwise works like get_service.
*/
diff --git a/lib/param/param.h b/lib/param/param.h
index c54f9cbab6..f6823859d8 100644
--- a/lib/param/param.h
+++ b/lib/param/param.h
@@ -111,6 +111,7 @@ bool lpcfg_add_printer(struct loadparm_context *lp_ctx,
struct parm_struct *lpcfg_parm_struct(struct loadparm_context *lp_ctx, const char *name);
void *lpcfg_parm_ptr(struct loadparm_context *lp_ctx,
struct loadparm_service *service, struct parm_struct *parm);
+bool lpcfg_parm_is_cmdline(struct loadparm_context *lp_ctx, const char *name);
bool lpcfg_file_list_changed(struct loadparm_context *lp_ctx);
bool lpcfg_do_global_parameter(struct loadparm_context *lp_ctx,