summaryrefslogtreecommitdiff
path: root/source4/build/pidl
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-17 09:32:57 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-17 09:32:57 +0000
commitc562794e7477e56251baea4f954794ec189f2847 (patch)
tree93424a569c235ed654453c49db0788718d0f8095 /source4/build/pidl
parent59df3ce5b5c5b484793a0e16faeb581ef343e167 (diff)
downloadsamba-c562794e7477e56251baea4f954794ec189f2847.tar.gz
samba-c562794e7477e56251baea4f954794ec189f2847.tar.bz2
samba-c562794e7477e56251baea4f954794ec189f2847.zip
started documenting the extension to IDL that pidl implements
(This used to be commit 22b5418a53149b42e71fd887866f75cdd53b81af)
Diffstat (limited to 'source4/build/pidl')
-rw-r--r--source4/build/pidl/NOTES.txt79
-rw-r--r--source4/build/pidl/header.pm8
-rw-r--r--source4/build/pidl/idl.gram1
3 files changed, 79 insertions, 9 deletions
diff --git a/source4/build/pidl/NOTES.txt b/source4/build/pidl/NOTES.txt
index 7726f22ec8..d4429fffa4 100644
--- a/source4/build/pidl/NOTES.txt
+++ b/source4/build/pidl/NOTES.txt
@@ -67,6 +67,85 @@ This will look like this on the wire:
[abc] [count] [foo] [PTR_s] [count] [s...]
+FIXED ARRAYS
+------------
+
+A fixed array looks like this:
+
+ typedef struct {
+ long s[10];
+ } Struct1;
+
+It appears on the wire with no array length.
+
+pidl also supports "inline" arrays, which are not part of the IDL/NDR
+standard. These are declared like this:
+
+ typedef struct {
+ uint32 foo;
+ uint32 count;
+ uint32 bar;
+ long s[count];
+ } Struct1;
+
+This appears like this:
+
+[foo] [count] [bar] [s...]
+
+Fixed arrays are an extension added to support some of the strange
+embedded structures in security descriptors and spoolss.
+
+
+[public] property
+-----------------
+
+The [public] property on a structure or union is a pidl extension that
+forces the generated pull/push functions to be non-static. This allows
+you to declare types that can be used between modules. If you don't
+specify [public] then pull/push functions for other than top-level
+functions are declared static.
+
+[relative] property
+-------------------
+
+The [relative] property can be supplied on a pointer. When it is used
+it declares the pointer as a spoolss style "relative" pointer, which
+means it appears on the wire as an offset within the current
+encapsulating structure. This is not part of normal IDL/NDR, but it is
+a very useful extension as it avoids the manual encoding of many
+complex structures.
+
+
+[noprint] property
+------------------
+
+The [noprint] property is a pidl extension that allows you to specify
+that pidl should not generate a ndr_print_*() function for that
+structure or union. This is used when you wish to define your own
+print function that prints a structure in a nicer manner. A good
+example is the use of [noprint] on dom_sid, which allows the
+pretty-printing of SIDs.
+
+[value] property
+----------------
+
+The [value(expression)] property is a pidl extension that allows you
+to specify the value of a field when it is put on the wire. This
+allows fields that always have a well-known value to be automatically
+filled in, thus making the API more programmer friendly. The
+expression can be any C expression, although if you refer to variables
+in the current structure you will need to dereference them with
+r->. See samr_Name as a good example.
+
+
+[nodiscriminant] property
+-------------------------
+
+The [nodiscriminant] property on a union means that the usual uint16
+discriminent field at the start of the union on the wire is
+omitted. This is not normally allowed in IDL/NDR, but is used for some
+spoolss structures.
+
VALIDATOR
---------
diff --git a/source4/build/pidl/header.pm b/source4/build/pidl/header.pm
index 7f7f2db977..cb64fe0ea3 100644
--- a/source4/build/pidl/header.pm
+++ b/source4/build/pidl/header.pm
@@ -41,14 +41,6 @@ sub HeaderElement($)
{
my($element) = shift;
- if (util::has_property($element, "struct_len")) {
- # a struct_len is an internal artifact - it is put on the
- # wire but not exposed via the api, which means it does
- # not appear in the header file
- return;
- }
-
-
(defined $element->{PROPERTIES}) && HeaderProperties($element->{PROPERTIES});
$res .= tabs();
HeaderType($element, $element->{TYPE}, "");
diff --git a/source4/build/pidl/idl.gram b/source4/build/pidl/idl.gram
index 461b4c8e2d..1a44f6e908 100644
--- a/source4/build/pidl/idl.gram
+++ b/source4/build/pidl/idl.gram
@@ -103,7 +103,6 @@ property: 'unique'
| 'in'
| 'out'
| 'ref'
- | 'struct_len'
| 'context_handle'
| 'string'
| 'public'