mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
r8200: - added stub functions for union pull/push
- kill the js interpreter with an exception on internal errors
This commit is contained in:
parent
67aa628413
commit
5f062d7148
@ -158,6 +158,18 @@ sub EjsStructPull($$)
|
||||
pidl "}\n\n";
|
||||
}
|
||||
|
||||
###########################
|
||||
# pull a union
|
||||
sub EjsUnionPull($$)
|
||||
{
|
||||
my $name = shift;
|
||||
my $d = shift;
|
||||
my $env = GenerateStructEnv($d);
|
||||
pidl "\nstatic NTSTATUS ejs_pull_$name(struct ejs_rpc *ejs, struct MprVar *v, const char *name, union $name *r)\n{\n";
|
||||
pidl "return ejs_panic(ejs, \"union pull not handled\");\n";
|
||||
pidl "}\n\n";
|
||||
}
|
||||
|
||||
###########################
|
||||
# pull a enum
|
||||
sub EjsEnumPull($$)
|
||||
@ -178,8 +190,15 @@ sub EjsEnumPull($$)
|
||||
sub EjsTypedefPull($)
|
||||
{
|
||||
my $d = shift;
|
||||
$d->{DATA}->{TYPE} eq 'STRUCT' && EjsStructPull($d->{NAME}, $d->{DATA});
|
||||
$d->{DATA}->{TYPE} eq 'ENUM' && EjsEnumPull($d->{NAME}, $d->{DATA});
|
||||
if ($d->{DATA}->{TYPE} eq 'STRUCT') {
|
||||
EjsStructPull($d->{NAME}, $d->{DATA});
|
||||
} elsif ($d->{DATA}->{TYPE} eq 'UNION') {
|
||||
EjsUnionPull($d->{NAME}, $d->{DATA});
|
||||
} elsif ($d->{DATA}->{TYPE} eq 'ENUM') {
|
||||
EjsEnumPull($d->{NAME}, $d->{DATA});
|
||||
} else {
|
||||
die "Unhandled pull typedef $d->{NAME} of type $d->{TYPE}\n";
|
||||
}
|
||||
}
|
||||
|
||||
#####################
|
||||
@ -306,7 +325,7 @@ sub EjsUnionPush($$)
|
||||
my $name = shift;
|
||||
my $d = shift;
|
||||
pidl "\nstatic NTSTATUS ejs_push_$name(struct ejs_rpc *ejs, struct MprVar *v, const char *name, const union $name *r)\n{\n";
|
||||
pidl "\treturn NT_STATUS_OK;\n";
|
||||
pidl "return ejs_panic(ejs, \"union push not handled\");\n";
|
||||
pidl "}\n\n";
|
||||
}
|
||||
|
||||
@ -329,9 +348,15 @@ sub EjsEnumPush($$)
|
||||
sub EjsTypedefPush($)
|
||||
{
|
||||
my $d = shift;
|
||||
$d->{DATA}->{TYPE} eq 'STRUCT' && EjsStructPush($d->{NAME}, $d->{DATA});
|
||||
$d->{DATA}->{TYPE} eq 'UNION' && EjsUnionPush($d->{NAME}, $d->{DATA});
|
||||
$d->{DATA}->{TYPE} eq 'ENUM' && EjsEnumPush($d->{NAME}, $d->{DATA});
|
||||
if ($d->{DATA}->{TYPE} eq 'STRUCT') {
|
||||
EjsStructPush($d->{NAME}, $d->{DATA});
|
||||
} elsif ($d->{DATA}->{TYPE} eq 'UNION') {
|
||||
EjsUnionPush($d->{NAME}, $d->{DATA});
|
||||
} elsif ($d->{DATA}->{TYPE} eq 'ENUM') {
|
||||
EjsEnumPush($d->{NAME}, $d->{DATA});
|
||||
} else {
|
||||
die "Unhandled push typedef $d->{NAME} of type $d->{TYPE}\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -157,6 +157,9 @@ done:
|
||||
talloc_free(ptr);
|
||||
done:
|
||||
ejsSetReturnValue(eid, mprNTSTATUS(status));
|
||||
if (NT_STATUS_EQUAL(status, NT_STATUS_INTERNAL_ERROR)) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user