svn commit: samba r23532 - in branches/SAMBA_4_0/source/param: .

tridge at samba.org tridge at samba.org
Sun Jun 17 20:02:56 GMT 2007


Author: tridge
Date: 2007-06-17 20:02:56 +0000 (Sun, 17 Jun 2007)
New Revision: 23532

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23532

Log:

added lp_parm_double()

Modified:
   branches/SAMBA_4_0/source/param/loadparm.c


Changeset:
Modified: branches/SAMBA_4_0/source/param/loadparm.c
===================================================================
--- branches/SAMBA_4_0/source/param/loadparm.c	2007-06-17 19:35:00 UTC (rev 23531)
+++ branches/SAMBA_4_0/source/param/loadparm.c	2007-06-17 20:02:56 UTC (rev 23532)
@@ -1017,6 +1017,20 @@
 }
 
 /*******************************************************************
+convenience routine to return unsigned long parameters.
+********************************************************************/
+static double lp_double(const char *s)
+{
+
+	if (!s) {
+		DEBUG(0,("lp_double(%s): is called with NULL!\n",s));
+		return (-1);
+	}
+
+	return strtod(s, NULL);
+}
+
+/*******************************************************************
 convenience routine to return boolean parameters.
 ********************************************************************/
 static BOOL lp_bool(const char *s)
@@ -1112,6 +1126,17 @@
 	return default_v;
 }
 
+
+double lp_parm_double(int lookup_service, const char *type, const char *option, double default_v)
+{
+	const char *value = lp_get_parametric(lookup_service, type, option);
+	
+	if (value)
+		return lp_double(value);
+
+	return default_v;
+}
+
 /* Return parametric option from a given service. Type is a part of option before ':' */
 /* Parametric option has following syntax: 'Type: option = value' */
 



More information about the samba-cvs mailing list