Opaque structures in general (was Re: Opaque apr_pool_t structure)

2008-06-06 Thread Yann
I'm sorry to insist on this point but, in general, maybe you should consider having a function that provides the sizeof() each opaque structure/type of the APR (maybe not all of them, but at least some). That would let the user play with the opaque types without breaking the interest

Re: Opaque structures in general (was Re: Opaque apr_pool_t structure)

2008-06-06 Thread Ryan Bloom
I don't think that there is any reason to not have a sizeof() function, other than any code that does play with the pointers will be non-portable code. The reason that I originally went with opaque data structures (I did it before giving the code to the ASF), was that most of the structures are

Re: Opaque structures in general (was Re: Opaque apr_pool_t structure)

2008-06-06 Thread Yann
Sorry I didn't explain myself very well. I don't wan't to play with pointers, of course, a single sizeof won't allow me to do much more then a memcpy(). For example ( innocently :p ) : struct mystuct { apr_pool_t p; ... } myvar; apr_pool_t p; apr_pool_create(p, NULL);

Re: Opaque structures in general (was Re: Opaque apr_pool_t structure)

2008-06-06 Thread Yann Lavictoire
Christopher Key wrote: Yann wrote: Sorry I didn't explain myself very well. I don't wan't to play with pointers, of course, a single sizeof won't allow me to do much more then a memcpy(). For example ( innocently :p ) : struct mystuct { apr_pool_t p; ... } myvar; apr_pool_t p;

Re: Opaque structures in general (was Re: Opaque apr_pool_t structure)

2008-06-06 Thread Branko Čibej
Yann wrote: Sorry I didn't explain myself very well. I don't wan't to play with pointers, of course, a single sizeof won't allow me to do much more then a memcpy(). For example ( innocently :p ) : struct mystuct { apr_pool_t p; ... } myvar; apr_pool_t p; apr_pool_create(p, NULL);

Re: Opaque structures in general (was Re: Opaque apr_pool_t structure)

2008-06-06 Thread Erik Huelsmann
On 6/6/08, Ryan Bloom [EMAIL PROTECTED] wrote: I don't think that there is any reason to not have a sizeof() function, other than any code that does play with the pointers will be non-portable code. The reason that I originally went with opaque data structures (I did it before giving the code

Re: Opaque structures in general (was Re: Opaque apr_pool_t structure)

2008-06-06 Thread Yann
Branko Čibej wrote: Yann wrote: Sorry I didn't explain myself very well. I don't wan't to play with pointers, of course, a single sizeof won't allow me to do much more then a memcpy(). For example ( innocently :p ) : struct mystuct { apr_pool_t p; ... } myvar; apr_pool_t p;

Re: Opaque structures in general (was Re: Opaque apr_pool_t structure)

2008-06-06 Thread Yann
Erik Huelsmann wrote: On 6/6/08, Ryan Bloom [EMAIL PROTECTED] wrote: I don't think that there is any reason to not have a sizeof() function, other than any code that does play with the pointers will be non-portable code. The reason that I originally went with opaque data structures (I did it

Re: Opaque structures in general (was Re: Opaque apr_pool_t structure)

2008-06-06 Thread Ryan Bloom
On Fri, Jun 6, 2008 at 9:18 AM, Yann [EMAIL PROTECTED] wrote: Erik Huelsmann wrote: On 6/6/08, Ryan Bloom [EMAIL PROTECTED] wrote: I don't think that there is any reason to not have a sizeof() function, other than any code that does play with the pointers will be non-portable code. The

Re: Opaque structures in general (was Re: Opaque apr_pool_t structure)

2008-06-06 Thread Yann
Christopher Key wrote: Yann Lavictoire wrote: Big snip Ok, given your most recent post, I can see what you're doing now. I also think a mail client somewhere along the way had borken you're original code slightly, did you mean, struct { ... } myvar; apr_pool_t *p; This still seems like

Re: Opaque structures in general (was Re: Opaque apr_pool_t structure)

2008-06-06 Thread William A. Rowe, Jr.
Yann wrote: Sorry I didn't explain myself very well. I don't wan't to play with pointers, of course, a single sizeof won't allow me to do much more then a memcpy(). For example ( innocently :p ) : struct mystuct { apr_pool_t p; ... } myvar; apr_pool_t p; apr_pool_create(p, NULL);

Re: Opaque structures in general (was Re: Opaque apr_pool_t structure)

2008-06-06 Thread Sander Striker
On Fri, Jun 6, 2008 at 5:10 PM, Yann [EMAIL PROTECTED] wrote: Christopher Key wrote: [...] Ryan Bloom wrote: If this is what you really want/need, then I would suggest focusing on a patch that implements this functionality. Ryan OK, I can try to do that although I feel some sarcasm in

Re: Opaque structures in general (was Re: Opaque apr_pool_t structure)

2008-06-06 Thread Ryan Bloom
I agree with Sander, this should be relatively easy to implement using parent relationships. And, I didn't intend sarcasm. I really meant that if you have a feature that APR is missing, it is better to implement it inside APR, rather than implement a wrapper around the existing concept. Ryan

Re: Opaque structures in general (was Re: Opaque apr_pool_t structure)

2008-06-06 Thread Branko Čibej
Yann wrote: Branko Čibej wrote: Yann wrote: Sorry I didn't explain myself very well. I don't wan't to play with pointers, of course, a single sizeof won't allow me to do much more then a memcpy(). For example ( innocently :p ) : struct mystuct { apr_pool_t p; ... } myvar;