apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Garrett Rooney <roo...@electricjellyfish.net>
Subject Re: apr_dbd
Date Tue, 09 Aug 2005 21:39:02 GMT
Nick Kew wrote:
> On Tuesday 09 August 2005 21:33, Garrett Rooney wrote:
> 
>>Nick Kew wrote:
>>
>>>Anyway, as I said, a placeholder now fixes that.
>>
>>Out of curiosity, is there any reason we can't just forward declare the
>>struct and access the internals via some accessor functions?
> 
> 
> Hmmm, fair point.
> 
> There's one definite stumbling block there: the varargs APIs.
> Can the vararg functions (specifically, the pvquery and pvselect
> functions) be expressed as apr_dbd #defines, like the rest of
> the calls?  Anyone?

Why does that matter?  My suggestion doesn't involve any wrapper 
defines, just functions...

in apr_dbd.h:

typedef struct apr_dbd_driver_t apr_dbd_driver_t;

apr_status_t apr_dbd_func_that_takes_varargs(apr_dbd_driver_t *d, ...);

in driver.c

struct apr_dbd_driver_t {
   /* stuff */
};

apr_status_t apr_dbd_func_that_takes_varargs(apr_dbd_driver_t *d, ...)
{
   // turn ... into va_list
   return d->func(my_va_list);
}

I don't see the need for the macros at all...

-garrett

Mime
View raw message