summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-23 02:11:55 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-23 02:11:55 +0000
commitb9dd8d34a05cae001b7e05df606d6ad040fa6f06 (patch)
treedf05cb5e2760a1aacb3ddd8ecd64b062c767eb8d
parent4df03a892122edefc46ad040aa0b8ccd2b2f06c2 (diff)
downloadsamba-b9dd8d34a05cae001b7e05df606d6ad040fa6f06.tar.gz
samba-b9dd8d34a05cae001b7e05df606d6ad040fa6f06.tar.bz2
samba-b9dd8d34a05cae001b7e05df606d6ad040fa6f06.zip
fixed loadparm handling properly
(This used to be commit 945ada7e7ec0f4b4df559bc171b9b18d30eff834)
-rw-r--r--source4/script/mkproto.pl61
1 files changed, 20 insertions, 41 deletions
diff --git a/source4/script/mkproto.pl b/source4/script/mkproto.pl
index 1ef17ae55d..662fda1f41 100644
--- a/source4/script/mkproto.pl
+++ b/source4/script/mkproto.pl
@@ -25,47 +25,26 @@ sub print_footer {
sub handle_loadparm {
my $line = shift;
- if ($line =~ /^FN_GLOBAL_STRING/o) {
- my $fnName = (split(/[\(,]/, $line))[1];
- print "char *$fnName(void);\n";
- } elsif ($line =~ /^FN_LOCAL_STRING/o) {
- my $fnName = (split(/[\(,]/, $line))[1];
- print "char *$fnName(int );\n";
- } elsif ($line =~ /^FN_GLOBAL_BOOL/o) {
- my $fnName = (split(/[\(,]/, $line))[1];
- print "BOOL $fnName(void);\n";
- }
- elsif ($line =~ /^FN_LOCAL_BOOL/o) {
- my $fnName = (split(/[\(,]/, $line))[1];
- print "BOOL $fnName(int );\n";
- }
- elsif ($line =~ /^FN_GLOBAL_INTEGER/o) {
- my $fnName = (split(/[\(,]/, $line))[1];
- print "int $fnName(void);\n";
- }
- elsif ($line =~ /^FN_LOCAL_INTEGER/o) {
- my $fnName = (split(/[\(,]/, $line))[1];
- print "int $fnName(int );\n";
- }
- elsif ($line =~ /^FN_GLOBAL_LIST/o) {
- my $fnName = (split(/[\(,]/, $line))[1];
- print "const char **$fnName(void);\n";
- }
- elsif ($line =~ /^FN_LOCAL_LIST/o) {
- my $fnName = (split(/[\(,]/, $line))[1];
- print "const char **$fnName(int );\n";
- }
- elsif ($line =~ /^FN_GLOBAL_CONST_STRING/o) {
- my $fnName = (split(/[\(,]/, $line))[1];
- print "const char *$fnName(void);\n";
- }
- elsif ($line =~ /^FN_LOCAL_CONST_STRING/o) {
- my $fnName = (split(/[\(,]/, $line))[1];
- print "const char *$fnName(int );\n";
- }
- elsif ($line =~ /^FN_LOCAL_CHAR/o) {
- my $fnName = (split(/[\(,]/, $line))[1];
- print "char $fnName(int );\n";
+ if ($line =~ /^FN_(GLOBAL|LOCAL)_(CONST_STRING|STRING|BOOL|CHAR|INTEGER|LIST)\((\w+),.*\)/) {
+ my $scope = $1;
+ my $type = $2;
+ my $name = $3;
+
+ my %tmap = (
+ "BOOL" => "BOOL ",
+ "CONST_STRING" => "const char *",
+ "STRING" => "char *",
+ "INTEGER" => "int ",
+ "CHAR" => "char ",
+ "LIST" => "const char **",
+ );
+
+ my %smap = (
+ "GLOBAL" => "void",
+ "LOCAL" => "int "
+ );
+
+ print "$tmap{$type}$name($smap{$scope});\n";
}
}