1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

Move param helper routines to one place.

Guenther
(This used to be commit 6bf2c8038c)
This commit is contained in:
Günther Deschner 2007-11-30 18:47:25 +01:00 committed by Volker Lendecke
parent c224118ffe
commit 4b9f336a62
4 changed files with 51 additions and 46 deletions

View File

@ -318,7 +318,7 @@ READLINE_OBJ = lib/readline.o
# Be sure to include them into your application
POPT_LIB_OBJ = lib/popt_common.o
PARAM_WITHOUT_REG_OBJ = dynconfig.o param/loadparm.o param/params.o lib/sharesec.o
PARAM_WITHOUT_REG_OBJ = dynconfig.o param/loadparm.o param/params.o param/util.o lib/sharesec.o
PARAM_REG_ADD_OBJ = $(UTIL_REG_API_OBJ)
PARAM_OBJ = $(PARAM_WITHOUT_REG_OBJ) $(PARAM_REG_ADD_OBJ)

50
source3/param/util.c Normal file
View File

@ -0,0 +1,50 @@
/*
* Unix SMB/CIFS implementation.
* param helper routines
* Copyright (C) Gerald Carter 2003
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
/*********************************************************
utility function to parse an integer parameter from
"parameter = value"
**********************************************************/
uint32 get_int_param( const char* param )
{
char *p;
p = strchr( param, '=' );
if ( !p )
return 0;
return atoi(p+1);
}
/*********************************************************
utility function to parse an integer parameter from
"parameter = value"
**********************************************************/
char* get_string_param( const char* param )
{
char *p;
p = strchr( param, '=' );
if ( !p )
return NULL;
return (p+1);
}

View File

@ -1429,20 +1429,6 @@ static NTSTATUS net_update_dns(TALLOC_CTX *mem_ctx, ADS_STRUCT *ads)
#endif
/*******************************************************************
utility function to parse an integer parameter from
"parameter = value"
**********************************************************/
static char* get_string_param( const char* param )
{
char *p;
if ( (p = strchr( param, '=' )) == NULL )
return NULL;
return (p+1);
}
/*******************************************************************
********************************************************************/

View File

@ -24,37 +24,6 @@
#include "includes.h"
#include "utils/net.h"
/*********************************************************
utility function to parse an integer parameter from
"parameter = value"
**********************************************************/
static uint32 get_int_param( const char* param )
{
char *p;
p = strchr( param, '=' );
if ( !p )
return 0;
return atoi(p+1);
}
/*********************************************************
utility function to parse an integer parameter from
"parameter = value"
**********************************************************/
static char* get_string_param( const char* param )
{
char *p;
p = strchr( param, '=' );
if ( !p )
return NULL;
return (p+1);
}
/*********************************************************
Figure out if the input was an NT group or a SID string.
Return the SID.