From cda86869400285afe17db87a9a666fbcc5b918a8 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 8 Jul 2011 09:19:43 +1000 Subject: lib/param: Merge struct loadparm_service into common This is handled by a common header and a .c file that is included into both loadparm.c files. In the process, _lp functions were renamed to lp__ to allow the common function definition declarations to be used by source3 and source4 (which have different macro definitions). The only parameter to change type is 'strict_locking' which was a bool, and is now an int, to accommodate the 'Auto' value from source3. Andrew Bartlett Autobuild-User: Andrew Bartlett Autobuild-Date: Fri Jul 8 12:35:56 CEST 2011 on sn-devel-104 --- source4/script/mkproto.pl | 54 +++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 21 deletions(-) (limited to 'source4/script/mkproto.pl') diff --git a/source4/script/mkproto.pl b/source4/script/mkproto.pl index 4760e63bda..348f150e6d 100755 --- a/source4/script/mkproto.pl +++ b/source4/script/mkproto.pl @@ -127,28 +127,40 @@ sub print_footer($$) sub handle_loadparm($$) { my ($file,$line) = @_; - - if ($line =~ /^FN_(GLOBAL|LOCAL)_(CONST_STRING|STRING|BOOL|bool|CHAR|INTEGER|LIST)\((\w+),.*\)/o) { - my $scope = $1; - my $type = $2; - my $name = $3; - - my %tmap = ( - "BOOL" => "bool ", - "CONST_STRING" => "const char *", - "STRING" => "const char *", - "INTEGER" => "int ", - "CHAR" => "char ", - "LIST" => "const char **", - ); - - my %smap = ( - "GLOBAL" => "struct loadparm_context *", - "LOCAL" => "struct loadparm_service *, struct loadparm_service *" - ); - - $file->("$tmap{$type}lpcfg_$name($smap{$scope});\n"); + my $scope; + my $type; + my $name; + my $var; + + if ($line =~ /^FN_(GLOBAL|LOCAL)_(CONST_STRING|STRING|BOOL|bool|CHAR|INTEGER|LIST)\((\w+),(.*)\)/o) { + $scope = $1; + $type = $2; + $name = $3; + $var = $4; + } elsif ($line =~ /^FN_(GLOBAL|LOCAL)_PARM_(CONST_STRING|STRING|BOOL|bool|CHAR|INTEGER|LIST)\((\w+),(.*)\)/o) { + $scope = $1; + $type = $2; + $name = $3; + $var = $4; + } else { + return; } + + my %tmap = ( + "BOOL" => "bool ", + "CONST_STRING" => "const char *", + "STRING" => "const char *", + "INTEGER" => "int ", + "CHAR" => "char ", + "LIST" => "const char **", + ); + + my %smap = ( + "GLOBAL" => "struct loadparm_context *", + "LOCAL" => "struct loadparm_service *, struct loadparm_service *" + ); + + $file->("$tmap{$type}lpcfg_$name($smap{$scope});\n"); } sub process_file($$$) -- cgit