You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cli-dev@httpd.apache.org by Tonko Juricic <to...@yahoo.com> on 2004/12/10 18:13:05 UTC
Yet another way....
.. to fool the compiler (or CLR, or both) is to
created additional unmanaged wrapper methods.
For example, I was able to avoid dummy definition of
apr_table _t:
namespace Apache {
namespace Native {
extern "C"
{
struct apr_table_t {};
....
by introducing two umanaged functions in
WorkerRequest.cpp like this:
static const apr_array_header_t __nogc *
InternalAprTableElts(request_rec __nogc* rr, int mode)
{
return apr_table_elts(
mode==1?rr->headers_in:rr->subprocess_env);
}
static void InternalAprTableSet(request_rec __nogc
*rr,
const char __nogc * key,
const char __nogc * val )
{
apr_table_set(rr->headers_out, key, val);
}
This required moving bodies of
SendKnownResponseHeader() and
SendUnknownResponseHeader() from header to cpp file.
This worked but is clearly less efficient and uglier.
The only reason I tried it is because I found CLR
thinking that apr_table_t is value type large 1 byte
(caused by dummy definition) somewhat scary.
I guess that for now we have to rely on the fact that
all apr_table_t pointers inside request_rec are
marshalled as IntPtr.
Tony
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo