Update from samba tree revision 14805 to 15243
============================ Samba log start ============ svn: When specifying working copy paths, only one target may be given ============================ Samba log end ============== svn path=/trunk/; revision=17994
This commit is contained in:
parent
e198ded297
commit
6b70d6d9f8
|
@ -0,0 +1,32 @@
|
|||
###################################################
|
||||
# Common Samba4 functions
|
||||
# Copyright jelmer@samba.org 2006
|
||||
# released under the GNU GPL
|
||||
|
||||
package Parse::Pidl::Samba4;
|
||||
|
||||
require Exporter;
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw(is_intree choose_header);
|
||||
|
||||
use Parse::Pidl::Util qw(has_property);
|
||||
use strict;
|
||||
|
||||
use vars qw($VERSION);
|
||||
$VERSION = '0.01';
|
||||
|
||||
sub is_intree()
|
||||
{
|
||||
return -f "include/smb.h";
|
||||
}
|
||||
|
||||
# Return an #include line depending on whether this build is an in-tree
|
||||
# build or not.
|
||||
sub choose_header($$)
|
||||
{
|
||||
my ($in,$out) = @_;
|
||||
return "#include \"$in\"" if (is_intree());
|
||||
return "#include <$out>";
|
||||
}
|
||||
|
||||
1;
|
|
@ -154,7 +154,11 @@ sub EjsPullPointer($$$$$)
|
|||
my ($e, $l, $var, $name, $env) = @_;
|
||||
pidl "if (ejs_pull_null(ejs, v, $name)) {";
|
||||
indent;
|
||||
pidl "$var = NULL;";
|
||||
if ($l->{POINTER_TYPE} eq "ref") {
|
||||
pidl "return NT_STATUS_INVALID_PARAMETER_MIX;";
|
||||
} else {
|
||||
pidl "$var = NULL;";
|
||||
}
|
||||
deindent;
|
||||
pidl "} else {";
|
||||
indent;
|
||||
|
@ -450,7 +454,11 @@ sub EjsPushPointer($$$$$)
|
|||
my ($e, $l, $var, $name, $env) = @_;
|
||||
pidl "if (NULL == $var) {";
|
||||
indent;
|
||||
pidl "NDR_CHECK(ejs_push_null(ejs, v, $name));";
|
||||
if ($l->{POINTER_TYPE} eq "ref") {
|
||||
pidl "return NT_STATUS_INVALID_PARAMETER_MIX;";
|
||||
} else {
|
||||
pidl "NDR_CHECK(ejs_push_null(ejs, v, $name));";
|
||||
}
|
||||
deindent;
|
||||
pidl "} else {";
|
||||
indent;
|
||||
|
|
|
@ -105,6 +105,7 @@ sub Parse($$$$)
|
|||
} else {
|
||||
$res .= "#define _GNU_SOURCE\n";
|
||||
$res .= "#include <stdio.h>\n";
|
||||
$res .= "#include <stdbool.h>\n";
|
||||
$res .= "#include <stdlib.h>\n";
|
||||
$res .= "#include <stdint.h>\n";
|
||||
$res .= "#include <stdarg.h>\n";
|
||||
|
|
|
@ -2356,6 +2356,7 @@ sub Parse($$$)
|
|||
pidl "#include <stdint.h>";
|
||||
pidl "#include <stdlib.h>";
|
||||
pidl "#include <stdio.h>";
|
||||
pidl "#include <stdbool.h>";
|
||||
pidl "#include <stdarg.h>";
|
||||
pidl "#include <string.h>";
|
||||
}
|
||||
|
|
|
@ -242,6 +242,7 @@ sub Parser($$$)
|
|||
pidl "#include \"includes.h\"";
|
||||
} else {
|
||||
pidl "#include <stdio.h>";
|
||||
pidl "#include <stdbool.h>";
|
||||
pidl "#include <stdlib.h>";
|
||||
pidl "#include <stdint.h>";
|
||||
pidl "#include <stdarg.h>";
|
||||
|
|
|
@ -54,6 +54,7 @@ SKIP: {
|
|||
print CC "#include <stdint.h>\n";
|
||||
print CC "#include <stdlib.h>\n";
|
||||
print CC "#include <stdio.h>\n";
|
||||
print CC "#include <stdbool.h>\n";
|
||||
print CC "#include <stdarg.h>\n";
|
||||
print CC $header;
|
||||
print CC $ndrheader;
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
#!/usr/bin/perl
|
||||
# NDR represent_as() / transmit_as() tests
|
||||
# (C) 2006 Jelmer Vernooij. Published under the GNU GPL
|
||||
use strict;
|
||||
|
||||
use Test::More tests => 1 * 8;
|
||||
use FindBin qw($RealBin);
|
||||
use lib "$RealBin/../lib";
|
||||
use lib "$RealBin";
|
||||
use Util qw(test_samba4_ndr);
|
||||
|
||||
test_samba4_ndr('represent_as-simple',
|
||||
'
|
||||
void bla([in,represent_as(uint32)] uint8 x);
|
||||
',
|
||||
'
|
||||
uint8_t expected[] = { 0x0D };
|
||||
DATA_BLOB in_blob = { expected, 1 };
|
||||
struct ndr_pull *ndr = ndr_pull_init_blob(&in_blob, NULL);
|
||||
struct bla r;
|
||||
|
||||
if (NT_STATUS_IS_ERR(ndr_pull_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
|
||||
return 1;
|
||||
|
||||
if (r.in.x != 13)
|
||||
return 2;
|
||||
',
|
||||
'
|
||||
#include <core/nterr.h>
|
||||
|
||||
NTSTATUS ndr_uint8_to_uint32(uint8_t from, uint32_t *to)
|
||||
{
|
||||
*to = from;
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
NTSTATUS ndr_uint32_to_uint8(uint32_t from, uint8_t *to)
|
||||
{
|
||||
*to = from;
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
'
|
||||
);
|
|
@ -0,0 +1,38 @@
|
|||
#!/usr/bin/perl
|
||||
# Support for tagged types
|
||||
# (C) 2005 Jelmer Vernooij. Published under the GNU GPL
|
||||
use strict;
|
||||
|
||||
use Test::More tests => 1 * 8;
|
||||
use FindBin qw($RealBin);
|
||||
use lib "$RealBin/../lib";
|
||||
use lib "$RealBin";
|
||||
use Util qw(test_samba4_ndr);
|
||||
|
||||
SKIP: {
|
||||
skip "Tagged types without typedef are not supported yet", 8;
|
||||
|
||||
test_samba4_ndr('struct-notypedef',
|
||||
'
|
||||
struct bla {
|
||||
uint8 x;
|
||||
};
|
||||
',
|
||||
'
|
||||
struct ndr_push *ndr = ndr_push_init();
|
||||
struct bla r;
|
||||
uint8_t expected[] = { 0x0D };
|
||||
DATA_BLOB expected_blob = { expected, 1 };
|
||||
DATA_BLOB result_blob;
|
||||
r.x = 13;
|
||||
|
||||
if (NT_STATUS_IS_ERR(ndr_push_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
|
||||
return 1;
|
||||
|
||||
result_blob = ndr_push_blob(ndr);
|
||||
|
||||
if (!data_blob_equal(&result_blob, &expected_blob))
|
||||
return 2;
|
||||
');
|
||||
|
||||
}
|
Loading…
Reference in New Issue