On Mon, 31 Mar 2008 22:24:50 +0200 Ruediger Pluem <[EMAIL PROTECTED]> wrote:
> I don't like exposing internals to a public API. If the API user > always calls it with NULL we should hide this from the API users by > using a thin wrapper. Indeed, I think clone needs to be hidden altogether, and plan to do so (make it automatic when parse and eval are called separately). > > #include "ap_expr.h" > > +#include <assert.h> > > Are we sure that assert.h is available on all platforms? Hmmm. I thought we had an assert function, but failed to find apr_assert. Turns out it's ap_assert, so I'll change it to that. Thanks for that. > > #define CREATE_NODE(pool,name) do { \ > > - (name) = apr_palloc(pool, sizeof(*(name))); \ > > - (name)->parent = (name)->left = (name)->right = NULL; \ > > - (name)->done = 0; \ > > - (name)->dump_done = 0; > > Why removing this initializations? > > \ > > + (name) = apr_pcalloc(pool, sizeof(*(name))); apr_pcalloc is a more concise equivalent:-) I changed the macro when I started hacking a solution that would have changed the parse_node struct. That was before resorting to the path of least resistance with clone(). -- Nick Kew Application Development with Apache - the Apache Modules Book http://www.apachetutor.org/