Thomas Brunko wrote:
.... snip ...
Now I would like to write a function transform:
APPLY_PAIR_F transform( APPLY_SINGLE_F apply );
This function builds from its parameter 'apply' a function that
can be used in the call to 'table_apply'. The result of transform
should be a function, that applies the 'apply' function to the
'value' of a (key->value) pair like this:
void * result_of_transform( void * key, void * value ){
return apply( value );
}
Of course it would be easier to write a function like
void * table_apply_value( TABE_P table, APPLY_SINGLE_F apply );
which applies 'apply' to the values of the table. But I don't want
to extend the interface of my tables if it's not absolutely
necessary.
Any suggestions?
Take a look at the implementation of hshwalk in my hashlib.zip
package. This allows the user to build just such an apply
operation, and many other things.
<http://cbfalconer.home.att.net/download/>
--
Chuck F (cb********@yahoo.com) (cb********@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!