[PATCH] Generate more of loadparm

Stefan (metze) Metzmacher metze at samba.org
Tue Oct 15 00:48:44 MDT 2013


Hi Volker,
hi Andrew,

>>> I noticed in your schannel-wip branch that you have a patch to try and
>>> finish the s3/lp_ctx glue.  I figured I would help out by getting this
>>> all automated, as I also needed an additional parameter passed though. 
>>>
>>> In the attached patches, I auto-generate that, and I also auto-generate
>>> all the lp_*() function prototypes, as a number were missing.  
>>>
>>> I look forward to the day when this is all much more consistent and
>>> generated along with our documentation, but for now I think this is a
>>> move in the right direction.  Certainly it highlights well the dreaded
>>> manually handled exceptions!
>>
>> Why perl and not python these days? And -- can we get at
>> least a minimum amount of hints for developers how all this
>> mess is supposed to work? I am horrendously scared by all
>> this.
> 
> I would love to swap more perl for python, but for the moment this
> borrows from a working perl infrastructure.  
> 
> What I can do is try and write up some documentation, to explain which
> parts expand with CPP and which other parts expand with perl.  I've
> written some initial notes below:  Where do you think it should go long
> term?  
> 
> The net result however is that to add or change an option, you only have
> to modify lib/param/param_table.c and lib/param/param_functions.c.  The
> rest is generated for you.  The glue I've automated more of today allows
> you to call lpcfg_*() from common code, and have that read the 'right'
> parameter table.  This is done via function pointers.  
> 
> This was done to allow merging from both ends - merging more parts of
> the loadparm handling, and merging code that needs to read the smb.conf,
> without having to do it all at once. 
> 
> The regular format of the CPP macros in param_functions.c is used to
> generate up the prototypes (mkproto.pl, mks3param_proto.pl), the service
> and globals table (mkparamdefs.pl), the glue table (mmks3param.pl) and
> the initilisation of the glue table (mks3param_ctx_table.pl). 
> 
> I have tried combining some of these, but it just makes the scripts more
> complex. 
> 
> The CPP macros are defined in and expand in lib/param/loadparm.c and
> source3/param/loadparm.c to read the values from the generated
> stuctures.  They are CPP #included into these files so that the same
> macro has two definitions, depending on the system it is loading into. 
> 
> I realise this probably worries you more than re-assures you, and I
> agree it need improvement, but I hope you can now understand a little of
> how it works. 

Maybe we can add some of this to lib/param/README?

I think the patches doesn't make the situation worse than it currently is,
And it makes it easier for to prepare my master4-schannel branch for master.

I'd like to push this, Volker any strong objections?

metze


More information about the samba-technical mailing list