From 2d9d6c46897ab87c0a331900cade73e72c257ea9 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 5 Aug 2005 05:32:39 +0000 Subject: r9102: Generate files in $srcdir/libcli/gen_raw instead of $srcdir. Start fixing compile problems in generated output. (This used to be commit e85b938ea0577c6263a28ceb722e173df475ead3) --- source4/script/build_smb_interfaces.pl | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'source4/script/build_smb_interfaces.pl') diff --git a/source4/script/build_smb_interfaces.pl b/source4/script/build_smb_interfaces.pl index bfa73b32a5..7c9bd3d365 100755 --- a/source4/script/build_smb_interfaces.pl +++ b/source4/script/build_smb_interfaces.pl @@ -13,9 +13,11 @@ require smb_interfaces; my $parser = new smb_interfaces; $header = $parser->parse($file); +stat "libcli/gen_raw" || mkdir("libcli/gen_raw") || die("mkdir"); + # Create header -open(FILE, ">ejs_${basename}.h"); +open(FILE, ">libcli/gen_raw/ejs_${basename}.h"); print FILE "/* header auto-generated by build_smb_interfaces.pl */\n\n"; @@ -60,16 +62,23 @@ close(FILE); # Create file -open(FILE, ">ejs_${basename}.c"); +open(FILE, ">libcli/gen_raw/ejs_${basename}.c"); print FILE "/* EJS wrapper functions auto-generated by build_smb_interfaces.pl */\n\n"; +print FILE "#include \"includes.h\"\n"; +print FILE "#include \"lib/appweb/ejs/ejs.h\"\n"; +print FILE "#include \"scripting/ejs/ejsrpc.h\"\n"; # TODO: remove this +print FILE "\n"; + # Top level push/pull functions sub print_field($$) { my $f = shift; my $suffix = shift; + my $type = "UNKNOWN"; + if ($f->{TYPE} eq "char" and $f->{POINTERS} == 1) { $type = "string"; } @@ -106,7 +115,7 @@ foreach my $x (@{$header}) { # Push from struct.out - print FILE "static NTSTATUS ejs_push_$x->{STRUCT_NAME}(struct ejs_rpc *ejs, struct MprVar *v, const struct $x->{STRUCT_NAME} *r)\n\n"; + print FILE "static NTSTATUS ejs_push_$x->{STRUCT_NAME}(struct ejs_rpc *ejs, struct MprVar *v, struct $x->{STRUCT_NAME} *r)\n\n"; print FILE "{\n"; print FILE "\tNDR_CHECK(ejs_push_struct_start(ejs, &v, \"output\"));\n"; -- cgit