summaryrefslogtreecommitdiff
path: root/source4/build/pidl/typelist.pm
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-02-20 12:17:33 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:10:48 -0500
commitc33c4569e51f2a351d16932cd491ec30545c8f70 (patch)
tree667ea1a67c9c621b11216c1d08b904928e980e1d /source4/build/pidl/typelist.pm
parent64112074e9772aead31092c8713e077d1aff050b (diff)
downloadsamba-c33c4569e51f2a351d16932cd491ec30545c8f70.tar.gz
samba-c33c4569e51f2a351d16932cd491ec30545c8f70.tar.bz2
samba-c33c4569e51f2a351d16932cd491ec30545c8f70.zip
r5466: Put the type information list in a seperate module
(require for some of the COM stuff) (This used to be commit fbce7464b2a61a46f5135ba2a341bea4e53f28e7)
Diffstat (limited to 'source4/build/pidl/typelist.pm')
-rw-r--r--source4/build/pidl/typelist.pm56
1 files changed, 56 insertions, 0 deletions
diff --git a/source4/build/pidl/typelist.pm b/source4/build/pidl/typelist.pm
new file mode 100644
index 0000000000..e5d6a81355
--- /dev/null
+++ b/source4/build/pidl/typelist.pm
@@ -0,0 +1,56 @@
+###################################################
+# Samba4 parser generator for IDL structures
+# Copyright jelmer@samba.org 2005
+# released under the GNU GPL
+
+package typelist;
+
+use strict;
+
+my %typedefs;
+
+sub addType($)
+{
+ my $t = shift;
+ $typedefs{$t->{NAME}} = $t;
+}
+
+sub getType($)
+{
+ my $t = shift;
+ return undef unless(defined($typedefs{$t}));
+ return $typedefs{$t};
+}
+
+sub hasType($)
+{
+ my $t = shift;
+ return 1 if defined($typedefs{$t});
+ return 0;
+}
+
+sub RegisterPrimitives()
+{
+ my @primitives = (
+ "char", "int8", "uint8", "short", "wchar_t",
+ "int16", "uint16", "long", "int32", "uint32",
+ "dlong", "udlong", "udlongr", "NTTIME", "NTTIME_1sec",
+ "time_t", "DATA_BLOB", "error_status_t", "WERROR",
+ "NTSTATUS", "boolean32", "unsigned32", "ipv4address",
+ "hyper", "NTTIME_hyper");
+
+ foreach my $k (@primitives) {
+ $typedefs{$k} = {
+ NAME => $k,
+ TYPE => "TYPEDEF",
+ DATA => {
+ TYPE => "SCALAR",
+ NAME => $k
+ }
+ };
+ }
+}
+
+RegisterPrimitives();
+
+1;