diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2004-11-16 21:07:08 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:05:53 -0500 |
commit | 46badf19089668e470e9bb5b2300017f8948b49e (patch) | |
tree | 5625999d4333c30f6cedce7cbfc73ced1b2791ef /source4/build/pidl/tables.pl | |
parent | 83d29e9bac43f643eb4ab11871425019f2ea9421 (diff) | |
download | samba-46badf19089668e470e9bb5b2300017f8948b49e.tar.gz samba-46badf19089668e470e9bb5b2300017f8948b49e.tar.bz2 samba-46badf19089668e470e9bb5b2300017f8948b49e.zip |
r3790: use a registration function that is called from dcerpc_*_init functions
rather then a large table in librpc/gen_ndr/tables.c. This will allow us
to only link in only the required gen_ndr files (speeds up linking quite a
bit, makes binaries smaller).
Each gen_ndr_* file now has a init function that calls the init functions
of the interfaces it contains. I did it this way to keep pidl's code simple,
though it might hurt startup time a bit. I'd be happy to change it if
people like one function better.
(This used to be commit 3c436590ae95b58ad6d00e72d6fdd08a4d80f208)
Diffstat (limited to 'source4/build/pidl/tables.pl')
-rwxr-xr-x | source4/build/pidl/tables.pl | 111 |
1 files changed, 0 insertions, 111 deletions
diff --git a/source4/build/pidl/tables.pl b/source4/build/pidl/tables.pl deleted file mode 100755 index 8d43dff146..0000000000 --- a/source4/build/pidl/tables.pl +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/perl -w - -################################################### -# package to produce a table of all idl parsers -# Copyright tridge@samba.org 2003 -# released under the GNU GPL - -use strict; - -use Getopt::Long; -use File::Basename; - -my($opt_output); -my($opt_help) = 0; - - -######################################### -# display help text -sub ShowHelp() -{ - print " - perl IDL table generator - Copyright (C) tridge\@samba.org - - Usage: tables.pl [options] <idlfile> - - Options: - --output OUTNAME put output in OUTNAME.* - \n"; - exit(0); -} - -# main program -GetOptions ( - 'help|h|?' => \$opt_help, - 'output=s' => \$opt_output, - ); - -if ($opt_help) { - ShowHelp(); - exit(0); -} - - -################################### -# add include lines to tables.c -sub process_include($) -{ - my $name = shift; - print TABLEC "#include \"$name\"\n"; -} - -################################### -# extract table entries from 1 file -sub process_file($) -{ - my $filename = shift; - open(FILE, $filename) || die "unable to open $filename\n"; - - while (my $line = <FILE>) { - if ($line =~ /extern const struct dcerpc_interface_table dcerpc_table_(\w+);/) { - print TABLEC "\t&dcerpc_table_$1,\n"; - print TABLEH "NTSTATUS dcerpc_$1\_init(void);\n"; - } - } - - close(FILE); -} - -print "Creating $opt_output.[ch]\n"; -open(TABLEH, ">$opt_output.h") || die "failed to open $opt_output.h\n"; -open(TABLEC, ">$opt_output.c") || die "failed to open $opt_output.c\n"; - -#include "includes.h" - -#define NDR_BASE_MARSHALL_SIZE 1024 - -print TABLEC " -#include \"includes.h\" -"; - -foreach my $filename (@ARGV) { - process_include($filename); -} - - -print TABLEC " -/* - generated by pidl IDL table generator -*/ -const struct dcerpc_interface_table * const dcerpc_pipes[] = { -"; - -print TABLEH " -/* - table headers generated by pidl IDL table generator -*/ - -extern const struct dcerpc_interface_table * const dcerpc_pipes[]; - -"; - -foreach my $filename (@ARGV) { - process_file($filename); -} - - -print TABLEC "\tNULL\n};\n"; - -close(TABLEH); -close(TABLEC); |