1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

r9102: Generate files in $srcdir/libcli/gen_raw instead of $srcdir.

Start fixing compile problems in generated output.
This commit is contained in:
Tim Potter 2005-08-05 05:32:39 +00:00 committed by Gerald (Jerry) Carter
parent d0f540bc46
commit e85b938ea0

View File

@ -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";