getting rid of mkproto.sh from Samba3
James Peach
jpeach at samba.org
Mon Jun 4 16:03:42 GMT 2007
On Jun 3, 2007, at 8:39 PM, simo wrote:
> On Sun, 2007-06-03 at 20:29 -0500, Gerald (Jerry) Carter wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Simo,
>>
>>> On Sun, 2007-06-03 at 14:31 -0700, James Peach wrote:
>>>> Hi all,
>>>>
>>>> Is there any interest in moving Samba3 from generated prototypes to
>>>> static headers. ie. getting rid of mkproto.sh and "make headers"?
>>>> I'd
>>>> like to start doing a bit of work in this area, but I don't want to
>>>> upset anyone if there's a lot of love out there for generated
>>>> prototypes ...
>>>
>>> If that means you can come out with another method to
>>> avoid changing .h files by hand, then you are welcome.
>>> Otherwise I think it would just be a step back I really
>>> don't see the need for.
>>
>> mkproto.sh promotes lazing programming, leads to bad interfaces
>> and to monolithic code.
>>
>> We should all suffer the pain of change *.h and *.c when
>> change an interface.
>
> You say it right here, "when change an interface".
> What would be nice, is to have something like in samba4, where you can
> mark an interface as public or private, and have a much better
> dependency driven set of auto-generated proto headers.
>
> Changing a private interface pose no problem, the real problem is with
> public interfaces, well I'd agree to keep manually changing public
> interfaces eventually, as that would make you immediately
> (hopefully :)
> understand you are changing a public facing interface non just an
> internal function.
>
>
> But for most of the internal code, having to change headers by hand is
> just an annoying slowdown imo.
No, the real problem is the internal interfaces.
For example, in kerberos_verify,c, there is a call to
"name_to_fqdn(my_fqdn, global_myname())".
If the host has a DNS configuration that includes a conventional
search path, this works. If it works, it does exactly the same thing
as get_mydnsfullname(). In fact, there are no uses of name_to_fqdn()
that cannot be replaced by get_mydnsfullname(). AFAICT, name_to_fqdn()
exists only because someone was not able to find get_mydnsfullname().
If I have a decent header file, I can see the full interface in a
single screen, along with comments, macros and typedefs. I don't think
the argument about the extra typing involved in changing headers by
hand is very strong, since the code needs to be read and understood
thousands more times than it needs to be written.
--
James Peach | jpeach at samba.org
More information about the samba-technical
mailing list