diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-11-06 12:29:23 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-11-06 12:29:23 +0000 |
commit | fa3db33a5441ed31f9d8c19dc6984d160b86e4da (patch) | |
tree | 12fd394ae4baad3eeded82953c39959a3521f362 /source4/build/pidl/eparser.pm | |
parent | 60f4bb657a5bbec766e170cb0755b1f36a33c8bc (diff) | |
download | samba-fa3db33a5441ed31f9d8c19dc6984d160b86e4da.tar.gz samba-fa3db33a5441ed31f9d8c19dc6984d160b86e4da.tar.bz2 samba-fa3db33a5441ed31f9d8c19dc6984d160b86e4da.zip |
updated pidl to auto-generate the ndr_push_*() functions for the
Samba4 rpc framework
not complete, but sufficient for a number of lsa functions
(This used to be commit 42cd6904f51bac1ff92f0aea0deffb11864dfac2)
Diffstat (limited to 'source4/build/pidl/eparser.pm')
-rw-r--r-- | source4/build/pidl/eparser.pm | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/source4/build/pidl/eparser.pm b/source4/build/pidl/eparser.pm index 3cb71a6c7e..bc69d831c8 100644 --- a/source4/build/pidl/eparser.pm +++ b/source4/build/pidl/eparser.pm @@ -1,5 +1,5 @@ ################################################### -# Ethereal parser generator for IDL structures +# parser generator for IDL structures # Copyright tpot@samba.org 2001 # Copyright tridge@samba.org 2000 # released under the GNU GPL @@ -10,21 +10,6 @@ use Data::Dumper; my($res); -sub is_scalar_type($) -{ - my($type) = shift; - - return 1, if ($type eq "uint32"); - return 1, if ($type eq "long"); - return 1, if ($type eq "short"); - return 1, if ($type eq "char"); - return 1, if ($type eq "uint16"); - return 1, if ($type eq "hyper"); - return 1, if ($type eq "wchar_t"); - - return 0; -} - sub has_property($$) { my($props) = shift; @@ -67,7 +52,7 @@ sub ParseArray($) my($elt) = shift; $res .= "\tfor (i = 0; i < count; i++) {\n"; - if (is_scalar_type($elt)) { + if (util::is_scalar_type($elt)) { $res .= "\t\toffset = prs_$elt->{TYPE}(tvb, offset, pinfo, tree, NULL, \"$elt->{NAME});\n"; $res .= "\t}\n\n"; } else { @@ -89,7 +74,7 @@ sub ParseElement($$) # Arg is a policy handle - if (has_property($elt->{PROPERTIES}, "context_handle")) { + if (util::has_property($elt->{PROPERTIES}, "context_handle")) { $res .= "\toffset = prs_policy_hnd(tvb, offset, pinfo, tree);\n"; return; } @@ -106,7 +91,7 @@ sub ParseElement($$) # Simple type are scalars too - if (is_scalar_type($elt->{TYPE})) { + if (util::is_scalar_type($elt->{TYPE})) { $res .= "\t\toffset = prs_$elt->{TYPE}(tvb, offset, pinfo, tree, NULL, \"$elt->{NAME}\");\n\n"; } } @@ -117,7 +102,7 @@ sub ParseElement($$) # Scalars are not buffers, except if they are pointed to - if (!is_scalar_type($elt->{TYPE}) || $elt->{POINTERS}) { + if (!util::is_scalar_type($elt->{TYPE}) || $elt->{POINTERS}) { # If we have a pointer, check it @@ -125,11 +110,11 @@ sub ParseElement($$) $res .= "\t\tif (ptr_$elt->{NAME})\n\t"; } - if (has_property($elt->{PROPERTIES}, "size_is")) { + if (util::has_property($elt->{PROPERTIES}, "size_is")) { ParseArray($elt); } else { $res .= "\t\toffset = prs_$elt->{TYPE}(tvb, offset, pinfo, tree, "; - if (is_scalar_type($elt->{TYPE})) { + if (util::is_scalar_type($elt->{TYPE})) { $res .= "NULL, "; } else { $res .= "flags, "; @@ -236,12 +221,12 @@ sub ParseFunctionArg($$) my($arg) = shift; my($io) = shift; # "in" or "out" - if (has_property($arg->{PROPERTIES}, $io)) { + if (util::has_property($arg->{PROPERTIES}, $io)) { # For some reason, pointers to elements in function definitions # aren't parsed. - if (defined($arg->{POINTERS}) && !is_scalar_type($arg->{TYPE})) { + if (defined($arg->{POINTERS}) && !util::is_scalar_type($arg->{TYPE})) { $arg->{POINTERS} -= 1, if ($arg->{POINTERS} > 0); delete($arg->{POINTERS}), if ($arg->{POINTERS} == 0); } |