Re: [PATCH] libxtables: Add exit_error cb to xtables_globals

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2009-02-10 at 17:20 +0100, Jan Engelhardt wrote:

> 
> I looked through this and wondered - how do we want to model
> the ownership of the structure?
> 
> For example, one possibility (which you did) is that
> xtables_globals is defined in the program, and libxtables
> takes a pointer/reference to it during xtables_set_params.
> 
> Alternatively, libxtables could collect the globals in
> a struct (defined in xtables.c), and programs override
> it at will, either by setting variables directly,
> like it is currently done with xtables_program_name,
> or by use of a function;
> 
> Any preference on which approach to choose?

I think you could go either way.

>From a personal taste perspective (and maybe usability as
defined by someone who is lazy like myself), I would pick the 
option that makes me write the smallest amount of code - which 
is what the current patches provide.
[I dislike libcurl for example which makes me call all
sorts of set() functions].

I would even wanna go further:
unify xtables_init(), xtables_set_nfproto() and 
xtables_set_params() i.e just have the app call
xtables_init(&myxtables_params). If the app only declares
myxtables_params and sets nothing in it, then xtables_init()
provides it with the default parameters (sort of what i do with
basic_exit_error)


cheers,
jamal

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux