On Wed, 28 Mar 2012, Dmitri Pal wrote:
On 03/28/2012 11:37 AM, Gergely Nagy wrote:
Dmitri Pal dpal@redhat.com writes:
The difference is in the API, not in the underlying structures in which you store the result.
Template-based would be something like: foo_log ("%(message) %(whatever)", msg, whatever);
While the same thing with 4 would look somewhat like: foo_log ("message", STRING, msg, "whatever", STRING, whatever, NULL);
The structure you end up with might very well be the same underneath, but the API is much different.
IMO they should be a part of the same interface
foo_log ("message", STRING, msg, "whatever", STRING, whatever, "readable_message" STRING "%(message) %(whatever)" NULL);
Or
foo_log ("readable_message" STRING "%(message) %(whatever)" "message", STRING, msg, "whatever", STRING, whatever, NULL);
Should be possible and produce the same result
the resulting logs should be the same, but I don't think that overloading the same function call for such very different approaches makes sense.
yes, you can always add enough flags and extra paramters to combine function calls, but that makes it more complicated to use any of them.
I see it more like
foo_logf("format string",type,value,type,value...)'
foo_logs( *tree);
David Lang