3 ###################################################
4 # package to produce a table of all idl parsers
5 # Copyright tridge@samba.org 2003
6 # released under the GNU GPL
17 #########################################
22 perl IDL table generator
23 Copyright (C) tridge\@samba.org
25 Usage: tables.pl [options] <idlfile>
28 --output OUTNAME put output in OUTNAME.*
35 'help|h|?' => \$opt_help,
36 'output=s' => \$opt_output,
45 ###################################
46 # add include lines to tables.c
47 sub process_include($)
50 print TABLEC "#include \"$name\"\n";
53 ###################################
54 # extract table entries from 1 file
58 open(FILE, $filename) || die "unable to open $filename\n";
60 while (my $line = <FILE>) {
61 if ($line =~ /extern const struct dcerpc_interface_table dcerpc_table_(\w+);/) {
62 print TABLEC "\t&dcerpc_table_$1,\n";
63 print TABLEH "NTSTATUS dcerpc_$1\_init(void);\n";
70 print "Creating $opt_output.[ch]\n";
71 open(TABLEH, ">$opt_output.h") || die "failed to open $opt_output.h\n";
72 open(TABLEC, ">$opt_output.c") || die "failed to open $opt_output.c\n";
76 #define NDR_BASE_MARSHALL_SIZE 1024
79 #include \"includes.h\"
82 foreach my $filename (@ARGV) {
83 process_include($filename);
89 generated by pidl IDL table generator
91 const struct dcerpc_interface_table * const dcerpc_pipes[] = {
96 table headers generated by pidl IDL table generator
99 extern const struct dcerpc_interface_table * const dcerpc_pipes[];
103 foreach my $filename (@ARGV) {
104 process_file($filename);
108 print TABLEC "\tNULL\n};\n";