summaryrefslogtreecommitdiff
path: root/source4/script
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2005-08-05 05:32:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:31:16 -0500
commit2d9d6c46897ab87c0a331900cade73e72c257ea9 (patch)
treee7db764d638400a2489e88d834f17f62e390bc15 /source4/script
parentbe15ec8344d252a4f6b22405e5e457793693530d (diff)
downloadsamba-2d9d6c46897ab87c0a331900cade73e72c257ea9.tar.gz
samba-2d9d6c46897ab87c0a331900cade73e72c257ea9.tar.bz2
samba-2d9d6c46897ab87c0a331900cade73e72c257ea9.zip
r9102: Generate files in $srcdir/libcli/gen_raw instead of $srcdir.
Start fixing compile problems in generated output. (This used to be commit e85b938ea0577c6263a28ceb722e173df475ead3)
Diffstat (limited to 'source4/script')
-rwxr-xr-xsource4/script/build_smb_interfaces.pl15
1 files changed, 12 insertions, 3 deletions
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";