summaryrefslogtreecommitdiff
path: root/source4/build
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-06-13 22:22:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:18:07 -0500
commitc420c5a4c4bc2185f123058027f8328ade0d0a4e (patch)
treeb47081275005af23d7ad962063d83cf4da2987fc /source4/build
parent9ef145424afe44e6c0acccf95faad357868a46f3 (diff)
downloadsamba-c420c5a4c4bc2185f123058027f8328ade0d0a4e.tar.gz
samba-c420c5a4c4bc2185f123058027f8328ade0d0a4e.tar.bz2
samba-c420c5a4c4bc2185f123058027f8328ade0d0a4e.zip
r7552: Use ParseExpr() for [value] attributes; allows
us somewhat cleaner IDL. (This used to be commit b7b01bccd101654d1f5ec83cba9dea7e9431d6ce)
Diffstat (limited to 'source4/build')
-rw-r--r--source4/build/pidl/TODO8
-rw-r--r--source4/build/pidl/ndr_parser.pm4
-rw-r--r--source4/build/pidl/validator.pm1
3 files changed, 7 insertions, 6 deletions
diff --git a/source4/build/pidl/TODO b/source4/build/pidl/TODO
index 2f45c2d11a..d63fb4af7e 100644
--- a/source4/build/pidl/TODO
+++ b/source4/build/pidl/TODO
@@ -3,10 +3,10 @@
[string] attribute. Pidl itself would support a couple of extra
attributes for it's own use while being compatible with other IDL
compilers.
- Proposed extensions for pidl:
+ Proposed extensions for pidl (to arrays):
[convert(t)] attribute for forcing conversions from CH_UCS2, etc to UTF8
- [noterm] attribute
- [nullterm] attribute
+ [noterm] attribute -> Indicating there is no terminating character
+ [nullterm] attribute -> Indicating the string is null terminated
The various flags for strings would change as follows:
@@ -16,7 +16,7 @@ LIBNDR_FLAG_STR_SIZE4 -> [size_is()] or if needed [conformant]
LIBNDR_FLAG_STR_NOTERM -> [noterm]
LIBNDR_FLAG_STR_NULLTERM -> [nullterm]
LIBNDR_FLAG_STR_SIZE2 -> uint16 length; [string] char data[length]
-LIBNDR_FLAG_STR_BYTESIZE -> ???
+LIBNDR_FLAG_STR_BYTESIZE -> uint16 length; [string] char data[length]
LIBNDR_FLAG_STR_FIXLEN32 -> [32]
LIBNDR_FLAG_STR_CONFORMANT -> no longer needed
LIBNDR_FLAG_STR_CHARLEN -> ???
diff --git a/source4/build/pidl/ndr_parser.pm b/source4/build/pidl/ndr_parser.pm
index 0dd1289d80..7beefbf95d 100644
--- a/source4/build/pidl/ndr_parser.pm
+++ b/source4/build/pidl/ndr_parser.pm
@@ -704,7 +704,7 @@ sub ParseElementPush($$$$$$)
start_flags($e);
if (my $value = util::has_property($e, "value")) {
- pidl "$var_name = $value;";
+ pidl "$var_name = " . ParseExpr($value, $env) . ";";
}
ParseElementPushLevel($e, $e->{LEVELS}[0], $ndr, $var_name, $env, $primitives, $deferred);
@@ -748,7 +748,7 @@ sub ParseElementPrint($$$)
if (my $value = util::has_property($e, "value")) {
pidl "if (ndr->flags & LIBNDR_PRINT_SET_VALUES) {";
- pidl "\t$var_name = $value;";
+ pidl "\t$var_name = " . ParseExpr($value,$env) . ";";
pidl "}";
}
diff --git a/source4/build/pidl/validator.pm b/source4/build/pidl/validator.pm
index 6bd31db621..ebe8115985 100644
--- a/source4/build/pidl/validator.pm
+++ b/source4/build/pidl/validator.pm
@@ -130,6 +130,7 @@ my %property_list = (
# array
"range" => ["ELEMENT"],
"size_is" => ["ELEMENT"],
+ "string" => ["ELEMENT"],
"length_is" => ["ELEMENT"],
);