[PATCH] Auto-generate param_functions.c at build time

Andrew Bartlett abartlet at samba.org
Tue Jan 14 06:22:39 MST 2014


On Tue, 2014-01-14 at 18:15 +1300, Garming Sam wrote:
> This is a patch that goes on top of the tree that Andrew Bartlett posted 
> earlier.
> 
> Right now, the script only performs the generation for the 
> param_functions.c file, however, it should eventually support generation 
> of some of the other files dependent on it.
> 
> It also moves the final remaining special cases away from 
> param_functions so they can be noted and dealt with appropriately.
> 
> As well as successfully building,  the output was sorted and compared 
> with the original manually created file to check that it was consistent.
> 

Thanks Garming,

One thing we need to fix up is the comment at the top of
lib/param/loadparm.c and source3/param/loadparm.c:

 * To add a parameter:
 *
 * 1) add it to the global or service structure definition
 * 2) add it to the parm_table
 * 3) add it to the list of available functions (eg: using
FN_GLOBAL_STRING())
 * 4) If it's a global then initialise it in init_globals. If a local
 *    (ie. service) parameter then initialise it in the sDefault
structure

It needs to be something like:

 * To add a parameter:
 *
 * 1) add it to the XML documentation in docs-xml/smbdotconf
 * 2) add it to the parm_table in lib/param/param_table.c
 * 3) If it's a global then initialise it in init_globals. If a local
 *    (ie. service) parameter then initialise it in the sDefault
structure

The new way of adding an smb.conf parameter will be strange to some
developers who haven't followed this closely, so we need to give them as
many clues as possible.  Perhaps also put /* autogenerated from the XML
documentation in docs-xml/smbdotconf by script/generate_param.py */ at
the top of the generated files and just before the #include. 

Thanks,

Andrew Bartlett
-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba




More information about the samba-technical mailing list