From 5eb907f1d4d093f79998688a00c15b907e5d249a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 9 Nov 2003 08:28:47 +0000 Subject: added a module for auto-generating the client calls. We can now go from IDL file to working Samba4 RPC client library in a completely automated fashion. (This used to be commit 566476b3ff91eaa02c4f3c494afbf9ac7c200461) --- source4/build/pidl/pidl.pl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'source4/build/pidl/pidl.pl') diff --git a/source4/build/pidl/pidl.pl b/source4/build/pidl/pidl.pl index a3333da70a..8d15d86347 100755 --- a/source4/build/pidl/pidl.pl +++ b/source4/build/pidl/pidl.pl @@ -18,6 +18,7 @@ use dump; use header; use parser; use eparser; +use client; use util; my($opt_help) = 0; @@ -27,6 +28,7 @@ my($opt_diff) = 0; my($opt_header) = 0; my($opt_parser) = 0; my($opt_eparser) = 0; +my($opt_client); my($opt_keep) = 0; my($opt_output); @@ -59,7 +61,7 @@ sub ShowHelp() { print " perl IDL parser and code generator - Copyright tridge\@samba.org + Copyright (C) tridge\@samba.org Usage: pidl.pl [options] @@ -71,6 +73,7 @@ sub ShowHelp() --header create a C header file --parser create a C parser --eparser create an ethereal parser + --client FILENAME create client calls in FILENAME --diff run diff on the idl and dumped output --keep keep the .pidl file \n"; @@ -86,6 +89,7 @@ GetOptions ( 'header' => \$opt_header, 'parser' => \$opt_parser, 'eparser' => \$opt_eparser, + 'client=s' => \$opt_client, 'diff' => \$opt_diff, 'keep' => \$opt_keep ); @@ -136,6 +140,13 @@ if ($opt_eparser) { util::FileSave($parser, IdlEParser::Parse($idl)); } +if ($opt_client) { + my($idl) = util::LoadStructure($pidl_file); + my($client) = util::ChangeExtension($opt_client, "c"); + print "Generating $client client calls\n"; + util::FileSave($client, IdlClient::Parse($idl)); +} + if ($opt_diff) { my($idl) = util::LoadStructure($pidl_file); my($tempfile) = util::ChangeExtension($opt_output, "tmp"); -- cgit