1 ###################################################
2 # server template function generator
3 # Copyright tridge@samba.org 2003
4 # released under the GNU GPL
6 package Parse::Pidl::Samba3::Template;
18 my $nt = int((length($s)+1)/8);
20 my $ns = (length($s)-$lt);
21 return "\t"x($nt)." "x($ns);
24 #####################################################################
25 # produce boilerplate code for a interface
28 my($interface) = shift;
29 my($data) = $interface->{DATA};
30 my $name = $interface->{NAME};
34 Unix SMB/CIFS implementation.
36 endpoint server for the $name pipe
38 Copyright (C) YOUR NAME HERE YEAR
40 This program is free software; you can redistribute it and/or modify
41 it under the terms of the GNU General Public License as published by
42 the Free Software Foundation; either version 3 of the License, or
43 (at your option) any later version.
45 This program is distributed in the hope that it will be useful,
46 but WITHOUT ANY WARRANTY; without even the implied warranty of
47 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48 GNU General Public License for more details.
50 You should have received a copy of the GNU General Public License
51 along with this program. If not, see <http://www.gnu.org/licenses/>.
54 #include \"includes.h\"
55 #include \"ntdomain.h\"
56 #include \"../librpc/gen_ndr/srv_$name.h\"
60 foreach my $d (@{$data}) {
61 if ($d->{TYPE} eq "FUNCTION") {
62 my $fname = $d->{NAME};
63 my $pad = genpad("$d->{RETURN_TYPE} _$fname");
66 /****************************************************************
68 ****************************************************************/
70 $d->{RETURN_TYPE} _$fname(struct pipes_struct *p,
71 $pad"."struct $fname *r)
75 $res .= "\tp->fault_state = DCERPC_FAULT_OP_RNG_ERROR;\n";
76 if ($d->{RETURN_TYPE} eq "NTSTATUS") {
77 $res .= "\treturn NT_STATUS_NOT_IMPLEMENTED;\n";
78 } elsif ($d->{RETURN_TYPE} eq "WERROR") {
79 $res .= "\treturn WERR_NOT_SUPPORTED;\n";
90 #####################################################################
91 # parse a parsed IDL structure back into an IDL file
96 foreach my $x (@{$idl}) {
97 ($x->{TYPE} eq "INTERFACE") &&