param: move lp_set_enum_parm to lib/param
authorGarming Sam <garming@catalyst.net.nz>
Fri, 21 Feb 2014 02:40:43 +0000 (15:40 +1300)
committerJeremy Allison <jra@samba.org>
Wed, 7 May 2014 17:49:16 +0000 (19:49 +0200)
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/param/loadparm.c
source3/param/loadparm.c

index 614b191c029988c8874d1b82d86ce24bf94381b4..06a8f02b620e4f26dddac8c8c6aebb7b0011737a 100644 (file)
@@ -400,7 +400,6 @@ bool lp_bool(const char *s)
        return ret;
 }
 
-
 /**
  * Return parametric option from a given service. Type is a part of option before ':'
  * Parametric option has following syntax: 'Type: option = value'
@@ -1063,6 +1062,26 @@ bool lpcfg_file_list_changed(struct loadparm_context *lp_ctx)
        return false;
 }
 
+/*
+ * set the value for a P_ENUM
+ */
+bool lp_set_enum_parm( struct parm_struct *parm, const char *pszParmValue,
+                              int *ptr )
+{
+       int i;
+
+       for (i = 0; parm->enum_list[i].name; i++) {
+               if ( strequal(pszParmValue, parm->enum_list[i].name)) {
+                       *ptr = parm->enum_list[i].value;
+                       return true;
+               }
+       }
+       DEBUG(0, ("WARNING: Ignoring invalid value '%s' for parameter '%s'\n",
+                 pszParmValue, parm->label));
+       return false;
+}
+
+
 /***************************************************************************
  Handle the "realm" parameter
 ***************************************************************************/
index ad485c989ecf493c6c4072b19737773ed9160f14..c534ef66226892563b3abbe9091d6859a1c6c132 100644 (file)
@@ -2633,26 +2633,6 @@ const char *lp_ldap_idmap_suffix(TALLOC_CTX *ctx)
        return lp_string(ctx, Globals.ldap_suffix);
 }
 
-/****************************************************************************
- set the value for a P_ENUM
- ***************************************************************************/
-
-static bool lp_set_enum_parm( struct parm_struct *parm, const char *pszParmValue,
-                              int *ptr )
-{
-       int i;
-
-       for (i = 0; parm->enum_list[i].name; i++) {
-               if ( strequal(pszParmValue, parm->enum_list[i].name)) {
-                       *ptr = parm->enum_list[i].value;
-                       return true;
-               }
-       }
-       DEBUG(0, ("WARNING: Ignoring invalid value '%s' for parameter '%s'\n",
-                 pszParmValue, parm->label));
-       return false;
-}
-
 /***************************************************************************
 ***************************************************************************/