String structures
tridge at samba.org
tridge at samba.org
Thu Jul 21 09:08:45 GMT 2005
Andrew,
> This reminds me - why do we not have such luxury in the C bindings? We
> seem to be almost there (utf8 string), but with a bit of baggage (that
> structure) left behind...
pidl hides all NDR level artifacts, but the "lsa_String" sillyness is
not due to NDR level information, its because Microsoft literally
defined a structure at the IDL level to hold those strings.
We certainly could hide this from the C code by marking that structure
as nopush/nopull/noprint in the IDL and teaching the header generator
to make it a char*, though it would have the disadvantage that when we
are trying to work out the size=length+1 versus size=length
differences between pipes those differences would be harder to
spot. It would also make the auto-alignment rules harder.
It was much easier in ejs wrappers, as it just leverages the existing
print routines (so the lengths are still shown when you use [print])
and the generated ejs wrappers don't create headers, so no need to
munge the types there.
So I'm inclined a bit towards keeping this exposed in the C API,
though its a close call. It just seems cleanest to have the rule that
the C API exposes everything in the IDL file, but none of the NDR
level artifacts.
Cheers, Tridge
More information about the samba-technical
mailing list