httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <>
Subject Re: Recent table struct change
Date Mon, 26 Jan 1998 19:25:04 GMT
This is a change that enforces the API the way it was supposed to be used. 
I'm willing to back it out slightly... but now we've seen not only a few
core modules were broken, but so were mod_perl and php.  The reason for
making the change is that without it it's hard to use more sophisticated
structures for tables (and there's reason to believe this may be a
performance win, but we haven't found the right structure yet).  The API
had this in mind ages ago...  which is why there's the table_elts()

The fix for your code is straight forward, and works for all versions of

Wherever you refer to t->elts, replace it with this:

    array_header *arr = table_elts(t);
    table_entry *elts = (table_entry *)arr->elts;

Wherever you refer to t->nelts, use arr->nelts.

Since this works with all versions of Apache (ok at least 1.2 and 1.3) 
you don't need to conditionalize it, and so I don't think the MMN needs to
be bumped. 

I'd like to see this code cleaned up in all modules, but will back out the
"opaqueness" part of the change if pushed hard. 

Can someone suggest a good place to place these instructions? 


On Mon, 26 Jan 1998 wrote:

> Dean recently changed the table struct in alloc.h from
>     typedef array_header table;
> to
>     typedef table table;
> In my PHP module I am now getting:
>      main.c:992: dereferencing pointer to incomplete type
> Line 992 looks like this:
>   table_entry *elts = (table_entry *)r->subprocess_env->elts;
> This is probably an exceedingly stupid question, but how should I be
> casting this assignment?  With the table type being opague, the compiler
> doesn't know that 'elts' is an element of r->subprocess_env and thus
> correctly complains.
> This is another change that I think might have warranted an MMN bump.
> As far as I am concerned, I am not using anything that is not part of the
> API in my module, and whenever something is changed in Apache that breaks
> my module, I consider it an API change.
> -Rasmus

View raw message