summaryrefslogtreecommitdiff
path: root/source4/build/pidl/typelist.pm
diff options
context:
space:
mode:
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;