summaryrefslogtreecommitdiff
path: root/source4/pidl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-08-31 00:31:32 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:03:15 -0500
commit8d182d881d189e9855165b3a423f2d545a97fae8 (patch)
tree7c801df835838ad8bd555614b6e9c723fc77406b /source4/pidl
parent7acc0e77a6f6d74d1ccfcf04424a63b224b292a5 (diff)
downloadsamba-8d182d881d189e9855165b3a423f2d545a97fae8.tar.gz
samba-8d182d881d189e9855165b3a423f2d545a97fae8.tar.bz2
samba-8d182d881d189e9855165b3a423f2d545a97fae8.zip
r24816: Move the rest of the contents of core.h to more appropriate places.
include/ now only contains build system related headers, all other headers are now near the source code they're related to. (This used to be commit 6890a01dbfc6d8041a88ef5c6be52dfcd046fe80)
Diffstat (limited to 'source4/pidl')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/Header.pm4
-rw-r--r--source4/pidl/lib/Parse/Pidl/Util.pm15
-rwxr-xr-xsource4/pidl/tests/util.pl5
3 files changed, 20 insertions, 4 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
index 40fb1d3579..75d4c235cb 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
@@ -9,7 +9,7 @@ package Parse::Pidl::Samba4::Header;
use strict;
use Parse::Pidl qw(fatal);
use Parse::Pidl::Typelist qw(mapTypeName scalar_is_reference);
-use Parse::Pidl::Util qw(has_property is_constant);
+use Parse::Pidl::Util qw(has_property is_constant unmake_str);
use Parse::Pidl::Samba4 qw(is_intree ElementStars ArrayBrackets);
use vars qw($VERSION);
@@ -375,7 +375,7 @@ sub HeaderQuote($)
{
my($quote) = shift;
- pidl $quote->{DATA};
+ pidl unmake_str($quote->{DATA}) . "\n";
}
#####################################################################
diff --git a/source4/pidl/lib/Parse/Pidl/Util.pm b/source4/pidl/lib/Parse/Pidl/Util.pm
index 8716094abd..006718d139 100644
--- a/source4/pidl/lib/Parse/Pidl/Util.pm
+++ b/source4/pidl/lib/Parse/Pidl/Util.pm
@@ -6,7 +6,7 @@ package Parse::Pidl::Util;
require Exporter;
@ISA = qw(Exporter);
-@EXPORT = qw(has_property property_matches ParseExpr ParseExprExt is_constant make_str print_uuid MyDumper);
+@EXPORT = qw(has_property property_matches ParseExpr ParseExprExt is_constant make_str unmake_str print_uuid MyDumper);
use vars qw($VERSION);
$VERSION = '0.01';
@@ -104,6 +104,19 @@ sub make_str($)
return "\"$str\"";
}
+=item B<unmake_str>
+unquote a "" quoted string
+
+=cut
+sub unmake_str($)
+{
+ my $str = shift;
+
+ $str =~ s/^\"(.*)\"$/$1/;
+
+ return $str;
+}
+
=item B<print_uuid>
Print C representation of a UUID.
diff --git a/source4/pidl/tests/util.pl b/source4/pidl/tests/util.pl
index ba2f7b7b49..cb77f34c51 100755
--- a/source4/pidl/tests/util.pl
+++ b/source4/pidl/tests/util.pl
@@ -4,7 +4,7 @@
use strict;
use warnings;
-use Test::More tests => 70;
+use Test::More tests => 72;
use FindBin qw($RealBin);
use lib "$RealBin";
use Util;
@@ -33,6 +33,9 @@ is("\"\"bla\"\"", make_str("\"\"bla\"\""));
is("\"bla\"\"", make_str("bla\""));
is("\"foo\"bar\"", make_str("foo\"bar"));
+is("bla", unmake_str("\"bla\""));
+is("\"bla\"", unmake_str("\"\"bla\"\""));
+
# print_uuid()
is(undef, print_uuid("invalid"));
is("{0x12345778,0x1234,0xabcd,{0xef,0x00},{0x01,0x23,0x45,0x67,0x89,0xac}}",