On Wed, 2003-01-01 at 02:44, Stefan (metze) Metzmacher wrote:
> Hi *,
> 
> here are the parametric option changes of my big patch...
> 
> all lp_param_*() functions now take the default value as last parameter
> this is usefull for all fn's and needed for the enum,bool,int and ulong 
> functions :-)

Is this the best way to do it - if we are going to have a notion of
defaults, then doing it per-call is just waiting for disaster!  Given
that we are moving to a 'registration' style of module system (where we
know at startup what modules we have), I think we really should move
'parametric options' to a registrations system too.  Indeed, this would
allow the implement ion of callback syntax checking, which could make
testparm useful again.

> lp_parm_string_list() now use talloc_str_list_make() and 
> talloc_realloc_str_list_make and caches the the result for the called 
> seperator, so if the function is called with the same separator it is not 
> needed to call *_str_list_make()
> 
> if the function is called with an other separator the old list is free'ed
> 
> so we didn't get a memory leek if we call:
> 
> lp_parm_string_list(SNUM(conn), "test","name"," \n\r\t", NULL);
> lp_parm_string_list(SNUM(conn), "test","name",";,.", NULL);
> lp_parm_string_list(SNUM(conn), "test","name"," \n\r\t", NULL);
> lp_parm_string_list(SNUM(conn), "test","name",";,.", NULL);
> lp_parm_string_list(SNUM(conn), "test","name"," \n\r\t", NULL);

Why do we allow the separator to be changed at all?  The 'normal'
options in Samba don't all this - I really don't see the need for the
added complexity.  Furthermore, how are you going to tell SWAT etc about
this - it should display lists as lists, and not depend on function
parameters to get it right.  I just don't like the idea that a list
could change depending on a parameter somebody will always get slightly
wrong.

> talloc_realloc_str_list_make()
> 
> a add talloc_free() witch free's the memory of one talloc'ed memory segment

This doesn't seem right - why not just free and replace that talloc
context?

> a also add a view talloc_realloc_*() functions
> 
> talloc_realloc_strdup() ...

Why?

Andrew Bartlett

-- 
Andrew Bartlett                                 [EMAIL PROTECTED]
Manager, Authentication Subsystems, Samba Team  [EMAIL PROTECTED]
Student Network Administrator, Hawker College   [EMAIL PROTECTED]
http://samba.org     http://build.samba.org     http://hawkerc.net

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to