1 ###################################################
2 # server template function generator
3 # Copyright tridge@samba.org 2003
4 # released under the GNU GPL
6 package Parse::Pidl::Samba::Template;
12 #####################################################################
13 # produce boilerplate code for a interface
16 my($interface) = shift;
17 my($data) = $interface->{DATA};
18 my $name = $interface->{NAME};
22 Unix SMB/CIFS implementation.
24 endpoint server for the $name pipe
26 Copyright (C) YOUR NAME HERE YEAR
28 This program is free software; you can redistribute it and/or modify
29 it under the terms of the GNU General Public License as published by
30 the Free Software Foundation; either version 2 of the License, or
31 (at your option) any later version.
33 This program is distributed in the hope that it will be useful,
34 but WITHOUT ANY WARRANTY; without even the implied warranty of
35 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 GNU General Public License for more details.
38 You should have received a copy of the GNU General Public License
39 along with this program; if not, write to the Free Software
40 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
43 #include \"includes.h\"
44 #include \"rpc_server/dcerpc_server.h\"
45 #include \"librpc/gen_ndr/ndr_$name.h\"
49 foreach my $d (@{$data}) {
50 if ($d->{TYPE} eq "FUNCTION") {
51 my $fname = $d->{NAME};
57 static $d->{RETURN_TYPE} $fname(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
60 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
69 /* include the generated boilerplate */
70 #include \"librpc/gen_ndr/ndr_$name\_s.c\"
75 #####################################################################
76 # parse a parsed IDL structure back into an IDL file
81 foreach my $x (@{$idl}) {
82 ($x->{TYPE} eq "INTERFACE") &&