summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Typelist.pm
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-10-03 23:27:33 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:39:20 -0500
commitf9a416743401121e1bc2961402cd6f87de68ca00 (patch)
treec5b83bc137b130022159934b22a90227da0ae67b /source4/pidl/lib/Parse/Pidl/Typelist.pm
parent012893cb421d77efc538c9f4c78b2421aef3f06e (diff)
downloadsamba-f9a416743401121e1bc2961402cd6f87de68ca00.tar.gz
samba-f9a416743401121e1bc2961402cd6f87de68ca00.tar.bz2
samba-f9a416743401121e1bc2961402cd6f87de68ca00.zip
r10694: Add some work I did this afternoon on getting pidl to output Samba3
RPC parsers. Currently the following files can be generated: - include/rpc_BASENAME.h - rpc_server/srv_BASENAME.c - rpc_server/srv_BASENAME_nt.c (template only, user has to fill in functions) - rpc_client/cli_BASENAME.c - rpc_parse/parse_BASENAME.c So far, I have been working on getting DFS working. Currently still to do (all in rpc_parse/parse_BASENAME.c): - Proper handling of declarations - Proper handling of scalar/buffer parts of structs and unions - Subcontexts - Proper handling of arrays - Support for custom (non-scalar) types I hope to have a somewhat more working version later this week. Some files as currently generated are available from: http://samba.org/~jelmer/pidl_samba3/ (This used to be commit 8af8eaeeef6d46f4d25ccb1d25890e1eef063e4f)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Typelist.pm')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Typelist.pm38
1 files changed, 1 insertions, 37 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Typelist.pm b/source4/pidl/lib/Parse/Pidl/Typelist.pm
index d81fedf71e..111ce9ba11 100644
--- a/source4/pidl/lib/Parse/Pidl/Typelist.pm
+++ b/source4/pidl/lib/Parse/Pidl/Typelist.pm
@@ -7,7 +7,7 @@ package Parse::Pidl::Typelist;
require Exporter;
@ISA = qw(Exporter);
-@EXPORT = qw(hasType getType mapType);
+@EXPORT_OK = qw(hasType getType mapType);
use vars qw($VERSION);
$VERSION = '0.01';
@@ -22,109 +22,90 @@ my $scalars = {
"void" => {
C_TYPE => "void",
IS_REFERENCE => 0,
- NDR_ALIGN => 0
},
# 1 byte types
"char" => {
C_TYPE => "char",
IS_REFERENCE => 0,
- NDR_ALIGN => 1
},
"int8" => {
C_TYPE => "int8_t",
IS_REFERENCE => 0,
- NDR_ALIGN => 1
},
"uint8" => {
C_TYPE => "uint8_t",
IS_REFERENCE => 0,
- NDR_ALIGN => 1
},
# 2 byte types
"int16" => {
C_TYPE => "int16_t",
IS_REFERENCE => 0,
- NDR_ALIGN => 2
},
"uint16" => { C_TYPE => "uint16_t",
IS_REFERENCE => 0,
- NDR_ALIGN => 2
},
# 4 byte types
"int32" => {
C_TYPE => "int32_t",
IS_REFERENCE => 0,
- NDR_ALIGN => 4
},
"uint32" => { C_TYPE => "uint32_t",
IS_REFERENCE => 0,
- NDR_ALIGN => 4
},
# 8 byte types
"hyper" => {
C_TYPE => "uint64_t",
IS_REFERENCE => 0,
- NDR_ALIGN => 8
},
"dlong" => {
C_TYPE => "int64_t",
IS_REFERENCE => 0,
- NDR_ALIGN => 4
},
"udlong" => {
C_TYPE => "uint64_t",
IS_REFERENCE => 0,
- NDR_ALIGN => 4
},
"udlongr" => {
C_TYPE => "uint64_t",
IS_REFERENCE => 0,
- NDR_ALIGN => 4
},
# DATA_BLOB types
"DATA_BLOB" => {
C_TYPE => "DATA_BLOB",
IS_REFERENCE => 0,
- NDR_ALIGN => 4
},
# string types
"string" => {
C_TYPE => "const char *",
IS_REFERENCE => 1,
- NDR_ALIGN => 4 #???
},
"string_array" => {
C_TYPE => "const char **",
IS_REFERENCE => 1,
- NDR_ALIGN => 4 #???
},
# time types
"time_t" => {
C_TYPE => "time_t",
IS_REFERENCE => 0,
- NDR_ALIGN => 4
},
"NTTIME" => {
C_TYPE => "NTTIME",
IS_REFERENCE => 0,
- NDR_ALIGN => 4
},
"NTTIME_1sec" => {
C_TYPE => "NTTIME",
IS_REFERENCE => 0,
- NDR_ALIGN => 4
},
"NTTIME_hyper" => {
C_TYPE => "NTTIME",
IS_REFERENCE => 0,
- NDR_ALIGN => 8
},
@@ -132,34 +113,28 @@ my $scalars = {
"WERROR" => {
C_TYPE => "WERROR",
IS_REFERENCE => 0,
- NDR_ALIGN => 4
},
"NTSTATUS" => {
C_TYPE => "NTSTATUS",
IS_REFERENCE => 0,
- NDR_ALIGN => 4
},
"COMRESULT" => {
C_TYPE => "COMRESULT",
IS_REFERENCE => 0,
- NDR_ALIGN => 4
},
# special types
"nbt_string" => {
C_TYPE => "const char *",
IS_REFERENCE => 1,
- NDR_ALIGN => 4 #???
},
"wrepl_nbt_name"=> {
C_TYPE => "struct nbt_name",
IS_REFERENCE => 0,
- NDR_ALIGN => 4
},
"ipv4address" => {
C_TYPE => "const char *",
IS_REFERENCE => 1,
- NDR_ALIGN => 4
}
};
@@ -175,17 +150,6 @@ sub mapScalarType($)
die("Unknown scalar type $name");
}
-sub getScalarAlignment($)
-{
- my $name = shift;
-
- # it's a bug when a type is not in the list
- # of known scalars or has no mapping
- return $scalars->{$name}{NDR_ALIGN} if defined($scalars->{$name}) and defined($scalars->{$name}{NDR_ALIGN});
-
- die("Unknown scalar type $name");
-}
-
sub addType($)
{
my $t = shift;